Skip to content

Commit de247db

Browse files
author
Robert Morris
committed
menvcfg also
1 parent 4060b67 commit de247db

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/riscv.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -196,14 +196,16 @@ static inline uint64
196196
r_menvcfg()
197197
{
198198
uint64 x;
199-
asm volatile("csrr %0, menvcfg" : "=r" (x) );
199+
// asm volatile("csrr %0, menvcfg" : "=r" (x) );
200+
asm volatile("csrr %0, 0x30a" : "=r" (x) );
200201
return x;
201202
}
202203

203204
static inline void
204205
w_menvcfg(uint64 x)
205206
{
206-
asm volatile("csrw menvcfg, %0" : : "r" (x));
207+
// asm volatile("csrw menvcfg, %0" : : "r" (x));
208+
asm volatile("csrw 0x30a, %0" : : "r" (x));
207209
}
208210

209211
// Physical Memory Protection

0 commit comments

Comments
 (0)