aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1994-11-01 23:29:50 +0000
committerBruce Evans <bde@FreeBSD.org>1994-11-01 23:29:50 +0000
commitf23c6e08dfc2a3411b55e1b7a6a916bde7c5862d (patch)
tree08fde7bf95cd32cf58322e62a2f25b47b58dbc1f
parent25dd4b72b892963ab4609131d3d2abedea7e9bab (diff)
downloadsrc-f23c6e08dfc2a3411b55e1b7a6a916bde7c5862d.tar.gz
src-f23c6e08dfc2a3411b55e1b7a6a916bde7c5862d.zip
Fix a very old, very stupid race clearing the mask bit for the current
interrupt. Other bits in imen and icu+1 are volatile. INTREN() and INTRDIS() in icu.h need to be changed similarly. Change #include's to 2.0 style.
Notes
Notes: svn path=/head/; revision=4064
-rw-r--r--sys/amd64/isa/vector.S9
-rw-r--r--sys/amd64/isa/vector.s9
-rw-r--r--sys/i386/isa/vector.s9
3 files changed, 15 insertions, 12 deletions
diff --git a/sys/amd64/isa/vector.S b/sys/amd64/isa/vector.S
index 4e5037cb595c..1bc2324f62d9 100644
--- a/sys/amd64/isa/vector.S
+++ b/sys/amd64/isa/vector.S
@@ -1,11 +1,10 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $Id: vector.s,v 1.8 1994/08/18 05:09:36 davidg Exp $
+ * $Id: vector.s,v 1.9 1994/09/20 21:35:49 bde Exp $
*/
-#include "i386/isa/icu.h"
-#include "i386/isa/isa.h"
-#include "vector.h"
+#include <i386/isa/icu.h>
+#include <i386/isa/isa.h>
#define ICU_EOI 0x20 /* XXX - define elsewhere */
@@ -185,11 +184,13 @@ Xresume/**/irq_num: ; \
movl %eax,_cpl ; \
sti ; \
call *_intr_handler + (irq_num) * 4 ; \
+ cli ; /* must unmask _imen and icu atomically */ \
movb _imen + IRQ_BYTE(irq_num),%al ; \
andb $~IRQ_BIT(irq_num),%al ; \
movb %al,_imen + IRQ_BYTE(irq_num) ; \
FASTER_NOP ; \
outb %al,$icu+1 ; \
+ sti ; /* XXX _doreti repeats the cli/sti */ \
MEXITCOUNT ; \
/* We could usually avoid the following jmp by inlining some of */ \
/* _doreti, but it's probably better to use less cache. */ \
diff --git a/sys/amd64/isa/vector.s b/sys/amd64/isa/vector.s
index 4e5037cb595c..1bc2324f62d9 100644
--- a/sys/amd64/isa/vector.s
+++ b/sys/amd64/isa/vector.s
@@ -1,11 +1,10 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $Id: vector.s,v 1.8 1994/08/18 05:09:36 davidg Exp $
+ * $Id: vector.s,v 1.9 1994/09/20 21:35:49 bde Exp $
*/
-#include "i386/isa/icu.h"
-#include "i386/isa/isa.h"
-#include "vector.h"
+#include <i386/isa/icu.h>
+#include <i386/isa/isa.h>
#define ICU_EOI 0x20 /* XXX - define elsewhere */
@@ -185,11 +184,13 @@ Xresume/**/irq_num: ; \
movl %eax,_cpl ; \
sti ; \
call *_intr_handler + (irq_num) * 4 ; \
+ cli ; /* must unmask _imen and icu atomically */ \
movb _imen + IRQ_BYTE(irq_num),%al ; \
andb $~IRQ_BIT(irq_num),%al ; \
movb %al,_imen + IRQ_BYTE(irq_num) ; \
FASTER_NOP ; \
outb %al,$icu+1 ; \
+ sti ; /* XXX _doreti repeats the cli/sti */ \
MEXITCOUNT ; \
/* We could usually avoid the following jmp by inlining some of */ \
/* _doreti, but it's probably better to use less cache. */ \
diff --git a/sys/i386/isa/vector.s b/sys/i386/isa/vector.s
index 4e5037cb595c..1bc2324f62d9 100644
--- a/sys/i386/isa/vector.s
+++ b/sys/i386/isa/vector.s
@@ -1,11 +1,10 @@
/*
* from: vector.s, 386BSD 0.1 unknown origin
- * $Id: vector.s,v 1.8 1994/08/18 05:09:36 davidg Exp $
+ * $Id: vector.s,v 1.9 1994/09/20 21:35:49 bde Exp $
*/
-#include "i386/isa/icu.h"
-#include "i386/isa/isa.h"
-#include "vector.h"
+#include <i386/isa/icu.h>
+#include <i386/isa/isa.h>
#define ICU_EOI 0x20 /* XXX - define elsewhere */
@@ -185,11 +184,13 @@ Xresume/**/irq_num: ; \
movl %eax,_cpl ; \
sti ; \
call *_intr_handler + (irq_num) * 4 ; \
+ cli ; /* must unmask _imen and icu atomically */ \
movb _imen + IRQ_BYTE(irq_num),%al ; \
andb $~IRQ_BIT(irq_num),%al ; \
movb %al,_imen + IRQ_BYTE(irq_num) ; \
FASTER_NOP ; \
outb %al,$icu+1 ; \
+ sti ; /* XXX _doreti repeats the cli/sti */ \
MEXITCOUNT ; \
/* We could usually avoid the following jmp by inlining some of */ \
/* _doreti, but it's probably better to use less cache. */ \