This commit is contained in:
Yifan Wu 2022-05-13 00:58:11 -07:00
parent 4ec99243da
commit 326b97a9fa

View File

@ -85,7 +85,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 {