diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/pc98/cbus/clock.c | 68 | ||||
-rw-r--r-- | sys/pc98/cbus/pcrtc.c | 68 | ||||
-rw-r--r-- | sys/pc98/pc98/clock.c | 68 | ||||
-rw-r--r-- | sys/pc98/pc98/pc98.c | 10 |
4 files changed, 101 insertions, 113 deletions
diff --git a/sys/pc98/cbus/clock.c b/sys/pc98/cbus/clock.c index daee5ca..8f3bd55 100644 --- a/sys/pc98/cbus/clock.c +++ b/sys/pc98/cbus/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.24 1997/05/31 12:43:17 kato Exp $ + * $Id: clock.c,v 1.25 1997/06/02 15:45:40 kato Exp $ */ /* @@ -68,6 +68,9 @@ #include <machine/cpu.h> #include <machine/frame.h> #include <machine/ipl.h> +#ifdef APIC_IO +#include <machine/smp.h> +#endif /* APIC_IO */ #include <i386/isa/icu.h> #ifdef PC98 @@ -1128,9 +1131,9 @@ resettodr() #endif } -#if defined(APIC_IO) +#ifdef APIC_IO -/* from icu.s: */ +/* XXX FIXME: from icu.s: */ extern u_int vec[]; extern void vec8254 __P((void)); extern void vecRTC __P((void)); @@ -1148,7 +1151,7 @@ extern u_int maskRTC; void cpu_initclocks() { -#if defined(APIC_IO) +#ifdef APIC_IO int x; #endif /* APIC_IO */ #ifndef PC98 @@ -1171,35 +1174,30 @@ cpu_initclocks() #endif /* Finish initializing 8253 timer 0. */ -#if defined(APIC_IO) - /* 8254 is traditionally on ISA IRQ0 */ - if ((x = get_isa_apic_irq(0)) < 0) { - /* - * bummer, this mb doesn't have the 8254 on ISA irq0, - * perhaps it's on the EISA bus... - */ - if ((x = get_eisa_apic_irq(0)) < 0) { - /* double bummer, attempt to redirect thru the 8259 */ - if (bootverbose) - printf("APIC missing 8254 connection\n"); - - /* allow 8254 timer to INTerrupt 8259 */ -#if !defined(IO_ICU1) +#ifdef APIC_IO +#ifndef IO_ICU1 #ifdef PC98 -#define IO_ICU1 0x00 +#define IO_ICU1 0x20 #else #define IO_ICU1 0x20 #endif -#endif - x = inb(IO_ICU1 + 1); /* current mask in 8259 */ - x &= ~1; /* clear 8254 timer mask */ - outb(IO_ICU1 + 1, x); /* write new mask */ - - /* program IO APIC for type 3 INT on INT0 */ - if (ext_int_setup(0, 0) < 0) - panic("8254 redirect impossible!"); - x = 0; /* 8259 is on 0 */ - } +#endif /* IO_ICU1 */ + + /* 8254 is traditionally on ISA IRQ0 */ + if ((x = isa_apic_pin(0)) < 0) { + /* bummer, attempt to redirect thru the 8259 */ + if (bootverbose) + printf("APIC missing 8254 connection\n"); + + /* allow 8254 timer to INTerrupt 8259 */ + x = inb(IO_ICU1 + 1); /* current mask in 8259 */ + x &= ~1; /* clear 8254 timer mask */ + outb(IO_ICU1 + 1, x); /* write new mask */ + + /* program IO APIC for type 3 INT on INT0 */ + if (ext_int_setup(0, 0) < 0) + panic("8254 redirect impossible!"); + x = 0; /* 8259 is on 0 */ } vec[x] = (u_int)vec8254; @@ -1215,6 +1213,7 @@ cpu_initclocks() /* unit */ 0); INTREN(IRQ0); #endif /* APIC_IO */ + #if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) /* * Finish setting up anti-jitter measures. @@ -1234,13 +1233,10 @@ cpu_initclocks() diag = rtcin(RTC_DIAG); if (diag != 0) printf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS); -#if defined(APIC_IO) +#ifdef APIC_IO /* RTC is traditionally on ISA IRQ8 */ - if ((x = get_isa_apic_irq(8)) < 0) { - if ((x = get_eisa_apic_irq(8)) < 0) { - panic("APIC missing RTC connection"); - } - } + if ((x = isa_apic_pin(8)) < 0) + panic("APIC missing RTC connection"); vec[x] = (u_int)vecRTC; XintrRTC = (u_int)ivectors[x]; /* XXX might need Xfastintr# */ @@ -1258,7 +1254,7 @@ cpu_initclocks() writertc(RTC_STATUSB, rtc_statusb); #endif -#if defined(APIC_IO) +#ifdef APIC_IO printf("Enabled INTs: "); for (x = 0; x < 24; ++x) if ((imen & (1 << x)) == 0) diff --git a/sys/pc98/cbus/pcrtc.c b/sys/pc98/cbus/pcrtc.c index daee5ca..8f3bd55 100644 --- a/sys/pc98/cbus/pcrtc.c +++ b/sys/pc98/cbus/pcrtc.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.24 1997/05/31 12:43:17 kato Exp $ + * $Id: clock.c,v 1.25 1997/06/02 15:45:40 kato Exp $ */ /* @@ -68,6 +68,9 @@ #include <machine/cpu.h> #include <machine/frame.h> #include <machine/ipl.h> +#ifdef APIC_IO +#include <machine/smp.h> +#endif /* APIC_IO */ #include <i386/isa/icu.h> #ifdef PC98 @@ -1128,9 +1131,9 @@ resettodr() #endif } -#if defined(APIC_IO) +#ifdef APIC_IO -/* from icu.s: */ +/* XXX FIXME: from icu.s: */ extern u_int vec[]; extern void vec8254 __P((void)); extern void vecRTC __P((void)); @@ -1148,7 +1151,7 @@ extern u_int maskRTC; void cpu_initclocks() { -#if defined(APIC_IO) +#ifdef APIC_IO int x; #endif /* APIC_IO */ #ifndef PC98 @@ -1171,35 +1174,30 @@ cpu_initclocks() #endif /* Finish initializing 8253 timer 0. */ -#if defined(APIC_IO) - /* 8254 is traditionally on ISA IRQ0 */ - if ((x = get_isa_apic_irq(0)) < 0) { - /* - * bummer, this mb doesn't have the 8254 on ISA irq0, - * perhaps it's on the EISA bus... - */ - if ((x = get_eisa_apic_irq(0)) < 0) { - /* double bummer, attempt to redirect thru the 8259 */ - if (bootverbose) - printf("APIC missing 8254 connection\n"); - - /* allow 8254 timer to INTerrupt 8259 */ -#if !defined(IO_ICU1) +#ifdef APIC_IO +#ifndef IO_ICU1 #ifdef PC98 -#define IO_ICU1 0x00 +#define IO_ICU1 0x20 #else #define IO_ICU1 0x20 #endif -#endif - x = inb(IO_ICU1 + 1); /* current mask in 8259 */ - x &= ~1; /* clear 8254 timer mask */ - outb(IO_ICU1 + 1, x); /* write new mask */ - - /* program IO APIC for type 3 INT on INT0 */ - if (ext_int_setup(0, 0) < 0) - panic("8254 redirect impossible!"); - x = 0; /* 8259 is on 0 */ - } +#endif /* IO_ICU1 */ + + /* 8254 is traditionally on ISA IRQ0 */ + if ((x = isa_apic_pin(0)) < 0) { + /* bummer, attempt to redirect thru the 8259 */ + if (bootverbose) + printf("APIC missing 8254 connection\n"); + + /* allow 8254 timer to INTerrupt 8259 */ + x = inb(IO_ICU1 + 1); /* current mask in 8259 */ + x &= ~1; /* clear 8254 timer mask */ + outb(IO_ICU1 + 1, x); /* write new mask */ + + /* program IO APIC for type 3 INT on INT0 */ + if (ext_int_setup(0, 0) < 0) + panic("8254 redirect impossible!"); + x = 0; /* 8259 is on 0 */ } vec[x] = (u_int)vec8254; @@ -1215,6 +1213,7 @@ cpu_initclocks() /* unit */ 0); INTREN(IRQ0); #endif /* APIC_IO */ + #if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) /* * Finish setting up anti-jitter measures. @@ -1234,13 +1233,10 @@ cpu_initclocks() diag = rtcin(RTC_DIAG); if (diag != 0) printf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS); -#if defined(APIC_IO) +#ifdef APIC_IO /* RTC is traditionally on ISA IRQ8 */ - if ((x = get_isa_apic_irq(8)) < 0) { - if ((x = get_eisa_apic_irq(8)) < 0) { - panic("APIC missing RTC connection"); - } - } + if ((x = isa_apic_pin(8)) < 0) + panic("APIC missing RTC connection"); vec[x] = (u_int)vecRTC; XintrRTC = (u_int)ivectors[x]; /* XXX might need Xfastintr# */ @@ -1258,7 +1254,7 @@ cpu_initclocks() writertc(RTC_STATUSB, rtc_statusb); #endif -#if defined(APIC_IO) +#ifdef APIC_IO printf("Enabled INTs: "); for (x = 0; x < 24; ++x) if ((imen & (1 << x)) == 0) diff --git a/sys/pc98/pc98/clock.c b/sys/pc98/pc98/clock.c index daee5ca..8f3bd55 100644 --- a/sys/pc98/pc98/clock.c +++ b/sys/pc98/pc98/clock.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)clock.c 7.2 (Berkeley) 5/12/91 - * $Id: clock.c,v 1.24 1997/05/31 12:43:17 kato Exp $ + * $Id: clock.c,v 1.25 1997/06/02 15:45:40 kato Exp $ */ /* @@ -68,6 +68,9 @@ #include <machine/cpu.h> #include <machine/frame.h> #include <machine/ipl.h> +#ifdef APIC_IO +#include <machine/smp.h> +#endif /* APIC_IO */ #include <i386/isa/icu.h> #ifdef PC98 @@ -1128,9 +1131,9 @@ resettodr() #endif } -#if defined(APIC_IO) +#ifdef APIC_IO -/* from icu.s: */ +/* XXX FIXME: from icu.s: */ extern u_int vec[]; extern void vec8254 __P((void)); extern void vecRTC __P((void)); @@ -1148,7 +1151,7 @@ extern u_int maskRTC; void cpu_initclocks() { -#if defined(APIC_IO) +#ifdef APIC_IO int x; #endif /* APIC_IO */ #ifndef PC98 @@ -1171,35 +1174,30 @@ cpu_initclocks() #endif /* Finish initializing 8253 timer 0. */ -#if defined(APIC_IO) - /* 8254 is traditionally on ISA IRQ0 */ - if ((x = get_isa_apic_irq(0)) < 0) { - /* - * bummer, this mb doesn't have the 8254 on ISA irq0, - * perhaps it's on the EISA bus... - */ - if ((x = get_eisa_apic_irq(0)) < 0) { - /* double bummer, attempt to redirect thru the 8259 */ - if (bootverbose) - printf("APIC missing 8254 connection\n"); - - /* allow 8254 timer to INTerrupt 8259 */ -#if !defined(IO_ICU1) +#ifdef APIC_IO +#ifndef IO_ICU1 #ifdef PC98 -#define IO_ICU1 0x00 +#define IO_ICU1 0x20 #else #define IO_ICU1 0x20 #endif -#endif - x = inb(IO_ICU1 + 1); /* current mask in 8259 */ - x &= ~1; /* clear 8254 timer mask */ - outb(IO_ICU1 + 1, x); /* write new mask */ - - /* program IO APIC for type 3 INT on INT0 */ - if (ext_int_setup(0, 0) < 0) - panic("8254 redirect impossible!"); - x = 0; /* 8259 is on 0 */ - } +#endif /* IO_ICU1 */ + + /* 8254 is traditionally on ISA IRQ0 */ + if ((x = isa_apic_pin(0)) < 0) { + /* bummer, attempt to redirect thru the 8259 */ + if (bootverbose) + printf("APIC missing 8254 connection\n"); + + /* allow 8254 timer to INTerrupt 8259 */ + x = inb(IO_ICU1 + 1); /* current mask in 8259 */ + x &= ~1; /* clear 8254 timer mask */ + outb(IO_ICU1 + 1, x); /* write new mask */ + + /* program IO APIC for type 3 INT on INT0 */ + if (ext_int_setup(0, 0) < 0) + panic("8254 redirect impossible!"); + x = 0; /* 8259 is on 0 */ } vec[x] = (u_int)vec8254; @@ -1215,6 +1213,7 @@ cpu_initclocks() /* unit */ 0); INTREN(IRQ0); #endif /* APIC_IO */ + #if (defined(I586_CPU) || defined(I686_CPU)) && !defined(SMP) /* * Finish setting up anti-jitter measures. @@ -1234,13 +1233,10 @@ cpu_initclocks() diag = rtcin(RTC_DIAG); if (diag != 0) printf("RTC BIOS diagnostic error %b\n", diag, RTCDG_BITS); -#if defined(APIC_IO) +#ifdef APIC_IO /* RTC is traditionally on ISA IRQ8 */ - if ((x = get_isa_apic_irq(8)) < 0) { - if ((x = get_eisa_apic_irq(8)) < 0) { - panic("APIC missing RTC connection"); - } - } + if ((x = isa_apic_pin(8)) < 0) + panic("APIC missing RTC connection"); vec[x] = (u_int)vecRTC; XintrRTC = (u_int)ivectors[x]; /* XXX might need Xfastintr# */ @@ -1258,7 +1254,7 @@ cpu_initclocks() writertc(RTC_STATUSB, rtc_statusb); #endif -#if defined(APIC_IO) +#ifdef APIC_IO printf("Enabled INTs: "); for (x = 0; x < 24; ++x) if ((imen & (1 << x)) == 0) diff --git a/sys/pc98/pc98/pc98.c b/sys/pc98/pc98/pc98.c index 02303cb..9e36705 100644 --- a/sys/pc98/pc98/pc98.c +++ b/sys/pc98/pc98/pc98.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)isa.c 7.2 (Berkeley) 5/13/91 - * $Id: pc98.c,v 1.30 1997/06/02 15:45:40 kato Exp $ + * $Id: pc98.c,v 1.31 1997/06/09 13:40:34 kato Exp $ */ /* @@ -60,7 +60,7 @@ #include <machine/ipl.h> #include <machine/md_var.h> #include <machine/segments.h> -#if defined(APIC_IO) +#ifdef APIC_IO #include <machine/smp.h> #include <machine/apic.h> #endif /* APIC_IO */ @@ -543,7 +543,7 @@ config_isadev_c(isdp, mp, reconfig) } (*dp->attach)(isdp); if (isdp->id_irq) { -#if defined(APIC_IO) +#ifdef APIC_IO /* * Some motherboards use upper IRQs for traditional * ISA INTerrupt sources. In particular we have @@ -553,13 +553,13 @@ config_isadev_c(isdp, mp, reconfig) u_int apic_mask; int rirq; - apic_mask = get_isa_apic_mask(isdp->id_irq); + apic_mask = isa_apic_mask(isdp->id_irq); if (apic_mask != isdp->id_irq) { rirq = ffs(isdp->id_irq) - 1; isdp->id_irq = apic_mask; undirect_isa_irq(rirq); /* free for ISA */ } -#endif /* APIC_IO */ +#endif /* APIC_IO */ if (!isdp->id_conflicts || (!intr_registered(ffs(isdp->id_irq) - 1) && isdp->id_intr != NULL)) |