summaryrefslogtreecommitdiff
path: root/sys/arch/mac68k
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-05-29 18:10:44 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-05-29 18:10:44 +0000
commit2daba14db3ad27d7c4b423645a257e6ef8a252dd (patch)
treeaf0a29b6ad292100004cc51768fa2dcbbe4d122f /sys/arch/mac68k
parent77cec5547fcb2bb4116363eafb5c8e596af921e9 (diff)
Use atomic operations to operate on netisr, instead of clearing it at splhigh.
This changes nothing on legacy architectures, but is a bit faster (and simpler) on the interesting ones.
Diffstat (limited to 'sys/arch/mac68k')
-rw-r--r--sys/arch/mac68k/mac68k/intr.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/sys/arch/mac68k/mac68k/intr.c b/sys/arch/mac68k/mac68k/intr.c
index 1df3f21aa9f..de36a10e4e6 100644
--- a/sys/arch/mac68k/mac68k/intr.c
+++ b/sys/arch/mac68k/mac68k/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.8 2007/05/20 17:22:51 miod Exp $ */
+/* $OpenBSD: intr.c,v 1.9 2007/05/29 18:10:42 miod Exp $ */
/* $NetBSD: intr.c,v 1.2 1998/08/25 04:03:56 scottr Exp $ */
/*-
@@ -51,6 +51,7 @@
#include <net/netisr.h>
+#include <machine/atomic.h>
#include <machine/cpu.h>
#include <machine/intr.h>
@@ -224,21 +225,16 @@ int netisr;
void
netintr()
{
- int s, isr;
+ int isr;
- for (;;) {
- s = splhigh();
- isr = netisr;
- netisr = 0;
- splx(s);
+ while ((isr = netisr) != 0) {
+ atomic_clearbits_int(&netisr, isr);
- if (isr == 0)
- return;
-
-#define DONETISR(bit, fn) do { \
- if (isr & (1 << bit)) \
- (fn)(); \
-} while (0)
+#define DONETISR(bit, fn) \
+ do { \
+ if (isr & (1 << bit)) \
+ (fn)(); \
+ } while (0)
#include <net/netisr_dispatch.h>