diff options
author | kato <kato@FreeBSD.org> | 1997-06-26 14:49:25 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1997-06-26 14:49:25 +0000 |
commit | 60244752ba0da2984ac299345931acdf9be55c9f (patch) | |
tree | 73bfda821f11079d54a9270d088f23fb09d5ddbb /sys/pc98/cbus/clock.c | |
parent | 58f4514cd9e7669e242b1a2ad4a3b46e7d720071 (diff) | |
download | FreeBSD-src-60244752ba0da2984ac299345931acdf9be55c9f.zip FreeBSD-src-60244752ba0da2984ac299345931acdf9be55c9f.tar.gz |
Synchronize with sys/i386/isa/clock.c and isa.c revisions 1.88 and
1.93, respectively.
Diffstat (limited to 'sys/pc98/cbus/clock.c')
-rw-r--r-- | sys/pc98/cbus/clock.c | 68 |
1 files changed, 32 insertions, 36 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) |