xref: /DragonOS/kernel/src/arch/riscv64/include/asm/csr.h (revision 5c4224e5a8244cb0fb32512e70354362fccd6321)
1*5c4224e5SLoGin #pragma once
2*5c4224e5SLoGin 
3*5c4224e5SLoGin #define CSR_SSTATUS 0x100
4*5c4224e5SLoGin #define CSR_SIE 0x104
5*5c4224e5SLoGin #define CSR_STVEC 0x105
6*5c4224e5SLoGin #define CSR_SIP 0x144
7*5c4224e5SLoGin #define CSR_SSCRATCH 0x140
8*5c4224e5SLoGin 
9*5c4224e5SLoGin #define CSR_TVEC CSR_STVEC
10*5c4224e5SLoGin #define CSR_SCRATCH CSR_SSCRATCH
11*5c4224e5SLoGin 
12*5c4224e5SLoGin #define CSR_STATUS CSR_SSTATUS
13*5c4224e5SLoGin #define CSR_IE CSR_SIE
14*5c4224e5SLoGin #define CSR_IP CSR_SIP
15*5c4224e5SLoGin 
16*5c4224e5SLoGin #define SR_FS 0x00006000
17*5c4224e5SLoGin #define SR_VS 0x00000600
18*5c4224e5SLoGin #define SR_FS_VS (SR_FS | SR_VS) /* Vector and Floating-Point Unit */
19*5c4224e5SLoGin 
20*5c4224e5SLoGin #define SATP_MODE_39 0x8000000000000000ULL
21*5c4224e5SLoGin #define SATP_MODE_48 0x9000000000000000ULL
22*5c4224e5SLoGin #define SATP_MODE_57 0xa000000000000000ULL
23*5c4224e5SLoGin 
24*5c4224e5SLoGin #define PAGE_OFFSET 0xffffffc000000000
25*5c4224e5SLoGin #define KERNEL_LINK_OFFSET 0x1000000
26*5c4224e5SLoGin #define KERNEL_VIRT_START (PAGE_OFFSET + KERNEL_LINK_OFFSET)