static void ioapic_initmap(void);
static void ioapic_intr_config(int, enum intr_trigger, enum intr_polarity);
-static int ioapic_imcr_present;
-
struct machintr_abi MachIntrABI_IOAPIC = {
MACHINTR_IOAPIC,
.intrdis = IOAPIC_INTRDIS,
static int
ioapic_setvar(int varid, const void *buf)
{
- int error = 0;
-
- switch (varid) {
- case MACHINTR_VAR_IMCR_PRESENT:
- ioapic_imcr_present = *(const int *)buf;
- break;
-
- default:
- error = ENOENT;
- break;
- }
- return error;
+ return ENOENT;
}
static int
ioapic_getvar(int varid, void *buf)
{
- int error = 0;
-
- switch (varid) {
- case MACHINTR_VAR_IMCR_PRESENT:
- *(int *)buf = ioapic_imcr_present;
- break;
-
- default:
- error = ENOENT;
- break;
- }
- return error;
+ return ENOENT;
}
/*
* from the BSP. The 8259 may still be connected to LINT0 on
* the BSP's LAPIC.
*/
- if (ioapic_imcr_present) {
+ if (imcr_present) {
outb(0x22, 0x70); /* select IMCR */
outb(0x23, 0x01); /* disconnect 8259 */
}
#endif
static int mptable_map(struct mptable_pos *);
static void mptable_unmap(struct mptable_pos *);
-static void mptable_imcr(struct mptable_pos *);
static void mptable_bus_info_alloc(const mpcth_t,
struct mptable_bus_info *);
static void mptable_bus_info_free(struct mptable_bus_info *);
cpumask_t smp_active_mask = 1; /* which cpus are ready for IPIs etc? */
SYSCTL_INT(_machdep, OID_AUTO, smp_active, CTLFLAG_RD, &smp_active_mask, 0, "");
+int imcr_present;
+
static vm_paddr_t mptable_fps_phyaddr;
static int mptable_use_default;
static TAILQ_HEAD(mptable_pci_int_list, mptable_pci_int) mptable_pci_int_list =
kprintf("MPTABLE: use default configuration\n");
mptable_use_default = 1;
}
+ if (mpt.mp_fps->mpfb2 & 0x80)
+ imcr_present = 1;
mptable_unmap(&mpt);
}
if (apic_io_enable)
ioapic_config();
- if (mptable_fps_phyaddr) {
- mptable_map(&mpt);
- mptable_imcr(&mpt);
- mptable_unmap(&mpt);
- }
if (apic_io_enable && ioapic_use_old) {
if (!mptable_fps_phyaddr)
}
static void
-mptable_imcr(struct mptable_pos *mpt)
-{
- /* record whether PIC or virtual-wire mode */
- machintr_setvar_simple(MACHINTR_VAR_IMCR_PRESENT,
- mpt->mp_fps->mpfb2 & 0x80);
-}
-
-static void
mptable_lapic_default(void)
{
int ap_apicid, bsp_apicid;
.intr_config = icu_intr_config
};
-static int icu_imcr_present;
-
/*
* WARNING! SMP builds can use the ICU now so this code must be MP safe.
*/
static int
icu_setvar(int varid, const void *buf)
{
- int error = 0;
-
- switch (varid) {
- case MACHINTR_VAR_IMCR_PRESENT:
- icu_imcr_present = *(const int *)buf;
- break;
-
- default:
- error = ENOENT;
- break;
- }
- return error;
+ return ENOENT;
}
static int
icu_getvar(int varid, void *buf)
{
- int error = 0;
-
- switch (varid) {
- case MACHINTR_VAR_IMCR_PRESENT:
- *(int *)buf = icu_imcr_present;
- break;
-
- default:
- error = ENOENT;
- break;
- }
- return error;
+ return ENOENT;
}
/*
* MachIntrABI switching will happen in
* MachIntrABI_IOAPIC.finalize()
*/
- MachIntrABI_IOAPIC.setvar(MACHINTR_VAR_IMCR_PRESENT,
- &icu_imcr_present);
MachIntrABI_IOAPIC.finalize();
return;
}
* wire mode so we can use other interrupt sources within the LAPIC
* in addition to the 8259.
*/
- if (icu_imcr_present) {
+ if (imcr_present) {
u_long ef;
crit_enter();
void ioapic_write (volatile void *, int, u_int);
/* global data in mp_machdep.c */
+extern int imcr_present;
extern int mp_naps;
extern int mp_napics;
extern vm_offset_t io_apic_address[];
static void ioapic_initmap(void);
static void ioapic_intr_config(int, enum intr_trigger, enum intr_polarity);
-static int ioapic_imcr_present;
-
struct machintr_abi MachIntrABI_IOAPIC = {
MACHINTR_IOAPIC,
.intrdis = IOAPIC_INTRDIS,
static int
ioapic_setvar(int varid, const void *buf)
{
- int error = 0;
-
- switch(varid) {
- case MACHINTR_VAR_IMCR_PRESENT:
- ioapic_imcr_present = *(const int *)buf;
- break;
-
- default:
- error = ENOENT;
- break;
- }
- return error;
+ return ENOENT;
}
static int
ioapic_getvar(int varid, void *buf)
{
- int error = 0;
-
- switch(varid) {
- case MACHINTR_VAR_IMCR_PRESENT:
- *(int *)buf = ioapic_imcr_present;
- break;
-
- default:
- error = ENOENT;
- break;
- }
- return error;
+ return ENOENT;
}
/*
* from the BSP. The 8259 may still be connected to LINT0 on
* the BSP's LAPIC.
*/
- if (ioapic_imcr_present) {
+ if (imcr_present) {
outb(0x22, 0x70); /* select IMCR */
outb(0x23, 0x01); /* disconnect 8259 */
}
.intr_config = icu_intr_config
};
-static int icu_imcr_present;
-
/*
* WARNING! SMP builds can use the ICU now so this code must be MP safe.
*/
static int
icu_setvar(int varid, const void *buf)
{
- int error = 0;
-
- switch(varid) {
- case MACHINTR_VAR_IMCR_PRESENT:
- icu_imcr_present = *(const int *)buf;
- break;
-
- default:
- error = ENOENT;
- break;
- }
- return error;
+ return ENOENT;
}
static int
icu_getvar(int varid, void *buf)
{
- int error = 0;
-
- switch(varid) {
- case MACHINTR_VAR_IMCR_PRESENT:
- *(int *)buf = icu_imcr_present;
- break;
-
- default:
- error = ENOENT;
- break;
- }
- return error;
+ return ENOENT;
}
/*
* MachIntrABI switching will happen in
* MachIntrABI_IOAPIC.finalize()
*/
- MachIntrABI_IOAPIC.setvar(MACHINTR_VAR_IMCR_PRESENT,
- &icu_imcr_present);
MachIntrABI_IOAPIC.finalize();
return;
}
* wire mode so we can use other interrupt sources within the LAPIC
* in addition to the 8259.
*/
- if (icu_imcr_present) {
+ if (imcr_present) {
register_t ef;
crit_enter();
void ioapic_write (volatile void *, int, u_int);
/* global data in mp_machdep.c */
+extern int imcr_present;
extern int apic_io_enable;
extern int ioapic_use_old;
extern int mp_naps;
#endif
static int mptable_map(struct mptable_pos *);
static void mptable_unmap(struct mptable_pos *);
-static void mptable_imcr(struct mptable_pos *);
static void mptable_bus_info_alloc(const mpcth_t,
struct mptable_bus_info *);
static void mptable_bus_info_free(struct mptable_bus_info *);
SYSCTL_INT(_machdep, OID_AUTO, smp_active, CTLFLAG_RD, &smp_active_mask, 0, "");
static u_int bootMP_size;
+int imcr_present;
+
static vm_paddr_t mptable_fps_phyaddr;
static int mptable_use_default;
static TAILQ_HEAD(mptable_pci_int_list, mptable_pci_int) mptable_pci_int_list =
kprintf("MPTABLE: use default configuration\n");
mptable_use_default = 1;
}
+ if (mpt.mp_fps->mpfb2 & 0x80)
+ imcr_present = 1;
mptable_unmap(&mpt);
}
if (apic_io_enable)
ioapic_config();
- if (mptable_fps_phyaddr) {
- mptable_map(&mpt);
- mptable_imcr(&mpt);
- mptable_unmap(&mpt);
- }
if (apic_io_enable && ioapic_use_old) {
if (!mptable_fps_phyaddr)
}
static void
-mptable_imcr(struct mptable_pos *mpt)
-{
- /* record whether PIC or virtual-wire mode */
- machintr_setvar_simple(MACHINTR_VAR_IMCR_PRESENT,
- mpt->mp_fps->mpfb2 & 0x80);
-}
-
-static void
mptable_lapic_default(void)
{
int ap_apicid, bsp_apicid;