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