xref: /DragonOS/kernel/src/arch/riscv64/asm/csr.rs (revision 1df85daf8f1b4426fe09d489d815997cdf989a87)
1 #![allow(dead_code)]
2 pub const CSR_SSTATUS: usize = 0x100;
3 pub const CSR_SSCRATCH: usize = 0x140;
4 pub const CSR_SEPC: usize = 0x141;
5 pub const CSR_SCAUSE: usize = 0x142;
6 pub const CSR_STVAL: usize = 0x143;
7 
8 // === Status register flags ===
9 
10 /// Previously Supervisor
11 pub const SR_SPP: usize = 0x00000100;
12 /// Supervisor User Memory Access
13 pub const SR_SUM: usize = 0x00040000;
14 
15 /// Floating-Point Status
16 pub const SR_FS: usize = 0x00006000;
17 /// Vector status
18 pub const SR_VS: usize = 0x00000600;
19 
20 /// Vector and Floating-Point Unit
21 pub const SR_FS_VS: usize = SR_FS | SR_VS;
22