virtaddr -> usize high 256GB addrspace bug fix

This commit is contained in:
RunOS 2022-04-30 21:07:37 +08:00
parent a1a4520b23
commit ae6afe93cb

View file

@ -83,7 +83,11 @@ impl From<PhysPageNum> for usize {
}
impl From<VirtAddr> for usize {
fn from(v: VirtAddr) -> Self {
v.0
if v.0 >= (1 << (VA_WIDTH_SV39 - 1)) {
v.0 | (!((1 << VA_WIDTH_SV39) - 1))
} else {
v.0
}
}
}
impl From<VirtPageNum> for usize {