From e9053a8f235db67dd425906da9b22cba008c1039 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= Date: Tue, 14 May 2024 16:09:37 +0200 Subject: [PATCH] Revert "fix(x86_64): allocate IST from heap" This reverts commit c338f9589d472f816a6b3b4257bcf332881e119e. --- src/arch/x86_64/kernel/gdt.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/arch/x86_64/kernel/gdt.rs b/src/arch/x86_64/kernel/gdt.rs index a76d882e7d..3d1c23b292 100644 --- a/src/arch/x86_64/kernel/gdt.rs +++ b/src/arch/x86_64/kernel/gdt.rs @@ -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; @@ -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);