diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-04-25 19:50:09 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-04-25 19:50:09 +0000 |
commit | 7554e62dcbd942dff3d7045b4e00f441d140f33a (patch) | |
tree | f471e3c57931907a75719227fa658ee926557a7e /sys | |
parent | 0ac852d05adeba5c03d31aa5d8fdbb5fccd56a47 (diff) |
Make ipending per-cpu. Should fix PR 5788.
ok weingart@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/i386/apicvec.s | 10 | ||||
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/i386/i386/vector.s | 4 | ||||
-rw-r--r-- | sys/arch/i386/include/intr.h | 5 | ||||
-rw-r--r-- | sys/arch/i386/isa/icu.s | 14 |
5 files changed, 19 insertions, 20 deletions
diff --git a/sys/arch/i386/i386/apicvec.s b/sys/arch/i386/i386/apicvec.s index c5493f3438f..9980af6d813 100644 --- a/sys/arch/i386/i386/apicvec.s +++ b/sys/arch/i386/i386/apicvec.s @@ -1,4 +1,4 @@ -/* $OpenBSD: apicvec.s,v 1.11 2008/04/18 20:20:35 kettenis Exp $ */ +/* $OpenBSD: apicvec.s,v 1.12 2008/04/25 19:50:07 kettenis Exp $ */ /* $NetBSD: apicvec.s,v 1.1.2.2 2000/02/21 21:54:01 sommerfeld Exp $ */ /*- @@ -169,7 +169,7 @@ XINTR(softclock): MAKE_FRAME pushl CPL movl $IPL_SOFTCLOCK,CPL - andl $~(1<<SIR_CLOCK),_C_LABEL(ipending) + andl $~(1<<SIR_CLOCK),CPUVAR(IPENDING) ioapic_asm_ack() sti #ifdef MULTIPROCESSOR @@ -195,7 +195,7 @@ XINTR(softnet): MAKE_FRAME pushl CPL movl $IPL_SOFTNET,CPL - andl $~(1<<SIR_NET),_C_LABEL(ipending) + andl $~(1<<SIR_NET),CPUVAR(IPENDING) ioapic_asm_ack() sti #ifdef MULTIPROCESSOR @@ -217,7 +217,7 @@ XINTR(softtty): MAKE_FRAME pushl CPL movl $IPL_SOFTTTY,CPL - andl $~(1<<SIR_TTY),_C_LABEL(ipending) + andl $~(1<<SIR_TTY),CPUVAR(IPENDING) ioapic_asm_ack() sti #ifdef MULTIPROCESSOR @@ -236,7 +236,7 @@ XINTR(softast): MAKE_FRAME pushl CPL movl $IPL_SOFTAST,CPL - andl $~(1<<SIR_AST),_C_LABEL(ipending) + andl $~(1<<SIR_AST),CPUVAR(IPENDING) ioapic_asm_ack() sti jmp _C_LABEL(Xdoreti) diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 061b52f936d..d2847594867 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.425 2008/04/20 16:11:13 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.426 2008/04/25 19:50:07 kettenis Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -4228,7 +4228,9 @@ i386_softintunlock(void) void softintr(int sir, int vec) { - __asm __volatile("orl %1, %0" : "=m" (ipending) : "ir" (sir)); + struct cpu_info *ci = curcpu(); + + __asm __volatile("orl %1, %0" : "=m" (ci->ci_ipending) : "ir" (sir)); #ifdef MULTIPROCESSOR i82489_writereg(LAPIC_ICRLO, vec | LAPIC_DLMODE_FIXED | LAPIC_LVL_ASSERT | LAPIC_DEST_SELF); diff --git a/sys/arch/i386/i386/vector.s b/sys/arch/i386/i386/vector.s index 0d49e54b00d..3772352dae1 100644 --- a/sys/arch/i386/i386/vector.s +++ b/sys/arch/i386/i386/vector.s @@ -1,4 +1,4 @@ -/* $OpenBSD: vector.s,v 1.10 2007/04/12 20:22:58 art Exp $ */ +/* $OpenBSD: vector.s,v 1.11 2008/04/25 19:50:08 kettenis Exp $ */ /* $NetBSD: vector.s,v 1.32 1996/01/07 21:29:47 mycroft Exp $ */ /* @@ -150,7 +150,7 @@ IDTVEC(stray_/**/name/**/num) ;\ addl $4,%esp ;\ jmp 6b ;\ IDTVEC(hold_/**/name/**/num) ;\ - orb $IRQ_BIT(num),_C_LABEL(ipending) + IRQ_BYTE(num) ;\ + orb $IRQ_BIT(num),CPUVAR(IPENDING) + IRQ_BYTE(num) ;\ INTRFASTEXIT #if defined(DEBUG) diff --git a/sys/arch/i386/include/intr.h b/sys/arch/i386/include/intr.h index d6b5a187800..5a701e1ca90 100644 --- a/sys/arch/i386/include/intr.h +++ b/sys/arch/i386/include/intr.h @@ -1,4 +1,4 @@ -/* $OpenBSD: intr.h,v 1.33 2007/09/07 08:37:38 art Exp $ */ +/* $OpenBSD: intr.h,v 1.34 2008/04/25 19:50:08 kettenis Exp $ */ /* $NetBSD: intr.h,v 1.5 1996/05/13 06:11:28 mycroft Exp $ */ /* @@ -45,7 +45,6 @@ extern volatile u_int32_t lapic_tpr; /* Current interrupt priority level. */ -extern volatile u_int32_t ipending; /* Interrupts pending. */ extern int imask[]; /* Bitmasks telling what interrupts are blocked. */ extern int iunmask[]; /* Bitmasks telling what interrupts are accepted. */ @@ -99,7 +98,7 @@ void splassert_check(int, const char *); #define _SPLX(ncpl) \ lapic_tpr = ncpl; \ - if (ipending & IUNMASK(ncpl)) \ + if (curcpu()->ci_ipending & IUNMASK(ncpl)) \ Xspllower() /* diff --git a/sys/arch/i386/isa/icu.s b/sys/arch/i386/isa/icu.s index 567695b776e..87c4bdd074a 100644 --- a/sys/arch/i386/isa/icu.s +++ b/sys/arch/i386/isa/icu.s @@ -1,4 +1,4 @@ -/* $OpenBSD: icu.s,v 1.25 2007/05/25 21:27:15 krw Exp $ */ +/* $OpenBSD: icu.s,v 1.26 2008/04/25 19:50:08 kettenis Exp $ */ /* $NetBSD: icu.s,v 1.45 1996/01/07 03:59:34 mycroft Exp $ */ /*- @@ -33,11 +33,9 @@ #include <net/netisr.h> .data - .globl _C_LABEL(imen),_C_LABEL(ipending),_C_LABEL(netisr) + .globl _C_LABEL(imen),_C_LABEL(netisr) _C_LABEL(imen): .long 0xffff # interrupt mask enable (all off) -_C_LABEL(ipending): - .long 0 # interrupts pending _C_LABEL(netisr): .long 0 # scheduling bits for network @@ -60,11 +58,11 @@ IDTVEC(spllower) shrl $4,%eax # find its mask. movl _C_LABEL(iunmask)(,%eax,4),%eax cli - andl _C_LABEL(ipending),%eax # any non-masked bits left? + andl CPUVAR(IPENDING),%eax # any non-masked bits left? jz 2f sti bsfl %eax,%eax - btrl %eax,_C_LABEL(ipending) + btrl %eax,CPUVAR(IPENDING) jnc 1b jmp *_C_LABEL(Xrecurse)(,%eax,4) 2: movl %ebx,CPL @@ -89,11 +87,11 @@ IDTVEC(doreti) shrl $4,%eax movl _C_LABEL(iunmask)(,%eax,4),%eax cli - andl _C_LABEL(ipending),%eax + andl CPUVAR(IPENDING),%eax jz 2f sti bsfl %eax,%eax # slow, but not worth optimizing - btrl %eax,_C_LABEL(ipending) + btrl %eax,CPUVAR(IPENDING) jnc 1b # some intr cleared the in-memory bit cli jmp *_C_LABEL(Xresume)(,%eax,4) |