Thread local TSS

This commit is contained in:
Jeremy Soller 2016-08-22 14:47:33 -06:00
parent 5b9c821ff5
commit 3eca1e3451
2 changed files with 55 additions and 13 deletions

View file

@ -134,6 +134,11 @@ pub unsafe extern fn kstart() -> ! {
/// Entry to rust for an AP
pub unsafe extern fn kstart_ap(stack_start: usize, stack_end: usize) -> ! {
{
extern {
/// The end of the tbss.
static mut __tbss_end: u8;
}
assert_eq!(BSS_TEST_ZERO, 0);
assert_eq!(DATA_TEST_NONZERO, 0xFFFFFFFFFFFFFFFF);
@ -141,7 +146,7 @@ pub unsafe extern fn kstart_ap(stack_start: usize, stack_end: usize) -> ! {
let mut active_table = paging::init(stack_start, stack_end);
// Set up GDT for AP
gdt::init_ap();
gdt::init_ap((&__tbss_end as *const u8 as *const usize).offset(-1) as usize);
// Set up IDT for AP
idt::init();