From f8309dc5802dfa57562a95ea989c84edb1d4f1e2 Mon Sep 17 00:00:00 2001 From: Sean Cross Date: Wed, 24 Mar 2021 22:07:06 +0800 Subject: [PATCH] kernel: riscv: add klog messages to mem.rs These are useful in tracking down certain violations. Signed-off-by: Sean Cross --- kernel/src/arch/riscv/mem.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/src/arch/riscv/mem.rs b/kernel/src/arch/riscv/mem.rs index fb6007d63..f73e4ce6e 100644 --- a/kernel/src/arch/riscv/mem.rs +++ b/kernel/src/arch/riscv/mem.rs @@ -483,13 +483,15 @@ pub fn lend_page_inner( // If we try to share a page that's not ours, that's just wrong. if *entry & MMUFlags::VALID.bits() == 0 { - return Err(xous_kernel::Error::ShareViolation); + // klog!("Not valid"); + Err(xous_kernel::Error::ShareViolation)?; } // If we try to share a page that's already shared, that's a sharing // violation. if *entry & MMUFlags::S.bits() != 0 { - return Err(xous_kernel::Error::ShareViolation); + // klog!("Already shared"); + Err(xous_kernel::Error::ShareViolation)?; } // Strip the `VALID` flag, and set the `SHARED` flag.