Example #1
0
static int
madt_lapic_enumerate(struct lapic_enumerator *e)
{
	vm_paddr_t lapic_addr;
	int bsp_apic_id;

	KKASSERT(madt_phyaddr != 0);

	lapic_addr = madt_lapic_pass1();
	if (lapic_addr == 0)
		panic("madt_lapic_enumerate: no local apic");

	lapic_map(lapic_addr);

	bsp_apic_id = APIC_ID(lapic->id);
	if (bsp_apic_id == APICID_MAX) {
		/*
		 * XXX
		 * Some old brain dead BIOS will set BSP's LAPIC apic id
		 * to 255, though all LAPIC entries in MADT are valid.
		 */
		kprintf("%s invalid BSP LAPIC apic id %d\n", __func__,
		    bsp_apic_id);
		return EINVAL;
	}

	if (madt_lapic_pass2(bsp_apic_id))
		panic("madt_lapic_enumerate: madt_lapic_pass2 failed");

	return 0;
}
Example #2
0
static void
madt_lapic_enumerate(struct lapic_enumerator *e)
{
	vm_paddr_t lapic_addr;
	int bsp_apic_id;

	KKASSERT(madt_phyaddr != 0);

	lapic_addr = madt_lapic_pass1();
	if (lapic_addr == 0)
		panic("madt_lapic_enumerate: no local apic\n");

	lapic_map(lapic_addr);

	bsp_apic_id = APIC_ID(lapic->id);
	if (madt_lapic_pass2(bsp_apic_id))
		panic("madt_lapic_enumerate: madt_lapic_pass2 failed\n");
}