diff --git a/kernel/riscv.h b/kernel/riscv.h index d80e78e..f7aaa8a 100644 --- a/kernel/riscv.h +++ b/kernel/riscv.h @@ -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