#include <machine/cpufunc.h>
#include <machine/segments.h>
-#include <machine_base/isa/intr_machdep.h>
+#include <machine_base/icu/icu_var.h>
#include "acpi.h"
#include <dev/acpica5/acpivar.h>
# arch/i386/i386/locore.s standard
platform/pc32/i386/machdep.c standard
platform/pc32/i386/math_emulate.c optional math_emulate
+platform/pc32/icu/icu.c standard
platform/pc32/icu/icu_abi.c standard
platform/pc32/icu/icu_ipl.s standard
platform/pc32/icu/icu_vector.s standard
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/sysctl.h>
+#include <sys/interrupt.h>
#include <sys/proc.h>
#include <machine/ipl.h>
#include <machine/globaldata.h>
#include <machine/pcb.h>
-#include <machine_base/isa/intr_machdep.h>
/*
* Bits in the spending bitmap variable must be set atomically because
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/rman.h>
+#include <sys/interrupt.h>
#include <machine/vmparam.h>
#include <vm/vm.h>
* See the notice for details.
*/
-#include "use_isa.h"
#include "opt_auto_eoi.h"
#include <sys/param.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <sys/systm.h>
-#include <sys/syslog.h>
-#include <sys/malloc.h>
-#include <sys/errno.h>
-#include <sys/interrupt.h>
-#include <machine/ipl.h>
-#include <machine/md_var.h>
-#include <machine/segments.h>
-#include <sys/bus.h>
-#include <machine/globaldata.h>
-#include <sys/proc.h>
-#include <sys/thread2.h>
#include <sys/machintr.h>
-
+#include <sys/interrupt.h>
+#include <bus/isa/isareg.h>
+#include <cpu/cpufunc.h>
#include <machine/smp.h>
-#include <bus/isa/isa.h>
-#include <machine_base/icu/icu.h>
-
-#if NISA > 0
-#include <bus/isa/isavar.h>
-#endif
#include <machine_base/isa/intr_machdep.h>
-#include <sys/interrupt.h>
-#include <machine/clock.h>
-#include <machine/cpu.h>
+#include <machine_base/icu/icu.h>
+#include <machine_base/icu/icu_var.h>
static void icu_init(void);
-#define NMI_PARITY (1 << 7)
-#define NMI_IOCHAN (1 << 6)
-#define ENMI_WATCHDOG (1 << 7)
-#define ENMI_BUSTIMER (1 << 6)
-#define ENMI_IOSTATUS (1 << 5)
-
-/*
- * Handle a NMI, possibly a machine check.
- * return true to panic system, false to ignore.
- */
-int
-isa_nmi(int cd)
-{
- int retval = 0;
- int isa_port = inb(0x61);
- int eisa_port = inb(0x461);
-
- log(LOG_CRIT, "NMI ISA %x, EISA %x\n", isa_port, eisa_port);
-
- if (isa_port & NMI_PARITY) {
- log(LOG_CRIT, "RAM parity error, likely hardware failure.");
- retval = 1;
- }
-
- if (isa_port & NMI_IOCHAN) {
- log(LOG_CRIT, "I/O channel check, likely hardware failure.");
- retval = 1;
- }
-
- /*
- * On a real EISA machine, this will never happen. However it can
- * happen on ISA machines which implement XT style floating point
- * error handling (very rare). Save them from a meaningless panic.
- */
- if (eisa_port == 0xff)
- return(retval);
-
- if (eisa_port & ENMI_WATCHDOG) {
- log(LOG_CRIT, "EISA watchdog timer expired, likely hardware failure.");
- retval = 1;
- }
-
- if (eisa_port & ENMI_BUSTIMER) {
- log(LOG_CRIT, "EISA bus timeout, likely hardware failure.");
- retval = 1;
- }
-
- if (eisa_port & ENMI_IOSTATUS) {
- log(LOG_CRIT, "EISA I/O port status error.");
- retval = 1;
- }
- return(retval);
-}
-
-/*
- * ICU reinitialize when ICU configuration has lost.
- */
-void
-icu_reinit(void)
-{
- int i;
-
- icu_init();
- for (i = 0; i < MAX_HARDINTS; ++i) {
- if (count_registered_ints(i))
- machintr_intren(i);
- }
-}
-
-/*
- * Fill in default interrupt table (in case of spurious interrupt
- * during configuration of kernel, setup interrupt control unit
- */
-void
-isa_defaultirq(void)
-{
- u_long ef;
-
- KKASSERT(MachIntrABI.type == MACHINTR_ICU);
-
- ef = read_eflags();
- cpu_disable_intr();
-
- /* Leave interrupts masked */
- outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff);
- outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff);
-
- MachIntrABI.setdefault();
- icu_init();
-
- write_eflags(ef);
-}
-
static void
icu_init(void)
{
outb(IO_ICU2, 0x0a); /* default to IRR on read */
}
-#if NISA > 0
+void
+icu_definit(void)
+{
+ u_long ef;
+
+ KKASSERT(MachIntrABI.type == MACHINTR_ICU);
+
+ ef = read_eflags();
+ cpu_disable_intr();
+
+ /* Leave interrupts masked */
+ outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff);
+ outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff);
+
+ MachIntrABI.setdefault();
+ icu_init();
+
+ write_eflags(ef);
+}
+
+/*
+ * ICU reinitialize when ICU configuration has lost.
+ */
+void
+icu_reinit(void)
+{
+ int i;
+
+ icu_init();
+ for (i = 0; i < MAX_HARDINTS; ++i) {
+ if (count_registered_ints(i))
+ machintr_intren(i);
+ }
+}
+
/*
* Return a bitmap of the current interrupt requests. This is 8259-specific
* and is only suitable for use at probe time.
*/
intrmask_t
-isa_irq_pending(void)
+icu_irq_pending(void)
{
u_char irr1;
u_char irr2;
irr2 = inb(IO_ICU2);
return ((irr2 << 8) | irr1);
}
-
-#endif
/*-
- * Copyright (c) 2001 Doug Rabson
+ * Copyright (c) 1991 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/ia64/acpica/acpi_wakeup.c,v 1.4 2009/06/05 18:44:36 jkim Exp $
*/
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/bus.h>
-#include <sys/lock.h>
-#include <sys/proc.h>
-#include <sys/sysctl.h>
-
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <vm/vm_object.h>
-#include <vm/vm_page.h>
-#include <vm/vm_map.h>
+#ifndef _ARCH_ICU_ICU_VAR_H_
+#define _ARCH_ICU_ICU_VAR_H_
-#include <machine/cpufunc.h>
-#include <machine/segments.h>
-#include <machine_base/isa/intr_machdep.h>
+#ifndef _SYS_TYPES_H_
+#include <sys/types.h>
+#endif
-#include "acpi.h"
-#include <dev/acpica5/acpivar.h>
+void icu_definit(void);
+void icu_reinit(void);
-int
-acpi_sleep_machdep(struct acpi_softc *sc, int state)
-{
- return (0);
-}
+intrmask_t icu_irq_pending(void);
-void
-acpi_install_wakeup_handler(struct acpi_softc *sc)
-{
-}
+#endif /* !_ARCH_ICU_ICU_VAR_H_ */
#include <sys/thread2.h>
#include <sys/systimer.h>
#include <sys/machintr.h>
+#include <sys/interrupt.h>
#include <machine/clock.h>
#ifdef CLK_CALIBRATION_LOOP
*/
#include "use_isa.h"
-#include "opt_auto_eoi.h"
#include <sys/param.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <sys/systm.h>
#include <sys/syslog.h>
-#include <sys/malloc.h>
-#include <sys/errno.h>
-#include <sys/interrupt.h>
-#include <machine/ipl.h>
-#include <machine/md_var.h>
-#include <machine/segments.h>
-#include <sys/bus.h>
-#include <machine/globaldata.h>
-#include <sys/proc.h>
-#include <sys/thread2.h>
-#include <sys/machintr.h>
-
-#include <machine/smp.h>
-#include <bus/isa/isa.h>
-#include <machine_base/icu/icu.h>
-
-#if NISA > 0
+#include <sys/bus.h>
#include <bus/isa/isavar.h>
-#endif
-#include <machine_base/isa/intr_machdep.h>
-#include <sys/interrupt.h>
-#include <machine/clock.h>
-#include <machine/cpu.h>
-static void icu_init(void);
+#include <machine_base/icu/icu_var.h>
+#include <machine_base/isa/intr_machdep.h>
#define NMI_PARITY (1 << 7)
#define NMI_IOCHAN (1 << 6)
}
/*
- * ICU reinitialize when ICU configuration has lost.
- */
-void
-icu_reinit(void)
-{
- int i;
-
- icu_init();
- for (i = 0; i < MAX_HARDINTS; ++i) {
- if (count_registered_ints(i))
- machintr_intren(i);
- }
-}
-
-/*
* Fill in default interrupt table (in case of spurious interrupt
* during configuration of kernel, setup interrupt control unit
*/
void
isa_defaultirq(void)
{
- u_long ef;
-
- KKASSERT(MachIntrABI.type == MACHINTR_ICU);
-
- ef = read_eflags();
- cpu_disable_intr();
-
- /* Leave interrupts masked */
- outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff);
- outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff);
-
- MachIntrABI.setdefault();
- icu_init();
-
- write_eflags(ef);
-}
-
-static void
-icu_init(void)
-{
-#ifdef AUTO_EOI_1
- int auto_eoi = 2; /* auto EOI, 8086 mode */
-#else
- int auto_eoi = 0; /* 8086 mode */
-#endif
-
-#ifdef SMP
- if (apic_io_enable)
- auto_eoi = 2; /* auto EOI, 8086 mode */
-#endif
-
- /*
- * Program master
- */
- outb(IO_ICU1, 0x11); /* reset; program device, four bytes */
- outb(IO_ICU1 + ICU_IMR_OFFSET, IDT_OFFSET);
- /* starting at this vector index */
- outb(IO_ICU1 + ICU_IMR_OFFSET, 1 << ICU_IRQ_SLAVE);
- /* slave on line 2 */
- outb(IO_ICU1 + ICU_IMR_OFFSET, auto_eoi | 1); /* 8086 mode */
-
- outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */
- outb(IO_ICU1, 0x0a); /* default to IRR on read */
- outb(IO_ICU1, 0xc0 | (3 - 1)); /* pri order 3-7, 0-2 (com2 first) */
-
- /*
- * Program slave
- */
- outb(IO_ICU2, 0x11); /* reset; program device, four bytes */
- outb(IO_ICU2 + ICU_IMR_OFFSET, IDT_OFFSET + 8);
- /* staring at this vector index */
- outb(IO_ICU2 + ICU_IMR_OFFSET, ICU_IRQ_SLAVE);
-#ifdef AUTO_EOI_2
- outb(IO_ICU2 + ICU_IMR_OFFSET, 2 | 1); /* auto EOI, 8086 mode */
-#else
- outb(IO_ICU2 + ICU_IMR_OFFSET, 1); /* 8086 mode */
-#endif
-
- outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */
- outb(IO_ICU2, 0x0a); /* default to IRR on read */
+ icu_definit();
}
#if NISA > 0
-/*
- * Return a bitmap of the current interrupt requests. This is 8259-specific
- * and is only suitable for use at probe time.
- */
+
intrmask_t
isa_irq_pending(void)
{
- u_char irr1;
- u_char irr2;
-
- irr1 = inb(IO_ICU1);
- irr2 = inb(IO_ICU2);
- return ((irr2 << 8) | irr1);
+ return icu_irq_pending();
}
#endif
#define _ARCH_ISA_INTR_MACHDEP_H_
#ifndef LOCORE
-#ifndef _SYS_INTERRUPT_H_
-#include <sys/interrupt.h>
-#endif
-#ifndef _SYS_SERIALIZE_H_
-#include <sys/serialize.h>
+#ifndef _SYS_TYPES_H_
+#include <sys/types.h>
#endif
#endif
Xipiq; /* handle lwkt_send_ipiq() requests */
#endif /* SMP */
-void isa_defaultirq (void);
-int isa_nmi (int cd);
-void icu_reinit (void);
+void isa_defaultirq(void);
+int isa_nmi(int);
#endif /* LOCORE */
#include <machine/cpufunc.h>
#include <machine/segments.h>
-#include <machine_base/isa/intr_machdep.h>
+#include <machine_base/icu/icu_var.h>
#include "acpi.h"
#include <dev/acpica5/acpivar.h>
platform/pc64/x86_64/nexus.c standard
+platform/pc64/icu/icu.c standard
platform/pc64/icu/icu_abi.c standard
platform/pc64/icu/icu_ipl.s standard
platform/pc64/icu/icu_vector.s standard
* See the notice for details.
*/
-#include "use_isa.h"
#include "opt_auto_eoi.h"
#include <sys/param.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <sys/systm.h>
-#include <sys/syslog.h>
-#include <sys/malloc.h>
-#include <sys/errno.h>
-#include <sys/interrupt.h>
-#include <machine/ipl.h>
-#include <machine/md_var.h>
-#include <machine/segments.h>
-#include <sys/bus.h>
-#include <machine/globaldata.h>
-#include <sys/proc.h>
-#include <sys/thread2.h>
#include <sys/machintr.h>
-
+#include <sys/interrupt.h>
+#include <bus/isa/isareg.h>
+#include <cpu/cpufunc.h>
#include <machine/smp.h>
-#include <bus/isa/isa.h>
-#include <machine_base/icu/icu.h>
-
-#if NISA > 0
-#include <bus/isa/isavar.h>
-#endif
#include <machine_base/isa/intr_machdep.h>
-#include <sys/interrupt.h>
-#include <machine/clock.h>
-#include <machine/cpu.h>
+#include <machine_base/icu/icu.h>
+#include <machine_base/icu/icu_var.h>
static void icu_init(void);
-#define NMI_PARITY (1 << 7)
-#define NMI_IOCHAN (1 << 6)
-#define ENMI_WATCHDOG (1 << 7)
-#define ENMI_BUSTIMER (1 << 6)
-#define ENMI_IOSTATUS (1 << 5)
-
-/*
- * Handle a NMI, possibly a machine check.
- * return true to panic system, false to ignore.
- */
-int
-isa_nmi(int cd)
-{
- int retval = 0;
- int isa_port = inb(0x61);
- int eisa_port = inb(0x461);
-
- log(LOG_CRIT, "NMI ISA %x, EISA %x\n", isa_port, eisa_port);
-
- if (isa_port & NMI_PARITY) {
- log(LOG_CRIT, "RAM parity error, likely hardware failure.");
- retval = 1;
- }
-
- if (isa_port & NMI_IOCHAN) {
- log(LOG_CRIT, "I/O channel check, likely hardware failure.");
- retval = 1;
- }
-
- /*
- * On a real EISA machine, this will never happen. However it can
- * happen on ISA machines which implement XT style floating point
- * error handling (very rare). Save them from a meaningless panic.
- */
- if (eisa_port == 0xff)
- return(retval);
-
- if (eisa_port & ENMI_WATCHDOG) {
- log(LOG_CRIT, "EISA watchdog timer expired, likely hardware failure.");
- retval = 1;
- }
-
- if (eisa_port & ENMI_BUSTIMER) {
- log(LOG_CRIT, "EISA bus timeout, likely hardware failure.");
- retval = 1;
- }
-
- if (eisa_port & ENMI_IOSTATUS) {
- log(LOG_CRIT, "EISA I/O port status error.");
- retval = 1;
- }
- return(retval);
-}
-
-/*
- * ICU reinitialize when ICU configuration has lost.
- */
-void
-icu_reinit(void)
-{
- int i;
-
- icu_init();
- for (i = 0; i < MAX_HARDINTS; ++i) {
- if (count_registered_ints(i))
- machintr_intren(i);
- }
-}
-
-/*
- * Fill in default interrupt table (in case of spurious interrupt
- * during configuration of kernel, setup interrupt control unit
- */
-void
-isa_defaultirq(void)
-{
- u_long ef;
-
- KKASSERT(MachIntrABI.type == MACHINTR_ICU);
-
- ef = read_eflags();
- cpu_disable_intr();
-
- /* Leave interrupts masked */
- outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff);
- outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff);
-
- MachIntrABI.setdefault();
- icu_init();
-
- write_eflags(ef);
-}
-
static void
icu_init(void)
{
outb(IO_ICU2, 0x0a); /* default to IRR on read */
}
-#if NISA > 0
+void
+icu_definit(void)
+{
+ register_t ef;
+
+ KKASSERT(MachIntrABI.type == MACHINTR_ICU);
+
+ ef = read_rflags();
+ cpu_disable_intr();
+
+ /* Leave interrupts masked */
+ outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff);
+ outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff);
+
+ MachIntrABI.setdefault();
+ icu_init();
+
+ write_rflags(ef);
+}
+
+/*
+ * ICU reinitialize when ICU configuration has lost.
+ */
+void
+icu_reinit(void)
+{
+ int i;
+
+ icu_init();
+ for (i = 0; i < MAX_HARDINTS; ++i) {
+ if (count_registered_ints(i))
+ machintr_intren(i);
+ }
+}
+
/*
* Return a bitmap of the current interrupt requests. This is 8259-specific
* and is only suitable for use at probe time.
*/
intrmask_t
-isa_irq_pending(void)
+icu_irq_pending(void)
{
u_char irr1;
u_char irr2;
irr2 = inb(IO_ICU2);
return ((irr2 << 8) | irr1);
}
-
-#endif
/*-
- * Copyright (c) 2001 Doug Rabson
+ * Copyright (c) 1991 The Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD: src/sys/ia64/acpica/acpi_wakeup.c,v 1.4 2009/06/05 18:44:36 jkim Exp $
*/
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/bus.h>
-#include <sys/lock.h>
-#include <sys/proc.h>
-#include <sys/sysctl.h>
-
-#include <vm/vm.h>
-#include <vm/pmap.h>
-#include <vm/vm_object.h>
-#include <vm/vm_page.h>
-#include <vm/vm_map.h>
+#ifndef _ARCH_ICU_ICU_VAR_H_
+#define _ARCH_ICU_ICU_VAR_H_
-#include <machine/cpufunc.h>
-#include <machine/segments.h>
-#include <machine_base/isa/intr_machdep.h>
+#ifndef _SYS_TYPES_H_
+#include <sys/types.h>
+#endif
-#include "acpi.h"
-#include <dev/acpica5/acpivar.h>
+void icu_definit(void);
+void icu_reinit(void);
-int
-acpi_sleep_machdep(struct acpi_softc *sc, int state)
-{
- return (0);
-}
+intrmask_t icu_irq_pending(void);
-void
-acpi_install_wakeup_handler(struct acpi_softc *sc)
-{
-}
+#endif /* !_ARCH_ICU_ICU_VAR_H_ */
#include <sys/thread2.h>
#include <sys/systimer.h>
#include <sys/machintr.h>
+#include <sys/interrupt.h>
#include <machine/clock.h>
#ifdef CLK_CALIBRATION_LOOP
*/
#include "use_isa.h"
-//#include "opt_auto_eoi.h"
#include <sys/param.h>
-#ifndef SMP
-#include <machine/lock.h>
-#endif
#include <sys/systm.h>
#include <sys/syslog.h>
-#include <sys/malloc.h>
-#include <sys/errno.h>
-#include <sys/interrupt.h>
-#include <machine/ipl.h>
-#include <machine/md_var.h>
-#include <machine/segments.h>
-#include <sys/bus.h>
-#include <machine/globaldata.h>
-#include <sys/proc.h>
-#include <sys/thread2.h>
-#include <sys/machintr.h>
-
-#include <machine/smp.h>
-#include <bus/isa/isa.h>
-#include <machine_base/icu/icu.h>
-
-#if NISA > 0
+#include <sys/bus.h>
#include <bus/isa/isavar.h>
-#endif
-#include <machine_base/isa/intr_machdep.h>
-#include <sys/interrupt.h>
-#include <machine/clock.h>
-#include <machine/cpu.h>
-static void icu_init(void);
+#include <machine_base/icu/icu_var.h>
+#include <machine_base/isa/intr_machdep.h>
#define NMI_PARITY (1 << 7)
#define NMI_IOCHAN (1 << 6)
}
/*
- * ICU reinitialize when ICU configuration has lost.
- */
-void
-icu_reinit(void)
-{
- int i;
-
- icu_init();
- for (i = 0; i < MAX_HARDINTS; ++i) {
- if (count_registered_ints(i))
- machintr_intren(i);
- }
-}
-
-/*
* Fill in default interrupt table (in case of spurious interrupt
* during configuration of kernel, setup interrupt control unit
*/
void
isa_defaultirq(void)
{
- register_t ef;
-
- KKASSERT(MachIntrABI.type == MACHINTR_ICU);
-
- ef = read_rflags();
- cpu_disable_intr();
-
- /* Leave interrupts masked */
- outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff);
- outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff);
-
- MachIntrABI.setdefault();
- icu_init();
-
- write_rflags(ef);
-}
-
-static void
-icu_init(void)
-{
-#ifdef AUTO_EOI_1
- int auto_eoi = 2; /* auto EOI, 8086 mode */
-#else
- int auto_eoi = 0; /* 8086 mode */
-#endif
-
-#ifdef SMP
- if (apic_io_enable)
- auto_eoi = 2; /* auto EOI, 8086 mode */
-#endif
-
- /*
- * Program master
- */
- outb(IO_ICU1, 0x11); /* reset; program device, four bytes */
- outb(IO_ICU1 + ICU_IMR_OFFSET, IDT_OFFSET);
- /* starting at this vector index */
- outb(IO_ICU1 + ICU_IMR_OFFSET, 1 << ICU_IRQ_SLAVE);
- /* slave on line 2 */
- outb(IO_ICU1 + ICU_IMR_OFFSET, auto_eoi | 1); /* 8086 mode */
-
- outb(IO_ICU1 + ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */
- outb(IO_ICU1, 0x0a); /* default to IRR on read */
- outb(IO_ICU1, 0xc0 | (3 - 1)); /* pri order 3-7, 0-2 (com2 first) */
-
- /*
- * Program slave
- */
- outb(IO_ICU2, 0x11); /* reset; program device, four bytes */
- outb(IO_ICU2 + ICU_IMR_OFFSET, IDT_OFFSET + 8);
- /* staring at this vector index */
- outb(IO_ICU2 + ICU_IMR_OFFSET, ICU_IRQ_SLAVE);
-#ifdef AUTO_EOI_2
- outb(IO_ICU2 + ICU_IMR_OFFSET, 2 | 1); /* auto EOI, 8086 mode */
-#else
- outb(IO_ICU2 + ICU_IMR_OFFSET, 1); /* 8086 mode */
-#endif
-
- outb(IO_ICU2 + ICU_IMR_OFFSET, 0xff); /* leave interrupts masked */
- outb(IO_ICU2, 0x0a); /* default to IRR on read */
+ icu_definit();
}
#if NISA > 0
-/*
- * Return a bitmap of the current interrupt requests. This is 8259-specific
- * and is only suitable for use at probe time.
- */
+
intrmask_t
isa_irq_pending(void)
{
- u_char irr1;
- u_char irr2;
-
- irr1 = inb(IO_ICU1);
- irr2 = inb(IO_ICU2);
- return ((irr2 << 8) | irr1);
+ return icu_irq_pending();
}
#endif
#define _ARCH_ISA_INTR_MACHDEP_H_
#ifndef LOCORE
-#ifndef _SYS_INTERRUPT_H_
-#include <sys/interrupt.h>
-#endif
-#ifndef _SYS_SERIALIZE_H_
-#include <sys/serialize.h>
+#ifndef _SYS_TYPES_H_
+#include <sys/types.h>
#endif
#endif
Xipiq; /* handle lwkt_send_ipiq() requests */
#endif /* SMP */
-void isa_defaultirq (void);
-int isa_nmi (int cd);
-void icu_reinit (void);
+void isa_defaultirq(void);
+int isa_nmi(int);
#endif /* LOCORE */
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/rman.h>
+#include <sys/interrupt.h>
#include <machine/vmparam.h>
#include <vm/vm.h>