WIP: improve speed of Grant::map_inactive
Use recursive page table address to calculate p4 entry
This commit is contained in:
@@ -9,7 +9,7 @@ use memory::allocate_frames;
|
||||
use super::entry::{EntryFlags, Entry};
|
||||
use super::ENTRY_COUNT;
|
||||
|
||||
pub const P4: *mut Table<Level4> = 0xffff_ffff_ffff_f000 as *mut _;
|
||||
pub const P4: *mut Table<Level4> = (::RECURSIVE_PAGE_OFFSET | 0x7ffffff000) as *mut _;
|
||||
|
||||
pub trait TableLevel {}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ use alloc::collections::VecDeque;
|
||||
use core::intrinsics;
|
||||
use spin::Mutex;
|
||||
|
||||
use arch::paging::PAGE_SIZE;
|
||||
use ipi::{ipi, IpiKind, IpiTarget};
|
||||
use memory::Frame;
|
||||
use paging::{ActivePageTable, InactivePageTable, Page, PageIter, PhysicalAddress, VirtualAddress};
|
||||
@@ -67,7 +68,7 @@ impl Grant {
|
||||
pub fn map_inactive(from: VirtualAddress, to: VirtualAddress, size: usize, flags: EntryFlags, new_table: &mut InactivePageTable, temporary_page: &mut TemporaryPage) -> Grant {
|
||||
let mut active_table = unsafe { ActivePageTable::new() };
|
||||
|
||||
let mut frames = VecDeque::new();
|
||||
let mut frames = VecDeque::with_capacity(size/PAGE_SIZE);
|
||||
|
||||
let start_page = Page::containing_address(from);
|
||||
let end_page = Page::containing_address(VirtualAddress::new(from.get() + size - 1));
|
||||
|
||||
Reference in New Issue
Block a user