aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/i386/machdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386/i386/machdep.c')
-rw-r--r--sys/i386/i386/machdep.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 126b6189ad94..8d1ddd83ad46 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -41,6 +41,7 @@
__FBSDID("$FreeBSD$");
#include "opt_atalk.h"
+#include "opt_atpic.h"
#include "opt_compat.h"
#include "opt_cpu.h"
#include "opt_ddb.h"
@@ -2712,8 +2713,22 @@ init386(first)
printf("WARNING: loader(8) metadata is missing!\n");
#ifdef DEV_ISA
+#ifdef DEV_ATPIC
elcr_probe();
atpic_startup();
+#else
+ /* Reset and mask the atpics and leave them shut down. */
+ atpic_reset();
+
+ /*
+ * Point the ICU spurious interrupt vectors at the APIC spurious
+ * interrupt handler.
+ */
+ setidt(IDT_IO_INTS + 7, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL,
+ GSEL(GCODE_SEL, SEL_KPL));
+ setidt(IDT_IO_INTS + 15, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL,
+ GSEL(GCODE_SEL, SEL_KPL));
+#endif
#endif
#ifdef DDB
@@ -2971,8 +2986,22 @@ init386(first)
printf("WARNING: loader(8) metadata is missing!\n");
#ifdef DEV_ISA
+#ifdef DEV_ATPIC
elcr_probe();
atpic_startup();
+#else
+ /* Reset and mask the atpics and leave them shut down. */
+ atpic_reset();
+
+ /*
+ * Point the ICU spurious interrupt vectors at the APIC spurious
+ * interrupt handler.
+ */
+ setidt(IDT_IO_INTS + 7, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL,
+ GSEL(GCODE_SEL, SEL_KPL));
+ setidt(IDT_IO_INTS + 15, IDTVEC(spuriousint), SDT_SYS386IGT, SEL_KPL,
+ GSEL(GCODE_SEL, SEL_KPL));
+#endif
#endif
#ifdef DDB