Fix #69.
This commit is contained in:
parent
7173195e52
commit
85ea693a18
1 changed files with 5 additions and 1 deletions
|
@ -83,8 +83,12 @@ impl From<PhysPageNum> for usize {
|
||||||
}
|
}
|
||||||
impl From<VirtAddr> for usize {
|
impl From<VirtAddr> for usize {
|
||||||
fn from(v: VirtAddr) -> Self {
|
fn from(v: VirtAddr) -> Self {
|
||||||
|
if v.0 >= (1 << (VA_WIDTH_SV39 - 1)) {
|
||||||
|
v.0 | (!((1 << VA_WIDTH_SV39) - 1))
|
||||||
|
} else {
|
||||||
v.0
|
v.0
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
impl From<VirtPageNum> for usize {
|
impl From<VirtPageNum> for usize {
|
||||||
fn from(v: VirtPageNum) -> Self {
|
fn from(v: VirtPageNum) -> Self {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue