mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-24 10:26:25 +04:00
Fix #69.
This commit is contained in:
parent
8c92e66f6a
commit
3fd8b8e94d
@ -80,7 +80,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 {
|
||||
|
Loading…
Reference in New Issue
Block a user