mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-22 23:43:24 +00:00
bugfix: 修复多核启动时,自旋锁持有计数错误的问题
This commit is contained in:
@ -55,6 +55,7 @@ void smp_init()
|
||||
continue;
|
||||
|
||||
spin_lock(&multi_core_starting_lock);
|
||||
preempt_enable(); // 由于ap处理器的pcb与bsp的不同,因此ap处理器放锁时,bsp的自旋锁持有计数不会发生改变,需要手动恢复preempt count
|
||||
current_starting_cpu = proc_local_apic_structs[i]->local_apic_id;
|
||||
|
||||
kdebug("[core %d] acpi processor UID=%d, APIC ID=%d, flags=%#010lx", i, proc_local_apic_structs[i]->ACPI_Processor_UID, proc_local_apic_structs[i]->local_apic_id, proc_local_apic_structs[i]->flags);
|
||||
@ -95,7 +96,7 @@ void smp_init()
|
||||
{
|
||||
*(ul *)(phys_2_virt(global_CR3) + i) = 0UL;
|
||||
}
|
||||
|
||||
kdebug("init proc's preempt_count=%ld", current_pcb->preempt_count);
|
||||
kinfo("Successfully cleaned page table remapping!\n");
|
||||
}
|
||||
|
||||
@ -147,10 +148,11 @@ void smp_ap_start()
|
||||
initial_proc[proc_current_cpu_id] = current_pcb;
|
||||
|
||||
load_TR(10 + current_starting_cpu * 2);
|
||||
current_pcb->preempt_count = 0;
|
||||
|
||||
// kdebug("IDT_addr = %#018lx", phys_2_virt(IDT_Table));
|
||||
spin_unlock(&multi_core_starting_lock);
|
||||
current_pcb->preempt_count = 0;
|
||||
preempt_disable();// 由于ap处理器的pcb与bsp的不同,因此ap处理器放锁时,需要手动恢复preempt count
|
||||
sti();
|
||||
|
||||
while (1)
|
||||
|
Reference in New Issue
Block a user