|
|
@ -2,7 +2,7 @@ use arch::driver::{acpi::ACPI_Result, apic::start_ap};
|
|
|
|
use memory::{MemoryController, PhysicalAddress};
|
|
|
|
use memory::{MemoryController, PhysicalAddress};
|
|
|
|
|
|
|
|
|
|
|
|
extern {
|
|
|
|
extern {
|
|
|
|
fn entryother_start();
|
|
|
|
fn entryother_start(); // physical addr of entryother
|
|
|
|
fn entryother_end();
|
|
|
|
fn entryother_end();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -11,6 +11,7 @@ const ENTRYOTHER_ADDR: u32 = 0x7000;
|
|
|
|
pub fn start_other_cores(acpi: &ACPI_Result, mc: &mut MemoryController) {
|
|
|
|
pub fn start_other_cores(acpi: &ACPI_Result, mc: &mut MemoryController) {
|
|
|
|
mc.map_page_identity(ENTRYOTHER_ADDR as usize - 1);
|
|
|
|
mc.map_page_identity(ENTRYOTHER_ADDR as usize - 1);
|
|
|
|
mc.map_page_identity(ENTRYOTHER_ADDR as usize);
|
|
|
|
mc.map_page_identity(ENTRYOTHER_ADDR as usize);
|
|
|
|
|
|
|
|
mc.map_page_identity(entryother_start as usize);
|
|
|
|
mc.map_page_p2v(PhysicalAddress(0));
|
|
|
|
mc.map_page_p2v(PhysicalAddress(0));
|
|
|
|
copy_entryother();
|
|
|
|
copy_entryother();
|
|
|
|
let args = unsafe{ &mut *(ENTRYOTHER_ADDR as *mut EntryArgs).offset(-1) };
|
|
|
|
let args = unsafe{ &mut *(ENTRYOTHER_ADDR as *mut EntryArgs).offset(-1) };
|
|
|
@ -22,6 +23,7 @@ pub fn start_other_cores(acpi: &ACPI_Result, mc: &mut MemoryController) {
|
|
|
|
stack: 0x8000, // just enough stack to get us to entry64mp
|
|
|
|
stack: 0x8000, // just enough stack to get us to entry64mp
|
|
|
|
};
|
|
|
|
};
|
|
|
|
start_ap(apic_id, ENTRYOTHER_ADDR);
|
|
|
|
start_ap(apic_id, ENTRYOTHER_ADDR);
|
|
|
|
|
|
|
|
loop{}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|