mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-26 11:23:37 +04:00
Fix #69.
This commit is contained in:
parent
e8871ec957
commit
fdeaca9bb0
@ -83,9 +83,13 @@ 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 {
|
||||||
v.0
|
v.0
|
||||||
|
Loading…
Reference in New Issue
Block a user