mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
The x86_64 crate requires no unsafe for tlb flushing
This commit is contained in:
@@ -855,14 +855,14 @@ x86_64 = "0.1.2"
|
||||
|
||||
```rust
|
||||
...
|
||||
p1[page.p1_index()].set_unused();
|
||||
unsafe {
|
||||
use x86_64::instructions::tlb;
|
||||
use x86_64::VirtualAddress;
|
||||
tlb::flush(VirtualAddress(page.start_address()));
|
||||
}
|
||||
// TODO free p(1,2,3) table if empty
|
||||
//allocator.deallocate_frame(frame);
|
||||
p1[page.p1_index()].set_unused();
|
||||
|
||||
use x86_64::instructions::tlb;
|
||||
use x86_64::VirtualAddress;
|
||||
tlb::flush(VirtualAddress(page.start_address()));
|
||||
|
||||
// TODO free p(1,2,3) table if empty
|
||||
//allocator.deallocate_frame(frame);
|
||||
}
|
||||
```
|
||||
Now the desired page fault occurs even when we access the page before.
|
||||
|
||||
Reference in New Issue
Block a user