Grant to allow passing data to scheme handler
This commit is contained in:
parent
2b915953c9
commit
941fc0b494
10 changed files with 205 additions and 19 deletions
|
@ -43,6 +43,10 @@ impl Context {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_page_table(&self) -> usize {
|
||||
self.cr3
|
||||
}
|
||||
|
||||
pub fn set_page_table(&mut self, address: usize) {
|
||||
self.cr3 = address;
|
||||
}
|
||||
|
|
|
@ -59,6 +59,9 @@ pub extern crate x86;
|
|||
/// Size of user stack
|
||||
pub const USER_STACK_SIZE: usize = 1024 * 1024; // 1 MB
|
||||
|
||||
/// Offset to user grants
|
||||
pub const USER_GRANT_OFFSET: usize = USER_STACK_OFFSET + PML4_SIZE;
|
||||
|
||||
/// Offset to user temporary image (used when cloning)
|
||||
pub const USER_TMP_OFFSET: usize = USER_STACK_OFFSET + PML4_SIZE;
|
||||
|
||||
|
@ -68,6 +71,9 @@ pub extern crate x86;
|
|||
/// Offset to user temporary stack (used when cloning)
|
||||
pub const USER_TMP_STACK_OFFSET: usize = USER_TMP_HEAP_OFFSET + PML4_SIZE;
|
||||
|
||||
/// Offset to user temporary page for grants
|
||||
pub const USER_TMP_GRANT_OFFSET: usize = USER_TMP_STACK_OFFSET + PML4_SIZE;
|
||||
|
||||
|
||||
/// Print to console
|
||||
#[macro_export]
|
||||
|
|
|
@ -328,6 +328,10 @@ impl InactivePageTable {
|
|||
InactivePageTable { p4_frame: frame }
|
||||
}
|
||||
|
||||
pub unsafe fn from_address(cr3: usize) -> InactivePageTable {
|
||||
InactivePageTable { p4_frame: Frame::containing_address(PhysicalAddress::new(cr3)) }
|
||||
}
|
||||
|
||||
pub unsafe fn address(&self) -> usize {
|
||||
self.p4_frame.start_address().get()
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ use externs::memset;
|
|||
use gdt;
|
||||
use idt;
|
||||
use interrupt;
|
||||
use memory::{self, Frame};
|
||||
use paging::{self, entry, Page, PhysicalAddress, VirtualAddress};
|
||||
use memory;
|
||||
use paging::{self, entry, Page, VirtualAddress};
|
||||
|
||||
/// Test of zero values in BSS.
|
||||
static BSS_TEST_ZERO: usize = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue