2525/* CSRs */
2626enum {
2727 /* floating point */
28- CSR_FFLAGS = 0x001 , /* Floating-point accrued exceptions */
29- CSR_FRM = 0x002 , /* Floating-point dynamic rounding mode */
30- CSR_FCSR = 0x003 , /* Floating-point control and status register */
28+ CSR_FFLAGS = 0x001 , /* Floating-point accrued exceptions */
29+ CSR_FRM = 0x002 , /* Floating-point dynamic rounding mode */
30+ CSR_FCSR = 0x003 , /* Floating-point control and status register */
3131
3232 /* Supervisor trap setup */
3333 CSR_SSTATUS = 0x100 , /* Supervisor status register */
@@ -36,20 +36,20 @@ enum {
3636 CSR_SCOUNTEREN = 0x106 , /* Supervisor counter enable */
3737
3838 /* Supervisor trap handling */
39- CSR_SSCRATCH = 0x140 , /* Supervisor register for machine trap handlers */
40- CSR_SEPC = 0x141 , /* Supervisor exception program counter */
41- CSR_SCAUSE = 0x142 , /* Supervisor trap cause */
42- CSR_STVAL = 0x143 , /* Supervisor bad address or instruction */
43- CSR_SIP = 0x144 , /* Supervisor interrupt pending */
39+ CSR_SSCRATCH = 0x140 , /* Supervisor register for machine trap handlers */
40+ CSR_SEPC = 0x141 , /* Supervisor exception program counter */
41+ CSR_SCAUSE = 0x142 , /* Supervisor trap cause */
42+ CSR_STVAL = 0x143 , /* Supervisor bad address or instruction */
43+ CSR_SIP = 0x144 , /* Supervisor interrupt pending */
4444
4545 /* Supervisor protection and translation */
46- CSR_SATP = 0x180 , /* Supervisor address translation and protection */
46+ CSR_SATP = 0x180 , /* Supervisor address translation and protection */
4747
4848 /* Machine information registers */
49- CSR_MVENDORID = 0xF11 , /* Vendor ID */
50- CSR_MARCHID = 0xF12 , /* Architecture ID */
51- CSR_MIMPID = 0xF13 , /* Implementation ID */
52- CSR_MHARTID = 0xF14 , /* Hardware thread ID */
49+ CSR_MVENDORID = 0xF11 , /* Vendor ID */
50+ CSR_MARCHID = 0xF12 , /* Architecture ID */
51+ CSR_MIMPID = 0xF13 , /* Implementation ID */
52+ CSR_MHARTID = 0xF14 , /* Hardware thread ID */
5353
5454 /* Machine trap setup */
5555 CSR_MSTATUS = 0x300 , /* Machine status register */
@@ -61,15 +61,15 @@ enum {
6161 CSR_MCOUNTEREN = 0x306 , /* Machine counter enable */
6262
6363 /* machine trap handling */
64- CSR_MSCRATCH = 0x340 , /* Scratch register for machine trap handlers */
65- CSR_MEPC = 0x341 , /* Machine exception program counter */
66- CSR_MCAUSE = 0x342 , /* Machine trap cause */
67- CSR_MTVAL = 0x343 , /* Machine bad address or instruction */
68- CSR_MIP = 0x344 , /* Machine interrupt pending */
64+ CSR_MSCRATCH = 0x340 , /* Scratch register for machine trap handlers */
65+ CSR_MEPC = 0x341 , /* Machine exception program counter */
66+ CSR_MCAUSE = 0x342 , /* Machine trap cause */
67+ CSR_MTVAL = 0x343 , /* Machine bad address or instruction */
68+ CSR_MIP = 0x344 , /* Machine interrupt pending */
6969
7070 /* low words */
71- CSR_CYCLE = 0xC00 , /* Cycle counter for RDCYCLE instruction */
72- CSR_TIME = 0xC01 , /* Timer for RDTIME instruction */
71+ CSR_CYCLE = 0xC00 , /* Cycle counter for RDCYCLE instruction */
72+ CSR_TIME = 0xC01 , /* Timer for RDTIME instruction */
7373 CSR_INSTRET = 0xC02 ,
7474
7575 /* high words */
@@ -142,22 +142,22 @@ struct riscv_internal {
142142#endif
143143
144144 /* csr registers */
145- uint64_t csr_cycle ; /* Machine cycle counter */
146- uint32_t csr_time [2 ]; /* Performance counter */
147- uint32_t csr_mstatus ; /* Machine status register */
148- uint32_t csr_mtvec ; /* Machine trap-handler base address */
149- uint32_t csr_misa ; /* ISA and extensions */
150- uint32_t csr_mtval ; /* Machine bad address or instruction */
151- uint32_t csr_mcause ; /* Machine trap cause */
152- uint32_t csr_mscratch ; /* Scratch register for machine trap handler */
153- uint32_t csr_mepc ; /* Machine exception program counter */
154- uint32_t csr_mip ; /* Machine interrupt pending */
155- uint32_t csr_mie ; /* Machine interrupt enable */
156- uint32_t csr_mideleg ; /* Machine interrupt delegation register */
157- uint32_t csr_medeleg ; /* Machine exception delegation register */
158- uint32_t csr_mvendorid ; /* vendor ID */
159- uint32_t csr_marchid ; /* Architecture ID */
160- uint32_t csr_mimpid ; /* Implementation ID */
145+ uint64_t csr_cycle ; /* Machine cycle counter */
146+ uint32_t csr_time [2 ]; /* Performance counter */
147+ uint32_t csr_mstatus ; /* Machine status register */
148+ uint32_t csr_mtvec ; /* Machine trap-handler base address */
149+ uint32_t csr_misa ; /* ISA and extensions */
150+ uint32_t csr_mtval ; /* Machine bad address or instruction */
151+ uint32_t csr_mcause ; /* Machine trap cause */
152+ uint32_t csr_mscratch ; /* Scratch register for machine trap handler */
153+ uint32_t csr_mepc ; /* Machine exception program counter */
154+ uint32_t csr_mip ; /* Machine interrupt pending */
155+ uint32_t csr_mie ; /* Machine interrupt enable */
156+ uint32_t csr_mideleg ; /* Machine interrupt delegation register */
157+ uint32_t csr_medeleg ; /* Machine exception delegation register */
158+ uint32_t csr_mvendorid ; /* vendor ID */
159+ uint32_t csr_marchid ; /* Architecture ID */
160+ uint32_t csr_mimpid ; /* Implementation ID */
161161 uint32_t csr_mbadaddr ;
162162
163163 uint32_t csr_sstatus ; /* supervisor status register */
@@ -171,7 +171,7 @@ struct riscv_internal {
171171 uint32_t csr_stval ; /* supervisor trap value register */
172172 uint32_t csr_satp ; /* supervisor address translation and protection */
173173
174- uint32_t priv_mode ; /* U-mode or S-mode or M-mode */
174+ uint32_t priv_mode ; /* U-mode or S-mode or M-mode */
175175
176176 bool compressed ; /**< current instruction is compressed or not */
177177#if !RV32_HAS (JIT )
0 commit comments