The x86_64 crate requires no unsafe for tlb flushing

This commit is contained in:
Philipp Oppermann
2017-04-13 19:43:38 +02:00
parent 9f0995c4b7
commit 493dede919

View File

@@ -855,14 +855,14 @@ x86_64 = "0.1.2"
```rust ```rust
... ...
p1[page.p1_index()].set_unused(); p1[page.p1_index()].set_unused();
unsafe {
use x86_64::instructions::tlb; use x86_64::instructions::tlb;
use x86_64::VirtualAddress; use x86_64::VirtualAddress;
tlb::flush(VirtualAddress(page.start_address())); tlb::flush(VirtualAddress(page.start_address()));
}
// TODO free p(1,2,3) table if empty // TODO free p(1,2,3) table if empty
//allocator.deallocate_frame(frame); //allocator.deallocate_frame(frame);
} }
``` ```
Now the desired page fault occurs even when we access the page before. Now the desired page fault occurs even when we access the page before.