Update x86 crate to version 0.8.0 (#266)

This commit is contained in:
Philipp Oppermann
2016-12-21 14:59:57 +01:00
committed by GitHub
parent a7a9aabce7
commit 02697891e2
10 changed files with 41 additions and 41 deletions

View File

@@ -110,11 +110,11 @@ impl ActivePageTable {
f: F)
where F: FnOnce(&mut Mapper)
{
use x86::{controlregs, tlb};
use x86::shared::{control_regs, tlb};
let flush_tlb = || unsafe { tlb::flush_all() };
{
let backup = Frame::containing_address(unsafe { controlregs::cr3() } as usize);
let backup = Frame::containing_address(unsafe { control_regs::cr3() } as usize);
// map temporary_page to current p4 table
let p4_table = temporary_page.map_table_frame(backup.clone(), self);
@@ -135,13 +135,13 @@ impl ActivePageTable {
}
pub fn switch(&mut self, new_table: InactivePageTable) -> InactivePageTable {
use x86::controlregs;
use x86::shared::control_regs;
let old_table = InactivePageTable {
p4_frame: Frame::containing_address(unsafe { controlregs::cr3() } as usize),
p4_frame: Frame::containing_address(unsafe { control_regs::cr3() } as usize),
};
unsafe {
controlregs::cr3_write(new_table.p4_frame.start_address() as u64);
control_regs::cr3_write(new_table.p4_frame.start_address());
}
old_table
}