Skip to content

Commit

Permalink
Revert "fix(x86_64): allocate kernel stacks from heap"
Browse files Browse the repository at this point in the history
This reverts commit 589e8a9.
  • Loading branch information
mkroening committed May 15, 2024
1 parent e9053a8 commit 583129b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/arch/x86_64/kernel/apic.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use alloc::alloc::alloc;
use alloc::vec::Vec;
use core::alloc::Layout;
#[cfg(feature = "smp")]
use core::arch::x86_64::_mm_mfence;
#[cfg(feature = "acpi")]
Expand Down Expand Up @@ -29,7 +27,7 @@ use crate::arch::x86_64::mm::{paging, virtualmem, PhysAddr, VirtAddr};
use crate::arch::x86_64::swapgs;
use crate::config::*;
use crate::scheduler::CoreId;
use crate::{arch, env, scheduler};
use crate::{arch, env, mm, scheduler};

const MP_FLT_SIGNATURE: u32 = 0x5f504d5f;
const MP_CONFIG_SIGNATURE: u32 = 0x504d4350;
Expand Down Expand Up @@ -686,10 +684,8 @@ pub fn init_x2apic() {
/// Initialize the required _start variables for the next CPU to be booted.
pub fn init_next_processor_variables() {
// Allocate stack for the CPU and pass the addresses.
let layout = Layout::from_size_align(KERNEL_STACK_SIZE, BasePageSize::SIZE as usize).unwrap();
let stack = unsafe { alloc(layout) };
assert!(!stack.is_null());
CURRENT_STACK_ADDRESS.store(stack, Ordering::Relaxed);
let stack = mm::allocate(KERNEL_STACK_SIZE, true);
CURRENT_STACK_ADDRESS.store(stack.as_mut_ptr(), Ordering::Relaxed);
}

/// Boot all Application Processors
Expand Down

0 comments on commit 583129b

Please sign in to comment.