i386 - Get completely rid of APIC_IO
[dragonfly.git] / sys / platform / pc32 / isa / clock.c
index c5acda6..99ca676 100644 (file)
@@ -88,7 +88,7 @@
 
 #include <machine_base/isa/intr_machdep.h>
 
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
 /* The interrupt triggered by the 8254 (timer) chip */
 int apic_8254_intr;
 static void setup_8254_mixed_mode (void);
@@ -1017,10 +1017,10 @@ static void
 i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected)
 {
        int diag;
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
        int apic_8254_trial;
        void *clkdesc;
-#endif /* APIC_IO */
+#endif
 
        callout_init(&sysbeepstop_ch);
 
@@ -1045,8 +1045,8 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected)
         }
 
        /* Finish initializing 8253 timer 0. */
-#ifdef APIC_IO
-
+#ifdef SMP /* APIC-IO */
+if (apic_io_enable) {
        apic_8254_intr = isa_apic_irq(0);
        apic_8254_trial = 0;
        if (apic_8254_intr >= 0 ) {
@@ -1067,16 +1067,16 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected)
                               INTR_NOPOLL | INTR_MPSAFE | 
                               INTR_NOENTROPY);
        machintr_intren(apic_8254_intr);
-       
-#else /* APIC_IO */
-
+} else {
+#endif
        register_int(0, clkintr, NULL, "clk", NULL,
                     INTR_EXCL | INTR_CLOCK |
                     INTR_NOPOLL | INTR_MPSAFE |
                     INTR_NOENTROPY);
        machintr_intren(ICU_IRQ0);
-
-#endif /* APIC_IO */
+#ifdef SMP /* APIC-IO */
+}
+#endif
 
        /* Initialize RTC. */
        writertc(RTC_STATUSA, rtc_statusa);
@@ -1087,10 +1087,12 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected)
                if (diag != 0)
                        kprintf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS);
 
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
+if (apic_io_enable) {
                if (isa_apic_irq(8) != 8)
                        panic("APIC RTC != 8");
-#endif /* APIC_IO */
+}
+#endif
 
                register_int(8, (inthand2_t *)rtcintr, NULL, "rtc", NULL,
                             INTR_EXCL | INTR_CLOCK | INTR_NOPOLL |
@@ -1100,7 +1102,8 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected)
                writertc(RTC_STATUSB, rtc_statusb);
        }
 
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
+if (apic_io_enable) {
        if (apic_8254_trial) {
                sysclock_t base;
                long lastcnt;
@@ -1168,10 +1171,11 @@ i8254_intr_initclock(struct cputimer_intr *cti, boolean_t selected)
                kprintf("APIC_IO: "
                       "routing 8254 via 8259 and IOAPIC #0 intpin 0\n");
        }
+}
 #endif
 }
 
-#ifdef APIC_IO
+#ifdef SMP /* APIC-IO */
 
 static void 
 setup_8254_mixed_mode(void)