menvcfg also

This commit is contained in:
Robert Morris 2024-09-04 17:29:58 -04:00
parent 4060b671d8
commit de247db5e6

View file

@ -196,14 +196,16 @@ static inline uint64
r_menvcfg()
{
uint64 x;
asm volatile("csrr %0, menvcfg" : "=r" (x) );
// asm volatile("csrr %0, menvcfg" : "=r" (x) );
asm volatile("csrr %0, 0x30a" : "=r" (x) );
return x;
}
static inline void
w_menvcfg(uint64 x)
{
asm volatile("csrw menvcfg, %0" : : "r" (x));
// asm volatile("csrw menvcfg, %0" : : "r" (x));
asm volatile("csrw 0x30a, %0" : : "r" (x));
}
// Physical Memory Protection