#ifdef APIC_IO
int mp_napics; /* # of IO APICs */
#endif
-int boot_cpu_id; /* designated BSP */
vm_offset_t cpu_apic_address;
#ifdef APIC_IO
vm_offset_t io_apic_address[NAPICID]; /* NAPICID is more than enough */
* 2nd pass on motherboard's Intel MP specification table.
*
* sets:
- * boot_cpu_id
* logical_cpus_mask
* ID_TO_IO(N), phy APIC ID to log CPU/IO table
* CPU_TO_ID(N), logical CPU to APIC ID table
}
#endif
- /* setup the cpu/apic mapping arrays */
- boot_cpu_id = -1;
-
/* record whether PIC or virtual-wire mode */
machintr_setvar_simple(MACHINTR_VAR_IMCR_PRESENT, fps->mpfb2 & 0x80);
position = (uint8_t *)position + basetable_entry_types[type].length;
}
- if (boot_cpu_id == -1)
+ if (CPU_TO_ID(0) < 0)
panic("NO BSP found!");
/* report fact that its NOT a default configuration */
static int
processor_entry(proc_entry_ptr entry, int cpu)
{
+ KKASSERT(cpu > 0);
+
/* check for usability */
if (!(entry->cpu_flags & PROCENTRY_FLAG_EN))
return 0;
panic("CPU APIC ID out of range (0..%d)", NAPICID - 1);
/* check for BSP flag */
if (entry->cpu_flags & PROCENTRY_FLAG_BP) {
- boot_cpu_id = entry->apic_id;
CPU_TO_ID(0) = entry->apic_id;
ID_TO_CPU(entry->apic_id) = 0;
return 0; /* its already been counted */
static void
default_mp_table(int type)
{
- int ap_cpu_id;
+ int ap_cpu_id, boot_cpu_id;
#if defined(APIC_IO)
int io_apic_id;
int pin;