From a4ca1dca8e4ad1fdbce40c514e02a8412fccae11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Kr=C3=B6ning?= <mkroening@posteo.net> Date: Wed, 27 Jul 2022 00:28:41 +0200 Subject: [PATCH] APIC: Don't redeclare _start --- src/arch/x86_64/kernel/apic.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/arch/x86_64/kernel/apic.rs b/src/arch/x86_64/kernel/apic.rs index fc43bea0d..5908a8551 100644 --- a/src/arch/x86_64/kernel/apic.rs +++ b/src/arch/x86_64/kernel/apic.rs @@ -765,10 +765,6 @@ pub fn init_next_processor_variables(core_id: CoreId) { CURRENT_PERCORE_ADDRESS.store(current_percore as *mut _ as u64, Ordering::Release); } -extern "C" { - fn _start(); -} - /// Boot all Application Processors /// This algorithm is derived from Intel MultiProcessor Specification 1.4, B.4, but testing has shown /// that a second STARTUP IPI and setting the BIOS Reset Vector are no longer necessary. @@ -777,6 +773,8 @@ extern "C" { pub fn boot_application_processors() { use include_transformed::include_nasm_bin; + use super::start; + let smp_boot_code = include_nasm_bin!("boot.asm"); // We shouldn't have any problems fitting the boot code into a single page, but let's better be sure. @@ -813,10 +811,11 @@ pub fn boot_application_processors() { cr3().try_into().unwrap(); // Set entry point debug!( - "Set entry point for application processor to {:#x}", - _start as usize + "Set entry point for application processor to {:p}", + start::_start as *const () ); - *((SMP_BOOT_CODE_ADDRESS + SMP_BOOT_CODE_OFFSET_ENTRY).as_mut_ptr()) = _start as usize; + *((SMP_BOOT_CODE_ADDRESS + SMP_BOOT_CODE_OFFSET_ENTRY).as_mut_ptr()) = + start::_start as usize; *((SMP_BOOT_CODE_ADDRESS + SMP_BOOT_CODE_OFFSET_BOOTINFO).as_mut_ptr()) = raw_boot_info() as *const _ as u64; } -- GitLab