diff options
author | 2009-08-10 16:40:50 +0000 | |
---|---|---|
committer | 2009-08-10 16:40:50 +0000 | |
commit | ccba0548dce7a5311b46be97527f4d76dd369052 (patch) | |
tree | ae5f3c7b211e7de13cfd1ae99c8b11278e71830a | |
parent | 7 years of (diff) | |
download | wireguard-openbsd-ccba0548dce7a5311b46be97527f4d76dd369052.tar.xz wireguard-openbsd-ccba0548dce7a5311b46be97527f4d76dd369052.zip |
right now, we only increment ci_idepth in struct cpuinfo when
MULTIPROCESSOR is defined. This makes splassert incorrect for IPL_NONE
on such kernels.
Make this more similar to amd64, and move the inc and dec of ci_idepth
into the interrupt vectors, and only leave biglock in the locking
functions.
ok kettenis@
-rw-r--r-- | sys/arch/i386/i386/apicvec.s | 10 | ||||
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/i386/i386/vector.s | 4 |
3 files changed, 13 insertions, 9 deletions
diff --git a/sys/arch/i386/i386/apicvec.s b/sys/arch/i386/i386/apicvec.s index bef5d4a5dd2..f82b97e8888 100644 --- a/sys/arch/i386/i386/apicvec.s +++ b/sys/arch/i386/i386/apicvec.s @@ -1,4 +1,4 @@ -/* $OpenBSD: apicvec.s,v 1.19 2009/07/10 13:51:47 jsg Exp $ */ +/* $OpenBSD: apicvec.s,v 1.20 2009/08/10 16:40:50 oga Exp $ */ /* $NetBSD: apicvec.s,v 1.1.2.2 2000/02/21 21:54:01 sommerfeld Exp $ */ /*- @@ -169,6 +169,7 @@ XINTR(ltimer): movl %eax,CPL ioapic_asm_ack() sti + incl CPUVAR(IDEPTH) #ifdef MULTIPROCESSOR call _C_LABEL(i386_softintlock) #endif @@ -179,6 +180,7 @@ XINTR(ltimer): #ifdef MULTIPROCESSOR call _C_LABEL(i386_softintunlock) #endif + decl CPUVAR(IDEPTH) jmp _C_LABEL(Xdoreti) .globl XINTR(softclock), XINTR(softnet), XINTR(softtty) @@ -192,6 +194,7 @@ XINTR(softclock): andl $~(1<<SIR_CLOCK),CPUVAR(IPENDING) ioapic_asm_ack() sti + incl CPUVAR(IDEPTH) #ifdef MULTIPROCESSOR call _C_LABEL(i386_softintlock) #endif @@ -201,6 +204,7 @@ XINTR(softclock): #ifdef MULTIPROCESSOR call _C_LABEL(i386_softintunlock) #endif + decl CPUVAR(IDEPTH) jmp _C_LABEL(Xdoreti) #define DONETISR(s, c) \ @@ -220,6 +224,7 @@ XINTR(softnet): andl $~(1<<SIR_NET),CPUVAR(IPENDING) ioapic_asm_ack() sti + incl CPUVAR(IDEPTH) #ifdef MULTIPROCESSOR call _C_LABEL(i386_softintlock) #endif @@ -234,6 +239,7 @@ XINTR(softnet): #ifdef MULTIPROCESSOR call _C_LABEL(i386_softintunlock) #endif + decl CPUVAR(IDEPTH) jmp _C_LABEL(Xdoreti) #undef DONETISR @@ -247,6 +253,7 @@ XINTR(softtty): andl $~(1<<SIR_TTY),CPUVAR(IPENDING) ioapic_asm_ack() sti + incl CPUVAR(IDEPTH) #ifdef MULTIPROCESSOR call _C_LABEL(i386_softintlock) #endif @@ -256,6 +263,7 @@ XINTR(softtty): #ifdef MULTIPROCESSOR call _C_LABEL(i386_softintunlock) #endif + decl CPUVAR(IDEPTH) jmp _C_LABEL(Xdoreti) #if NIOAPIC > 0 diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index 70c41cbc614..8a60f6c55c5 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.456 2009/08/09 10:40:17 blambert Exp $ */ +/* $OpenBSD: machdep.c,v 1.457 2009/08/10 16:40:50 oga Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -3689,15 +3689,11 @@ i386_intlock(int ipl) { if (ipl < IPL_SCHED) __mp_lock(&kernel_lock); - - curcpu()->ci_idepth++; } void i386_intunlock(int ipl) { - curcpu()->ci_idepth--; - if (ipl < IPL_SCHED) __mp_unlock(&kernel_lock); } @@ -3706,13 +3702,11 @@ void i386_softintlock(void) { __mp_lock(&kernel_lock); - curcpu()->ci_idepth++; } void i386_softintunlock(void) { - curcpu()->ci_idepth--; __mp_unlock(&kernel_lock); } #endif diff --git a/sys/arch/i386/i386/vector.s b/sys/arch/i386/i386/vector.s index 7af014091c2..60437b77380 100644 --- a/sys/arch/i386/i386/vector.s +++ b/sys/arch/i386/i386/vector.s @@ -1,4 +1,4 @@ -/* $OpenBSD: vector.s,v 1.13 2009/07/10 13:51:47 jsg Exp $ */ +/* $OpenBSD: vector.s,v 1.14 2009/08/10 16:40:50 oga Exp $ */ /* $NetBSD: vector.s,v 1.32 1996/01/07 21:29:47 mycroft Exp $ */ /* @@ -123,6 +123,7 @@ _C_LABEL(Xintr_##name##num): ;\ testl %ebx,%ebx ;\ jz _C_LABEL(Xstray_##name##num) /* no handlers; we're stray */ ;\ STRAY_INITIALIZE /* nobody claimed it yet */ ;\ + incl CPUVAR(IDEPTH) ;\ LOCK_KERNEL(IF_PPL(%esp)) ;\ 7: movl IH_ARG(%ebx),%eax /* get handler arg */ ;\ testl %eax,%eax ;\ @@ -140,6 +141,7 @@ _C_LABEL(Xintr_##name##num): ;\ testl %ebx,%ebx ;\ jnz 7b ;\ UNLOCK_KERNEL(IF_PPL(%esp)) ;\ + decl CPUVAR(IDEPTH) ;\ STRAY_TEST(name,num) /* see if it's a stray */ ;\ 6: unmask(num) /* unmask it in hardware */ ;\ late_ack(num) ;\ |