From 53c5c818d32157ffd8875cb9f32c8610e8cd20a0 Mon Sep 17 00:00:00 2001 From: Robert Morris Date: Wed, 4 Sep 2024 17:31:41 -0400 Subject: [PATCH] menvcfg -> 0x30a --- kernel/riscv.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/riscv.h b/kernel/riscv.h index 6dc2b08..6cfff1e 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