summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2008-06-01 21:29:49 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2008-06-01 21:29:49 +0000
commit1d80ff81ec40458f379e535c87d66e735c1b537d (patch)
tree3cc184051d3a1aaaf52225583a6f5582e0502838 /sys
parentc6a5d9fd232ecdfba0b6728cdd5b0dec0bca45c1 (diff)
Unlink handled interrupts from the list of pending interrupts atomically.
Fixes a problem where softclock would stop running under heavy load.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/sparc64/locore.s15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s
index 7453ce04feb..7bffb18f63f 100644
--- a/sys/arch/sparc64/sparc64/locore.s
+++ b/sys/arch/sparc64/sparc64/locore.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.s,v 1.141 2008/06/01 12:13:47 kettenis Exp $ */
+/* $OpenBSD: locore.s,v 1.142 2008/06/01 21:29:48 kettenis Exp $ */
/* $NetBSD: locore.s,v 1.137 2001/08/13 06:10:10 jdolecek Exp $ */
/*
@@ -4403,17 +4403,20 @@ sparc_intr_retry:
call _C_LABEL(sparc64_intlock)
add %sp, CC64FSZ+BIAS, %o0 ! tf = %sp + CC64FSZ + BIAS
#endif
-
+
2:
- add %sp, CC64FSZ+BIAS, %o2 ! tf = %sp + CC64FSZ + BIAS
-
ldx [%l2 + IH_PEND], %l7 ! Load next pending
+ add %l2, IH_PEND, %l3
+ clr %l4
+ casxa [%l3] ASI_N, %l7, %l4 ! Unlink from list
+ cmp %l7, %l4
+ bne,pn %xcc, 2b ! Retry?
+ add %sp, CC64FSZ+BIAS, %o2 ! tf = %sp + CC64FSZ + BIAS
+
ldx [%l2 + IH_FUN], %o4 ! ih->ih_fun
ldx [%l2 + IH_ARG], %o0 ! ih->ih_arg
ldx [%l2 + IH_ACK], %l1 ! ih->ih_ack
- stx %g0, [%l2 + IH_PEND] ! Unlink from list
-
! At this point, the current ih could already be added
! back to the pending table.