Skip to content

Commit

Permalink
fix(x86_64/smp): remove boot_info parameter
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <[email protected]>
  • Loading branch information
mkroening committed Oct 20, 2024
1 parent 8f6b6b2 commit bff31ac
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 14 deletions.
10 changes: 2 additions & 8 deletions src/arch/x86_64/kernel/apic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ const SMP_BOOT_CODE_OFFSET_ENTRY: usize = 0x08;
#[cfg(feature = "smp")]
const SMP_BOOT_CODE_OFFSET_CPU_ID: usize = SMP_BOOT_CODE_OFFSET_ENTRY + 0x08;
#[cfg(feature = "smp")]
const SMP_BOOT_CODE_OFFSET_BOOTINFO: usize = SMP_BOOT_CODE_OFFSET_CPU_ID + 0x04;
#[cfg(feature = "smp")]
const SMP_BOOT_CODE_OFFSET_PML4: usize = SMP_BOOT_CODE_OFFSET_BOOTINFO + 0x08;
const SMP_BOOT_CODE_OFFSET_PML4: usize = SMP_BOOT_CODE_OFFSET_CPU_ID + 0x04;

const X2APIC_ENABLE: u64 = 1 << 10;

Expand Down Expand Up @@ -699,7 +697,7 @@ pub fn init_next_processor_variables() {
pub fn boot_application_processors() {
use core::hint;

use super::{raw_boot_info, start};
use super::start;

let smp_boot_code = include_bytes!(concat!(core::env!("OUT_DIR"), "/boot.bin"));

Expand Down Expand Up @@ -744,10 +742,6 @@ pub fn boot_application_processors() {
(SMP_BOOT_CODE_ADDRESS + SMP_BOOT_CODE_OFFSET_ENTRY).as_mut_ptr(),
start::_start as usize,
);
ptr::write_unaligned(
(SMP_BOOT_CODE_ADDRESS + SMP_BOOT_CODE_OFFSET_BOOTINFO).as_mut_ptr(),
ptr::from_ref(raw_boot_info()).addr() as u64,
);
}

// Now wake up each application processor.
Expand Down
1 change: 0 additions & 1 deletion src/arch/x86_64/kernel/boot.s
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ _start:
.align 8
entry_point: .8byte 0xDEADC0DE
cpu_id: .4byte 0xC0DECAFE
boot_info: .8byte 0xBEEFBEEF
pml4: .4byte 0xDEADBEEF
pad: .4byte 0

Expand Down
5 changes: 0 additions & 5 deletions src/arch/x86_64/kernel/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ pub fn boot_info() -> &'static BootInfo {
unsafe { BOOT_INFO.as_ref().unwrap() }
}

#[cfg(feature = "smp")]
pub fn raw_boot_info() -> &'static RawBootInfo {
unsafe { RAW_BOOT_INFO.unwrap() }
}

/// Serial port to print kernel messages
pub(crate) static COM1: InterruptSpinMutex<Option<SerialPort>> = InterruptSpinMutex::new(None);

Expand Down

0 comments on commit bff31ac

Please sign in to comment.