Skip to content

Commit

Permalink
Revert "fix(x86_64): allocate IST from heap"
Browse files Browse the repository at this point in the history
This reverts commit c338f95.
  • Loading branch information
mkroening committed May 15, 2024
1 parent bc077d6 commit e9053a8
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/arch/x86_64/kernel/gdt.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use alloc::alloc::alloc;
use alloc::boxed::Box;
use core::alloc::Layout;
use core::sync::atomic::Ordering;

use x86_64::instructions::tables;
Expand Down Expand Up @@ -49,11 +47,9 @@ pub fn add_current_core() {
BasePageSize::SIZE as usize
};

let layout = Layout::from_size_align(size, BasePageSize::SIZE as usize).unwrap();
let ist = unsafe { alloc(layout) };
assert!(!ist.is_null());
let ist_start = unsafe { ist.add(size - TaskStacks::MARKER_SIZE) };
tss.interrupt_stack_table[i] = VirtAddr::from_ptr(ist_start);
let ist = crate::mm::allocate(size, true);
let ist_start = ist.as_u64() + size as u64 - TaskStacks::MARKER_SIZE as u64;
tss.interrupt_stack_table[i] = VirtAddr::new(ist_start);
}

CoreLocal::get().tss.set(tss);
Expand Down

0 comments on commit e9053a8

Please sign in to comment.