kernel: riscv: really fix sharing logic

We're comparing numbers and not MMUFlags, so invalid values crept in.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2021-02-17 17:35:13 +08:00
parent b6a28a85fc
commit 6119c78bc7

View file

@ -584,7 +584,7 @@ pub fn virt_to_phys(virt: usize) -> Result<usize, xous_kernel::Error> {
}
// If the page is "Valid" but shared, issue a sharing violation
if l0_pt.entries[vpn0] & MMUFlags::S.bits() == 1 {
if l0_pt.entries[vpn0] & MMUFlags::S.bits() != 0 {
return Err(xous_kernel::Error::ShareViolation);
}