Allocate AP stack linearly
This commit is contained in:
parent
96ffbe38e8
commit
4331195693
|
@ -5,7 +5,7 @@ use core::intrinsics::{atomic_load, atomic_store};
|
||||||
use core::sync::atomic::Ordering;
|
use core::sync::atomic::Ordering;
|
||||||
|
|
||||||
use interrupt;
|
use interrupt;
|
||||||
use memory::{allocate_frame, Frame};
|
use memory::{allocate_frames, Frame};
|
||||||
use paging::{entry, ActivePageTable, Page, PhysicalAddress, VirtualAddress};
|
use paging::{entry, ActivePageTable, Page, PhysicalAddress, VirtualAddress};
|
||||||
use start::{kstart_ap, AP_READY};
|
use start::{kstart_ap, AP_READY};
|
||||||
|
|
||||||
|
@ -59,11 +59,8 @@ pub fn init_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) {
|
||||||
if ap_local_apic.flags & 1 == 1 {
|
if ap_local_apic.flags & 1 == 1 {
|
||||||
// Allocate a stack
|
// Allocate a stack
|
||||||
// TODO: Allocate contiguous
|
// TODO: Allocate contiguous
|
||||||
let stack_start = allocate_frame().expect("no more frames in acpi stack_start").start_address().get() + ::KERNEL_OFFSET;
|
let stack_start = allocate_frames(64).expect("no more frames in acpi stack_start").start_address().get() + ::KERNEL_OFFSET;
|
||||||
for _i in 0..62 {
|
let stack_end = stack_start + 64 * 4096;
|
||||||
allocate_frame().expect("no more frames in acpi stack");
|
|
||||||
}
|
|
||||||
let stack_end = allocate_frame().expect("no more frames in acpi stack_end").start_address().get() + 4096 + ::KERNEL_OFFSET;
|
|
||||||
|
|
||||||
let ap_ready = TRAMPOLINE as *mut u64;
|
let ap_ready = TRAMPOLINE as *mut u64;
|
||||||
let ap_cpu_id = unsafe { ap_ready.offset(1) };
|
let ap_cpu_id = unsafe { ap_ready.offset(1) };
|
||||||
|
|
Loading…
Reference in a new issue