mirror of
https://github.com/hermitcore/libhermit.git
synced 2025-03-09 00:00:03 +01:00
announce that a cpu is online in the apic code
=> move code from main.c to apic.c, because the time of announcement depends on the boot process. (The multi- and the single-kernel version of HermitCore use a different boot process.)
This commit is contained in:
parent
cbb3bb0905
commit
606580c05d
2 changed files with 7 additions and 5 deletions
|
@ -560,9 +560,13 @@ int apic_calibration(void)
|
|||
initialized = 1;
|
||||
irq_nested_enable(flags);
|
||||
|
||||
atomic_int32_inc(&cpu_online);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
atomic_int32_inc(&cpu_online);
|
||||
|
||||
old = get_clock_tick();
|
||||
|
||||
/* wait for the next time slice */
|
||||
|
@ -721,7 +725,7 @@ found_mp:
|
|||
apic_io_entry_t* io_entry = (apic_io_entry_t*) addr;
|
||||
ioapic = (ioapic_t*) ((size_t) io_entry->addr);
|
||||
kprintf("Found IOAPIC at 0x%x\n", ioapic);
|
||||
if (is_single_kernel() && ioapic) {
|
||||
if (is_single_kernel() && ioapic) {
|
||||
page_map(IOAPIC_ADDR, (size_t)ioapic & PAGE_MASK, 1, flags);
|
||||
vma_add(IOAPIC_ADDR, IOAPIC_ADDR + PAGE_SIZE, VMA_READ|VMA_WRITE);
|
||||
ioapic = (ioapic_t*) IOAPIC_ADDR;
|
||||
|
@ -842,6 +846,8 @@ int smp_start(void)
|
|||
|
||||
irq_enable();
|
||||
|
||||
atomic_int32_inc(&cpu_online);
|
||||
|
||||
return smp_main();
|
||||
}
|
||||
|
||||
|
|
|
@ -130,7 +130,6 @@ static int hermit_init(void)
|
|||
#ifndef CONFIG_VGA
|
||||
uart_init();
|
||||
#endif
|
||||
atomic_int32_inc(&cpu_online);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -267,8 +266,6 @@ int smp_main(void)
|
|||
|
||||
print_status();
|
||||
|
||||
atomic_int32_inc(&cpu_online);
|
||||
|
||||
/* wait for the other cpus */
|
||||
while(atomic_int32_read(&cpu_online) < atomic_int32_read(&possible_cpus))
|
||||
PAUSE;
|
||||
|
@ -546,7 +543,6 @@ int hermit_main(void)
|
|||
hermit_init();
|
||||
system_calibration(); // enables also interrupts
|
||||
|
||||
|
||||
kprintf("This is Hermit %s, build date %u\n", VERSION, &__DATE__);
|
||||
kprintf("Isle %d of %d possible isles\n", isle, possible_isles);
|
||||
kprintf("Kernel starts at %p and ends at %p\n", &kernel_start, &kernel_end);
|
||||
|
|
Loading…
Add table
Reference in a new issue