summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa/apic_vector.s
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-05-28 14:08:59 +0000
committerbde <bde@FreeBSD.org>1999-05-28 14:08:59 +0000
commit639d45925192cc9e90ee6a2d2a1d207f2be07e71 (patch)
tree5a485bd9bf242adc519c2591f634416db18a5c8e /sys/i386/isa/apic_vector.s
parent2c39f0fd7d079a2cea7dcf8425e931366294a5fe (diff)
downloadFreeBSD-src-639d45925192cc9e90ee6a2d2a1d207f2be07e71.zip
FreeBSD-src-639d45925192cc9e90ee6a2d2a1d207f2be07e71.tar.gz
Fixed glitches (jumps) of about 1/HZ seconds for the i8254 timecounter.
The old version only worked right when the time was read strictly more often than every 1/HZ seconds, but we only guarantee reading it every (1/HZ + epsilon) seconds. Part of rev.1.126-1.127 attempted to fix this but didn't succeed. Detect counter rollover using the heuristic from the old version of microtime() with additional complications for supporting calls from fast interrupt handlers. This works provided i8254 interrupts are not delayed by more than 1/(2*HZ) seconds. This needs more comments, and cleanups for the SMP case, and more testing of the SMP case before it is merged into RELENG_3. Tested by: jhay
Diffstat (limited to 'sys/i386/isa/apic_vector.s')
-rw-r--r--sys/i386/isa/apic_vector.s59
1 files changed, 32 insertions, 27 deletions
diff --git a/sys/i386/isa/apic_vector.s b/sys/i386/isa/apic_vector.s
index 88340e6..66d53a6 100644
--- a/sys/i386/isa/apic_vector.s
+++ b/sys/i386/isa/apic_vector.s
@@ -1,6 +1,6 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $Id: apic_vector.s,v 1.36 1999/04/14 14:26:35 bde Exp $
+ * $Id: apic_vector.s,v 1.37 1999/04/28 01:04:12 luoqi Exp $
*/
@@ -324,7 +324,7 @@ log_intr_event:
#ifdef CPL_AND_CML
-#define INTR(irq_num, vec_name) \
+#define INTR(irq_num, vec_name, maybe_extra_ipending) \
.text ; \
SUPERALIGN_TEXT ; \
/* _XintrNN: entry point used by IDT/HWIs & splz_unpend via _vec[]. */ \
@@ -336,6 +336,8 @@ IDTVEC(vec_name) ; \
movl $KPSEL, %eax ; \
movl %ax, %fs ; \
; \
+ maybe_extra_ipending ; \
+; \
APIC_ITRACE(apic_itrace_enter, irq_num, APIC_ITRACE_ENTER) ; \
lock ; /* MP-safe */ \
btsl $(irq_num), iactive ; /* lazy masking */ \
@@ -436,7 +438,7 @@ __CONCAT(Xresume,irq_num): ; \
#else /* CPL_AND_CML */
-#define INTR(irq_num, vec_name) \
+#define INTR(irq_num, vec_name, maybe_extra_ipending) \
.text ; \
SUPERALIGN_TEXT ; \
/* _XintrNN: entry point used by IDT/HWIs & splz_unpend via _vec[]. */ \
@@ -448,6 +450,8 @@ IDTVEC(vec_name) ; \
movl $KPSEL, %eax ; \
movl %ax, %fs ; \
; \
+ maybe_extra_ipending ; \
+; \
APIC_ITRACE(apic_itrace_enter, irq_num, APIC_ITRACE_ENTER) ; \
lock ; /* MP-safe */ \
btsl $(irq_num), iactive ; /* lazy masking */ \
@@ -916,30 +920,31 @@ MCOUNT_LABEL(bintr)
FAST_INTR(21,fastintr21)
FAST_INTR(22,fastintr22)
FAST_INTR(23,fastintr23)
- INTR(0,intr0)
- INTR(1,intr1)
- INTR(2,intr2)
- INTR(3,intr3)
- INTR(4,intr4)
- INTR(5,intr5)
- INTR(6,intr6)
- INTR(7,intr7)
- INTR(8,intr8)
- INTR(9,intr9)
- INTR(10,intr10)
- INTR(11,intr11)
- INTR(12,intr12)
- INTR(13,intr13)
- INTR(14,intr14)
- INTR(15,intr15)
- INTR(16,intr16)
- INTR(17,intr17)
- INTR(18,intr18)
- INTR(19,intr19)
- INTR(20,intr20)
- INTR(21,intr21)
- INTR(22,intr22)
- INTR(23,intr23)
+#define CLKINTR_PENDING movl $1,CNAME(clkintr_pending)
+ INTR(0,intr0, CLKINTR_PENDING)
+ INTR(1,intr1,)
+ INTR(2,intr2,)
+ INTR(3,intr3,)
+ INTR(4,intr4,)
+ INTR(5,intr5,)
+ INTR(6,intr6,)
+ INTR(7,intr7,)
+ INTR(8,intr8,)
+ INTR(9,intr9,)
+ INTR(10,intr10,)
+ INTR(11,intr11,)
+ INTR(12,intr12,)
+ INTR(13,intr13,)
+ INTR(14,intr14,)
+ INTR(15,intr15,)
+ INTR(16,intr16,)
+ INTR(17,intr17,)
+ INTR(18,intr18,)
+ INTR(19,intr19,)
+ INTR(20,intr20,)
+ INTR(21,intr21,)
+ INTR(22,intr22,)
+ INTR(23,intr23,)
MCOUNT_LABEL(eintr)
.data
OpenPOWER on IntegriCloud