mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Synchronize with sys/i386/isa/clock.c revision 1.99.
This commit is contained in:
parent
e59a7e77e2
commit
1d39bbefd2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=28511
@ -34,7 +34,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||||
* $Id: clock.c,v 1.30 1997/07/23 11:28:39 kato Exp $
|
* $Id: clock.c,v 1.31 1997/07/26 13:52:47 kato Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -70,7 +70,6 @@
|
|||||||
#include <machine/ipl.h>
|
#include <machine/ipl.h>
|
||||||
#ifdef APIC_IO
|
#ifdef APIC_IO
|
||||||
#include <machine/smp.h>
|
#include <machine/smp.h>
|
||||||
#include <machine/smptests.h> /** NEW_STRATEGY (,SMP_TIMER_NC) */
|
|
||||||
#endif /* APIC_IO */
|
#endif /* APIC_IO */
|
||||||
|
|
||||||
#include <i386/isa/icu.h>
|
#include <i386/isa/icu.h>
|
||||||
@ -84,6 +83,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <i386/isa/timerreg.h>
|
#include <i386/isa/timerreg.h>
|
||||||
|
|
||||||
|
#include <i386/isa/intr_machdep.h>
|
||||||
|
#include <sys/interrupt.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 32-bit time_t's can't reach leap years before 1904 or after 2036, so we
|
* 32-bit time_t's can't reach leap years before 1904 or after 2036, so we
|
||||||
* can use a simple formula for leap years.
|
* can use a simple formula for leap years.
|
||||||
@ -1163,11 +1165,6 @@ cpu_initclocks()
|
|||||||
/* Finish initializing 8253 timer 0. */
|
/* Finish initializing 8253 timer 0. */
|
||||||
#ifdef APIC_IO
|
#ifdef APIC_IO
|
||||||
|
|
||||||
#ifdef NEW_STRATEGY
|
|
||||||
#ifdef SMP_TIMER_NC
|
|
||||||
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
|
|
||||||
#endif /** XXX SMP_TIMER_NC */
|
|
||||||
|
|
||||||
/* 1st look for ExtInt on pin 0 */
|
/* 1st look for ExtInt on pin 0 */
|
||||||
if (apic_int_type(0, 0) == 3) {
|
if (apic_int_type(0, 0) == 3) {
|
||||||
/*
|
/*
|
||||||
@ -1201,33 +1198,6 @@ cpu_initclocks()
|
|||||||
else
|
else
|
||||||
panic("neither pin 0 or pin 2 works for 8254");
|
panic("neither pin 0 or pin 2 works for 8254");
|
||||||
|
|
||||||
#else /** NEW_STRATEGY */
|
|
||||||
|
|
||||||
/* 8254 is traditionally on ISA IRQ0 */
|
|
||||||
#if defined(SMP_TIMER_NC)
|
|
||||||
x = -1;
|
|
||||||
#else
|
|
||||||
x = isa_apic_pin(0);
|
|
||||||
#endif /** XXX SMP_TIMER_NC */
|
|
||||||
|
|
||||||
if (x < 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /** NEW_STRATEGY */
|
|
||||||
|
|
||||||
/* setup the vectors */
|
/* setup the vectors */
|
||||||
vec[x] = (u_int)vec8254;
|
vec[x] = (u_int)vec8254;
|
||||||
Xintr8254 = (u_int)ivectors[x];
|
Xintr8254 = (u_int)ivectors[x];
|
||||||
@ -1271,9 +1241,11 @@ cpu_initclocks()
|
|||||||
if (isa_apic_pin(8) != 8)
|
if (isa_apic_pin(8) != 8)
|
||||||
panic("APIC RTC != 8");
|
panic("APIC RTC != 8");
|
||||||
#endif /* APIC_IO */
|
#endif /* APIC_IO */
|
||||||
|
|
||||||
register_intr(/* irq */ 8, /* XXX id */ 1, /* flags */ 0,
|
register_intr(/* irq */ 8, /* XXX id */ 1, /* flags */ 0,
|
||||||
/* XXX */ (inthand2_t *)rtcintr, &stat_imask,
|
/* XXX */ (inthand2_t *)rtcintr, &stat_imask,
|
||||||
/* unit */ 0);
|
/* unit */ 0);
|
||||||
|
|
||||||
#ifdef APIC_IO
|
#ifdef APIC_IO
|
||||||
INTREN(APIC_IRQ8);
|
INTREN(APIC_IRQ8);
|
||||||
#else
|
#else
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||||
* $Id: clock.c,v 1.30 1997/07/23 11:28:39 kato Exp $
|
* $Id: clock.c,v 1.31 1997/07/26 13:52:47 kato Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -70,7 +70,6 @@
|
|||||||
#include <machine/ipl.h>
|
#include <machine/ipl.h>
|
||||||
#ifdef APIC_IO
|
#ifdef APIC_IO
|
||||||
#include <machine/smp.h>
|
#include <machine/smp.h>
|
||||||
#include <machine/smptests.h> /** NEW_STRATEGY (,SMP_TIMER_NC) */
|
|
||||||
#endif /* APIC_IO */
|
#endif /* APIC_IO */
|
||||||
|
|
||||||
#include <i386/isa/icu.h>
|
#include <i386/isa/icu.h>
|
||||||
@ -84,6 +83,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <i386/isa/timerreg.h>
|
#include <i386/isa/timerreg.h>
|
||||||
|
|
||||||
|
#include <i386/isa/intr_machdep.h>
|
||||||
|
#include <sys/interrupt.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 32-bit time_t's can't reach leap years before 1904 or after 2036, so we
|
* 32-bit time_t's can't reach leap years before 1904 or after 2036, so we
|
||||||
* can use a simple formula for leap years.
|
* can use a simple formula for leap years.
|
||||||
@ -1163,11 +1165,6 @@ cpu_initclocks()
|
|||||||
/* Finish initializing 8253 timer 0. */
|
/* Finish initializing 8253 timer 0. */
|
||||||
#ifdef APIC_IO
|
#ifdef APIC_IO
|
||||||
|
|
||||||
#ifdef NEW_STRATEGY
|
|
||||||
#ifdef SMP_TIMER_NC
|
|
||||||
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
|
|
||||||
#endif /** XXX SMP_TIMER_NC */
|
|
||||||
|
|
||||||
/* 1st look for ExtInt on pin 0 */
|
/* 1st look for ExtInt on pin 0 */
|
||||||
if (apic_int_type(0, 0) == 3) {
|
if (apic_int_type(0, 0) == 3) {
|
||||||
/*
|
/*
|
||||||
@ -1201,33 +1198,6 @@ cpu_initclocks()
|
|||||||
else
|
else
|
||||||
panic("neither pin 0 or pin 2 works for 8254");
|
panic("neither pin 0 or pin 2 works for 8254");
|
||||||
|
|
||||||
#else /** NEW_STRATEGY */
|
|
||||||
|
|
||||||
/* 8254 is traditionally on ISA IRQ0 */
|
|
||||||
#if defined(SMP_TIMER_NC)
|
|
||||||
x = -1;
|
|
||||||
#else
|
|
||||||
x = isa_apic_pin(0);
|
|
||||||
#endif /** XXX SMP_TIMER_NC */
|
|
||||||
|
|
||||||
if (x < 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /** NEW_STRATEGY */
|
|
||||||
|
|
||||||
/* setup the vectors */
|
/* setup the vectors */
|
||||||
vec[x] = (u_int)vec8254;
|
vec[x] = (u_int)vec8254;
|
||||||
Xintr8254 = (u_int)ivectors[x];
|
Xintr8254 = (u_int)ivectors[x];
|
||||||
@ -1271,9 +1241,11 @@ cpu_initclocks()
|
|||||||
if (isa_apic_pin(8) != 8)
|
if (isa_apic_pin(8) != 8)
|
||||||
panic("APIC RTC != 8");
|
panic("APIC RTC != 8");
|
||||||
#endif /* APIC_IO */
|
#endif /* APIC_IO */
|
||||||
|
|
||||||
register_intr(/* irq */ 8, /* XXX id */ 1, /* flags */ 0,
|
register_intr(/* irq */ 8, /* XXX id */ 1, /* flags */ 0,
|
||||||
/* XXX */ (inthand2_t *)rtcintr, &stat_imask,
|
/* XXX */ (inthand2_t *)rtcintr, &stat_imask,
|
||||||
/* unit */ 0);
|
/* unit */ 0);
|
||||||
|
|
||||||
#ifdef APIC_IO
|
#ifdef APIC_IO
|
||||||
INTREN(APIC_IRQ8);
|
INTREN(APIC_IRQ8);
|
||||||
#else
|
#else
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
* from: @(#)clock.c 7.2 (Berkeley) 5/12/91
|
||||||
* $Id: clock.c,v 1.30 1997/07/23 11:28:39 kato Exp $
|
* $Id: clock.c,v 1.31 1997/07/26 13:52:47 kato Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -70,7 +70,6 @@
|
|||||||
#include <machine/ipl.h>
|
#include <machine/ipl.h>
|
||||||
#ifdef APIC_IO
|
#ifdef APIC_IO
|
||||||
#include <machine/smp.h>
|
#include <machine/smp.h>
|
||||||
#include <machine/smptests.h> /** NEW_STRATEGY (,SMP_TIMER_NC) */
|
|
||||||
#endif /* APIC_IO */
|
#endif /* APIC_IO */
|
||||||
|
|
||||||
#include <i386/isa/icu.h>
|
#include <i386/isa/icu.h>
|
||||||
@ -84,6 +83,9 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <i386/isa/timerreg.h>
|
#include <i386/isa/timerreg.h>
|
||||||
|
|
||||||
|
#include <i386/isa/intr_machdep.h>
|
||||||
|
#include <sys/interrupt.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 32-bit time_t's can't reach leap years before 1904 or after 2036, so we
|
* 32-bit time_t's can't reach leap years before 1904 or after 2036, so we
|
||||||
* can use a simple formula for leap years.
|
* can use a simple formula for leap years.
|
||||||
@ -1163,11 +1165,6 @@ cpu_initclocks()
|
|||||||
/* Finish initializing 8253 timer 0. */
|
/* Finish initializing 8253 timer 0. */
|
||||||
#ifdef APIC_IO
|
#ifdef APIC_IO
|
||||||
|
|
||||||
#ifdef NEW_STRATEGY
|
|
||||||
#ifdef SMP_TIMER_NC
|
|
||||||
#error 'options SMP_TIMER_NC' no longer used, remove & reconfig.
|
|
||||||
#endif /** XXX SMP_TIMER_NC */
|
|
||||||
|
|
||||||
/* 1st look for ExtInt on pin 0 */
|
/* 1st look for ExtInt on pin 0 */
|
||||||
if (apic_int_type(0, 0) == 3) {
|
if (apic_int_type(0, 0) == 3) {
|
||||||
/*
|
/*
|
||||||
@ -1201,33 +1198,6 @@ cpu_initclocks()
|
|||||||
else
|
else
|
||||||
panic("neither pin 0 or pin 2 works for 8254");
|
panic("neither pin 0 or pin 2 works for 8254");
|
||||||
|
|
||||||
#else /** NEW_STRATEGY */
|
|
||||||
|
|
||||||
/* 8254 is traditionally on ISA IRQ0 */
|
|
||||||
#if defined(SMP_TIMER_NC)
|
|
||||||
x = -1;
|
|
||||||
#else
|
|
||||||
x = isa_apic_pin(0);
|
|
||||||
#endif /** XXX SMP_TIMER_NC */
|
|
||||||
|
|
||||||
if (x < 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 */
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /** NEW_STRATEGY */
|
|
||||||
|
|
||||||
/* setup the vectors */
|
/* setup the vectors */
|
||||||
vec[x] = (u_int)vec8254;
|
vec[x] = (u_int)vec8254;
|
||||||
Xintr8254 = (u_int)ivectors[x];
|
Xintr8254 = (u_int)ivectors[x];
|
||||||
@ -1271,9 +1241,11 @@ cpu_initclocks()
|
|||||||
if (isa_apic_pin(8) != 8)
|
if (isa_apic_pin(8) != 8)
|
||||||
panic("APIC RTC != 8");
|
panic("APIC RTC != 8");
|
||||||
#endif /* APIC_IO */
|
#endif /* APIC_IO */
|
||||||
|
|
||||||
register_intr(/* irq */ 8, /* XXX id */ 1, /* flags */ 0,
|
register_intr(/* irq */ 8, /* XXX id */ 1, /* flags */ 0,
|
||||||
/* XXX */ (inthand2_t *)rtcintr, &stat_imask,
|
/* XXX */ (inthand2_t *)rtcintr, &stat_imask,
|
||||||
/* unit */ 0);
|
/* unit */ 0);
|
||||||
|
|
||||||
#ifdef APIC_IO
|
#ifdef APIC_IO
|
||||||
INTREN(APIC_IRQ8);
|
INTREN(APIC_IRQ8);
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user