extern struct region_descriptor r_gdt, r_idt;
int mp_naps; /* # of Applications processors */
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
static int mp_nbusses; /* # of busses */
int mp_napics; /* # of IO APICs */
-#endif
-#ifdef APIC_IO
vm_offset_t io_apic_address[NAPICID]; /* NAPICID is more than enough */
u_int32_t *io_apic_versions;
#endif
extern u_long ebda_addr;
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
struct apic_intmapinfo int_to_apicintpin[APIC_INTMAPSIZE];
#endif
* We oversize these to simplify boot-time config.
*/
int cpu_num_to_apic_id[NAPICID];
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
int io_num_to_apic_id[NAPICID];
#endif
int apic_id_to_logical[NAPICID];
static int mptable_check(vm_paddr_t);
static int mptable_search_sig(u_int32_t target, int count);
static int mptable_hyperthread_fixup(u_int, int);
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
static void mptable_pass1(struct mptable_pos *);
static void mptable_pass2(struct mptable_pos *);
static void mptable_default(int type);
static void mptable_lapic_enumerate(struct lapic_enumerator *);
static void mptable_lapic_default(void);
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
static void setup_apic_irq_mapping(void);
static int apic_int_is_bus_type(int intr, int bus_type);
#endif
kprintf(", version: 0x%08x\n", cpu_apic_versions[x]);
}
-#if defined(APIC_IO)
+if (apic_io_enable) {
for (x = 0; x < mp_napics; ++x) {
kprintf(" io%d (APIC): apic id: %2d", x, IO_TO_ID(x));
kprintf(", version: 0x%08x", io_apic_versions[x]);
kprintf(", at 0x%08lx\n", io_apic_address[x]);
}
-#else
+} else {
kprintf(" Warning: APIC I/O disabled\n");
-#endif /* APIC_IO */
+}
}
/*
static void
mp_enable(u_int boot_addr)
{
-#if defined(APIC_IO)
int apic;
u_int ux;
-#endif /* APIC_IO */
vm_paddr_t mpfps_paddr;
struct mptable_pos mpt;
mptable_imcr(&mpt);
mptable_unmap(&mpt);
}
-#if defined(APIC_IO)
+if (apic_io_enable) {
if (!mpfps_paddr)
- panic("no MP table, disable APIC_IO!\n");
+ panic("no MP table, disable APIC_IO! (set hw.apic_io_enable=0)\n");
mptable_map(&mpt, mpfps_paddr);
if (io_apic_setup(apic) < 0)
panic("IO APIC setup failure");
-#endif /* APIC_IO */
+}
/*
* These are required for SMP operation
char name[7];
} bus_type_name;
-#ifdef APIC_IO
-
static bus_type_name bus_type_table[] =
{
{CBUS, "CBUS"},
static io_int *io_apic_ints;
static int nintrs;
-#endif
-
static int processor_entry (const struct PROCENTRY *entry, int cpu);
-#ifdef APIC_IO
static int bus_entry (const struct BUSENTRY *entry, int bus);
static int io_apic_entry (const struct IOAPICENTRY *entry, int apic);
static int int_entry (const struct INTENTRY *entry, int intr);
static int lookup_bus_type (char *name);
-#endif
-
-#ifdef APIC_IO
static int
mptable_ioapic_pass1_callback(void *xarg, const void *pos, int type)
panic("mptable_iterate_entries(ioapic_pass2) failed\n");
}
-#endif /* APIC_IO */
-
/*
* Check if we should perform a hyperthreading "fix-up" to
* enumerate any logical CPU's that aren't already listed
}
}
-#ifdef APIC_IO
-
void
assign_apic_irq(int apic, int intpin, int irq)
{
/* PCI interrupt assignment is deferred */
}
-#endif
-
void
mp_set_cpuids(int cpu_id, int apic_id)
{
return 0;
}
-#ifdef APIC_IO
-
static int
bus_entry(const struct BUSENTRY *entry, int bus)
{
#undef INTAPIC
#undef INTTYPE
-#endif
-
/*
* Reprogram the MB chipset to NOT redirect an ISA INTerrupt.
*
}
-#ifdef APIC_IO
-
/*
* given a bus ID, return:
* the bus type if found
io_apic_ints[0].int_type = 3; /* vectored 8259 */
}
-#endif /* APIC_IO */
-
/*
* Map a physical memory address representing I/O into KVA. The I/O
* block is assumed not to cross a page boundary.