Align the double fault stack through a new wrapper type

This commit is contained in:
Philipp Oppermann
2020-02-19 10:27:26 +01:00
parent c211412ce2
commit e3e8a3e112

View File

@@ -10,7 +10,11 @@ lazy_static! {
let mut tss = TaskStateSegment::new();
tss.interrupt_stack_table[DOUBLE_FAULT_IST_INDEX as usize] = {
const STACK_SIZE: usize = 4096;
static mut STACK: [u8; STACK_SIZE] = [0; STACK_SIZE];
#[repr(align(16))]
struct Stack([u8; STACK_SIZE]);
static mut STACK: Stack = Stack([0; STACK_SIZE]);
let stack_start = VirtAddr::from_ptr(unsafe { &STACK });
let stack_end = stack_start + STACK_SIZE;