/* * Print various information about the SMP system hardware and setup. */ void mp_announce(void) { int x; POSTCODE(MP_ANNOUNCE_POST); kprintf("DragonFly/MP: Multiprocessor motherboard\n"); kprintf(" cpu0 (BSP): apic id: %2d\n", CPUID_TO_APICID(0)); for (x = 1; x <= naps; ++x) kprintf(" cpu%d (AP): apic id: %2d\n", x, CPUID_TO_APICID(x)); if (!ioapic_enable) kprintf(" Warning: APIC I/O disabled\n"); }
void msi_map(int intr, uint64_t *addr, uint32_t *data, int cpuid) { int vector, lapic_id; vector = IDT_OFFSET + intr; lapic_id = CPUID_TO_APICID(cpuid); *addr = MSI_X86_ADDR(lapic_id); *data = MSI_X86_DATA(vector); }