mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
initialize APIC after the intialization of IDT & GDT
- fix problems with Qemu
This commit is contained in:
parent
69c7a2f9ab
commit
bd3113be0b
1 changed files with 7 additions and 6 deletions
|
@ -905,12 +905,7 @@ extern int set_idle_task(void);
|
|||
#if MAX_CORES > 1
|
||||
int smp_start(void)
|
||||
{
|
||||
x2apic_enable();
|
||||
|
||||
// reset APIC and set id
|
||||
lapic_reset();
|
||||
|
||||
LOG_DEBUG("Processor %d (local id %d) is entering its idle task\n", apic_cpu_id(), atomic_int32_read(¤t_boot_id));
|
||||
LOG_DEBUG("Try to initialize processor (local id %d)\n", atomic_int32_read(¤t_boot_id));
|
||||
|
||||
// use the same gdt like the boot processors
|
||||
gdt_flush();
|
||||
|
@ -921,6 +916,12 @@ int smp_start(void)
|
|||
// enable additional cpu features
|
||||
cpu_detection();
|
||||
|
||||
x2apic_enable();
|
||||
|
||||
// reset APIC
|
||||
lapic_reset();
|
||||
|
||||
LOG_DEBUG("Processor %d (local id %d) is entering its idle task\n", apic_cpu_id(), atomic_int32_read(¤t_boot_id));
|
||||
LOG_DEBUG("CR0 of core %u: 0x%x\n", atomic_int32_read(¤t_boot_id), read_cr0());
|
||||
online[atomic_int32_read(¤t_boot_id)] = 1;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue