Switch to x86_64 crate and use its idt module

This commit is contained in:
Philipp Oppermann
2017-03-15 14:13:35 +01:00
parent 7ef97adb9c
commit 02eaeb7af1
7 changed files with 53 additions and 261 deletions

View File

@@ -105,6 +105,9 @@ impl Mapper {
pub fn unmap<A>(&mut self, page: Page, allocator: &mut A)
where A: FrameAllocator
{
use x86_64::VirtualAddress;
use x86_64::instructions::tlb;
assert!(self.translate(page.start_address()).is_some());
let p1 = self.p4_mut()
@@ -114,7 +117,7 @@ impl Mapper {
.expect("mapping code does not support huge pages");
let frame = p1[page.p1_index()].pointed_frame().unwrap();
p1[page.p1_index()].set_unused();
unsafe { ::x86::shared::tlb::flush(page.start_address()) };
tlb::flush(VirtualAddress(page.start_address()));
// TODO free p(1,2,3) table if empty
// allocator.deallocate_frame(frame);
}