menvcfg -> 0x30a

This commit is contained in:
Robert Morris 2024-09-04 17:31:41 -04:00
parent 56aacf5261
commit 53c5c818d3

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