Skip to content

Commit 96c7ae5

Browse files
committed
fix: rollback to x86 crate
1 parent e3294fb commit 96c7ae5

File tree

3 files changed

+38
-10
lines changed

3 files changed

+38
-10
lines changed

Cargo.lock

Lines changed: 29 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

page_table_multiarch/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rust-version.workspace = true
1616
default = []
1717
copy-from = ["dep:bitmaps"]
1818

19-
all = ["page_table_entry/all", "dep:riscv", "dep:x86_64"]
19+
all = ["page_table_entry/all", "dep:riscv", "dep:x86"]
2020

2121
[dependencies]
2222
log = "0.4"
@@ -26,10 +26,10 @@ bitmaps = { version = "3.2", default-features = false, optional = true }
2626

2727
# Target-specific dependencies
2828
riscv = { version = "0.14", default-features = false, optional = true }
29-
x86_64 = { version = "0.15", optional = true }
29+
x86 = { version = "0.52", optional = true }
3030

3131
[target.'cfg(target_arch = "x86_64")'.dependencies]
32-
x86_64 = "0.15"
32+
x86 = "0.52"
3333

3434
[target.'cfg(any(target_arch = "riscv32", target_arch = "riscv64"))'.dependencies]
3535
riscv = { version = "0.14", default-features = false }

page_table_multiarch/src/arch/x86_64.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ impl PagingMetaData for X64PagingMetaData {
1414

1515
#[inline]
1616
fn flush_tlb(vaddr: Option<memory_addr::VirtAddr>) {
17-
if let Some(vaddr) = vaddr {
18-
x86_64::instructions::tlb::flush(x86_64::VirtAddr::new(vaddr.as_usize() as u64));
19-
} else {
20-
x86_64::instructions::tlb::flush_all();
17+
unsafe {
18+
if let Some(vaddr) = vaddr {
19+
x86::tlb::flush(vaddr.as_usize());
20+
} else {
21+
x86::tlb::flush_all();
22+
}
2123
}
2224
}
2325
}

0 commit comments

Comments
 (0)