summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-12-21 14:56:25 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-12-21 14:56:25 +0000
commitb45bcd941aeed9f9b5bca41338e52b47d57e7e43 (patch)
tree5a85ea83bfba94610d95b7c92196ee879e6dc6b6
parent1a7fe0231942d0e57909a2e6458fbcd0d2a5a8e0 (diff)
Convert netisr to a normal soft interrupt instead of hanving MD code
for it. This makes the netisr a real C function which will help further development. No noticable performance change on i386 and amd64. With input from kettenis@ and miod@ additional OKs mikeb@ and henning@
-rw-r--r--sys/arch/alpha/alpha/interrupt.c53
-rw-r--r--sys/arch/alpha/include/intr.h7
-rw-r--r--sys/arch/amd64/amd64/vector.S21
-rw-r--r--sys/arch/amd64/include/intr.h7
-rw-r--r--sys/arch/arm/arm/softintr.c37
-rw-r--r--sys/arch/arm/include/softintr.h7
-rw-r--r--sys/arch/hppa/hppa/intr.c21
-rw-r--r--sys/arch/hppa/hppa/locore.S9
-rw-r--r--sys/arch/hppa/hppa/trap.c4
-rw-r--r--sys/arch/hppa/include/intr.h3
-rw-r--r--sys/arch/hppa64/hppa64/locore.S6
-rw-r--r--sys/arch/hppa64/hppa64/trap.c4
-rw-r--r--sys/arch/hppa64/include/cpu.h5
-rw-r--r--sys/arch/i386/i386/apicvec.s14
-rw-r--r--sys/arch/i386/include/intr.h5
-rw-r--r--sys/arch/i386/isa/icu.s20
-rw-r--r--sys/arch/loongson/include/intr.h7
-rw-r--r--sys/arch/luna88k/luna88k/isr.c4
-rw-r--r--sys/arch/m68k/include/intr.h7
-rw-r--r--sys/arch/m68k/m68k/softintr.c32
-rw-r--r--sys/arch/m88k/include/intr.h7
-rw-r--r--sys/arch/m88k/m88k/softintr.c31
-rw-r--r--sys/arch/mips64/mips64/softintr.c30
-rw-r--r--sys/arch/mvmeppc/mvmeppc/machdep.c20
-rw-r--r--sys/arch/powerpc/include/intr.h7
-rw-r--r--sys/arch/powerpc/powerpc/softintr.c30
-rw-r--r--sys/arch/sgi/include/intr.h7
-rw-r--r--sys/arch/sh/include/intr.h7
-rw-r--r--sys/arch/sh/sh/interrupt.c35
-rw-r--r--sys/arch/sparc/include/intr.h6
-rw-r--r--sys/arch/sparc/sparc/intr.c45
-rw-r--r--sys/arch/sparc64/include/cpu.h4
-rw-r--r--sys/arch/sparc64/sparc64/intr.c36
-rw-r--r--sys/arch/vax/include/intr.h7
-rw-r--r--sys/arch/vax/vax/locore.S8
-rw-r--r--sys/arch/vax/vax/machdep.c3
-rw-r--r--sys/arch/vax/vax/softintr.c24
-rw-r--r--sys/conf/files3
-rw-r--r--sys/kern/init_main.c4
-rw-r--r--sys/net/netisr.c97
-rw-r--r--sys/net/netisr.h14
-rw-r--r--sys/net/netisr_dispatch.h71
42 files changed, 149 insertions, 620 deletions
diff --git a/sys/arch/alpha/alpha/interrupt.c b/sys/arch/alpha/alpha/interrupt.c
index 952498d253e..3390277aba1 100644
--- a/sys/arch/alpha/alpha/interrupt.c
+++ b/sys/arch/alpha/alpha/interrupt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interrupt.c,v 1.29 2009/04/19 19:13:57 oga Exp $ */
+/* $OpenBSD: interrupt.c,v 1.30 2010/12/21 14:56:23 claudio Exp $ */
/* $NetBSD: interrupt.c,v 1.46 2000/06/03 20:47:36 thorpej Exp $ */
/*-
@@ -88,26 +88,6 @@
#include <sys/device.h>
#endif
-#include <net/netisr.h>
-#include <net/if.h>
-
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-#include <netinet/ip_var.h>
-#endif
-
-#ifdef INET6
-#ifndef INET
-#include <netinet/in.h>
-#endif
-#include <netinet/ip6.h>
-#include <netinet6/ip6_var.h>
-#endif
-
-#include "ppp.h"
-#include "bridge.h"
-
#include "apecs.h"
#include "cia.h"
#include "lca.h"
@@ -119,8 +99,6 @@ extern struct evcount clk_count;
struct scbvec scb_iovectab[SCB_VECTOIDX(SCB_SIZE - SCB_IOVECBASE)];
-void netintr(void);
-
void scb_stray(void *, u_long);
void
@@ -480,33 +458,8 @@ badaddr_read(void *addr, size_t size, void *rptr)
#endif /* NAPECS > 0 || NCIA > 0 || NLCA > 0 || NTCASIC > 0 */
-int netisr;
-
-void
-netintr()
-{
- int n;
-
- while ((n = netisr) != 0) {
- atomic_clearbits_int(&netisr, n);
-
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << (bit))) \
- fn(); \
- } while (0)
-
-#include <net/netisr_dispatch.h>
-
-#undef DONETISR
- }
-}
-
struct alpha_soft_intr alpha_soft_intrs[SI_NSOFT];
-/* XXX For legacy software interrupts. */
-struct alpha_soft_intrhand *softnet_intrhand;
-
/*
* softintr_init:
*
@@ -524,10 +477,6 @@ softintr_init()
mtx_init(&asi->softintr_mtx, IPL_HIGH);
asi->softintr_siq = i;
}
-
- /* XXX Establish legacy software interrupt handlers. */
- softnet_intrhand = softintr_establish(IPL_SOFTNET,
- (void (*)(void *))netintr, NULL);
}
/*
diff --git a/sys/arch/alpha/include/intr.h b/sys/arch/alpha/include/intr.h
index 3844cc24272..b65f63f05ac 100644
--- a/sys/arch/alpha/include/intr.h
+++ b/sys/arch/alpha/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.36 2010/05/31 21:39:55 deraadt Exp $ */
+/* $OpenBSD: intr.h,v 1.37 2010/12/21 14:56:23 claudio Exp $ */
/* $NetBSD: intr.h,v 1.26 2000/06/03 20:47:41 thorpej Exp $ */
/*-
@@ -264,11 +264,6 @@ void *softintr_establish(int, void (*)(void *), void *);
void softintr_init(void);
void softintr_schedule(void *);
-/* XXX For legacy software interrupts. */
-extern struct alpha_soft_intrhand *softnet_intrhand;
-
-#define setsoftnet() softintr_schedule(softnet_intrhand)
-
struct alpha_shared_intr *alpha_shared_intr_alloc(unsigned int);
int alpha_shared_intr_dispatch(struct alpha_shared_intr *,
unsigned int);
diff --git a/sys/arch/amd64/amd64/vector.S b/sys/arch/amd64/amd64/vector.S
index be7ebb39deb..e21d832aa88 100644
--- a/sys/arch/amd64/amd64/vector.S
+++ b/sys/arch/amd64/amd64/vector.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: vector.S,v 1.26 2010/09/28 03:53:14 guenther Exp $ */
+/* $OpenBSD: vector.S,v 1.27 2010/12/21 14:56:23 claudio Exp $ */
/* $NetBSD: vector.S,v 1.5 2004/06/28 09:13:11 fvdl Exp $ */
/*
@@ -78,8 +78,6 @@
#include <machine/intr.h>
#include <machine/psl.h>
-#include <net/netisr.h>
-
#include "ioapic.h"
#include "lapic.h"
#include "assym.h"
@@ -801,10 +799,6 @@ _C_LABEL(ioapic_level_stubs):
/*
* Soft interrupt handlers
*/
- .globl _C_LABEL(netisr)
-_C_LABEL(netisr):
- .word 0
-
.text
IDTVEC(softtty)
movl $IPL_SOFTTTY, CPUVAR(ILEVEL)
@@ -830,19 +824,6 @@ IDTVEC(softnet)
call _C_LABEL(x86_softintlock)
#endif
movq CPUVAR(ISOURCES) + SIR_NET * 8, %r12
-
- xorq %r12,%r12
- xchgl _C_LABEL(netisr),%r12d
-
- /* XXX Do the legacy netisrs here for now. */
-#define DONETISR(s, c) \
- .globl _C_LABEL(c) ;\
- testl $(1 << s),%r12d ;\
- jz 1f ;\
- call _C_LABEL(c) ;\
-1:
-#include <net/netisr_dispatch.h>
-
movl $X86_SOFTINTR_SOFTNET,%edi
call _C_LABEL(softintr_dispatch)
#ifdef MULTIPROCESSOR
diff --git a/sys/arch/amd64/include/intr.h b/sys/arch/amd64/include/intr.h
index 81e1bcdc753..8fcb027363b 100644
--- a/sys/arch/amd64/include/intr.h
+++ b/sys/arch/amd64/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.19 2010/05/31 21:39:56 deraadt Exp $ */
+/* $OpenBSD: intr.h,v 1.20 2010/12/21 14:56:23 claudio Exp $ */
/* $NetBSD: intr.h,v 1.2 2003/05/04 22:01:56 fvdl Exp $ */
/*-
@@ -172,11 +172,6 @@ void splassert_check(int, const char *);
#define splsoftassert(wantipl) do { /* nada */ } while (0)
#endif
-/*
- * XXX
- */
-#define setsoftnet() softintr(SIR_NET)
-
#define IPLSHIFT 4 /* The upper nibble of vectors is the IPL. */
#define IPL(level) ((level) >> IPLSHIFT) /* Extract the IPL. */
diff --git a/sys/arch/arm/arm/softintr.c b/sys/arch/arm/arm/softintr.c
index b7d8202e30d..b7b003687e6 100644
--- a/sys/arch/arm/arm/softintr.c
+++ b/sys/arch/arm/arm/softintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softintr.c,v 1.6 2009/04/19 18:54:06 oga Exp $ */
+/* $OpenBSD: softintr.c,v 1.7 2010/12/21 14:56:23 claudio Exp $ */
/* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */
/*
@@ -39,9 +39,6 @@
#include <sys/param.h>
#include <sys/malloc.h>
-/* XXX Network interrupts should be converted to new softintrs. */
-#include <net/netisr.h>
-
#include <uvm/uvm_extern.h>
#include <machine/atomic.h>
@@ -49,10 +46,6 @@
struct soft_intrq soft_intrq[SI_NQUEUES];
-struct soft_intrhand *softnet_intrhand;
-
-void netintr(void);
-
/*
* softintr_init:
*
@@ -70,12 +63,6 @@ softintr_init(void)
mtx_init(&siq->siq_mtx, IPL_HIGH);
siq->siq_si = i;
}
-
- /* XXX Establish legacy software interrupt handlers. */
- softnet_intrhand = softintr_establish(IPL_SOFTNET,
- (void (*)(void *))netintr, NULL);
-
- assert(softnet_intrhand != NULL);
}
/*
@@ -172,25 +159,3 @@ softintr_disestablish(void *arg)
free(sih, M_DEVBUF);
}
-
-int netisr;
-
-void
-netintr(void)
-{
- int n;
-
- while ((n = netisr) != 0) {
- atomic_clearbits_int(&netisr, n);
-
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << (bit))) \
- fn(); \
- } while (/*CONSTCOND*/0)
-
-#include <net/netisr_dispatch.h>
-
-#undef DONETISR
- }
-}
diff --git a/sys/arch/arm/include/softintr.h b/sys/arch/arm/include/softintr.h
index 8d3feb39fba..913c632a69d 100644
--- a/sys/arch/arm/include/softintr.h
+++ b/sys/arch/arm/include/softintr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: softintr.h,v 1.4 2009/04/19 18:54:06 oga Exp $ */
+/* $OpenBSD: softintr.h,v 1.5 2010/12/21 14:56:23 claudio Exp $ */
/* $NetBSD: softintr.h,v 1.1 2002/01/29 22:54:14 thorpej Exp $ */
/*
@@ -91,11 +91,6 @@ do { \
mtx_leave(&__siq->siq_mtx); \
} while (/*CONSTCOND*/0)
-/* XXX For legacy software interrupts. */
-extern struct soft_intrhand *softnet_intrhand;
-
-#define setsoftnet() softintr_schedule(softnet_intrhand)
-
#endif /* _KERNEL */
#endif /* _ARM_SOFTINTR_H_ */
diff --git a/sys/arch/hppa/hppa/intr.c b/sys/arch/hppa/hppa/intr.c
index e6ff9249093..292f2467835 100644
--- a/sys/arch/hppa/hppa/intr.c
+++ b/sys/arch/hppa/hppa/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.35 2010/09/20 06:33:47 matthew Exp $ */
+/* $OpenBSD: intr.c,v 1.36 2010/12/21 14:56:23 claudio Exp $ */
/*
* Copyright (c) 2002-2004 Michael Shalayeff
@@ -33,17 +33,12 @@
#include <sys/evcount.h>
#include <sys/malloc.h>
-#include <net/netisr.h>
-
#include <uvm/uvm_extern.h> /* for uvmexp */
#include <machine/autoconf.h>
#include <machine/frame.h>
#include <machine/reg.h>
-void softnet(void);
-void softtty(void);
-
struct hppa_iv {
char pri;
char irq;
@@ -64,7 +59,7 @@ struct hppa_iv intr_store[8*2*CPU_NINTS] __attribute__ ((aligned(32))),
*intr_more = intr_store, *intr_list;
struct hppa_iv intr_table[CPU_NINTS] __attribute__ ((aligned(32))) = {
{ IPL_SOFTCLOCK, 0, HPPA_IV_SOFT, 0, 0, NULL },
- { IPL_SOFTNET , 0, HPPA_IV_SOFT, 0, 0, (int (*)(void *))&softnet },
+ { IPL_SOFTNET , 0, HPPA_IV_SOFT, 0, 0, NULL },
{ 0 },
{ 0 },
{ IPL_SOFTTTY , 0, HPPA_IV_SOFT, 0, 0, NULL }
@@ -90,18 +85,6 @@ splassert_check(int wantipl, const char *func)
#endif
void
-softnet(void)
-{
- int ni;
-
- /* use atomic "load & clear" */
- __asm __volatile(
- "ldcws 0(%2), %0": "=&r" (ni), "+m" (netisr): "r" (&netisr));
-#define DONETISR(m,c) if (ni & (1 << (m))) c()
-#include <net/netisr_dispatch.h>
-}
-
-void
cpu_intr_init(void)
{
struct cpu_info *ci = curcpu();
diff --git a/sys/arch/hppa/hppa/locore.S b/sys/arch/hppa/hppa/locore.S
index 4613c382498..a76b179973d 100644
--- a/sys/arch/hppa/hppa/locore.S
+++ b/sys/arch/hppa/hppa/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.181 2010/12/10 09:13:02 kettenis Exp $ */
+/* $OpenBSD: locore.S,v 1.182 2010/12/21 14:56:23 claudio Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -102,13 +102,6 @@
.data
- .export netisr, data
- .align 16
-netisr
- .word 0
- .size netisr, .-netisr
- .align 16
-
BSS(pdc_stack, 4) /* temp stack for PDC call */
BSS(emrg_stack, 4) /* stack for HPMC/TOC/PWRF */
diff --git a/sys/arch/hppa/hppa/trap.c b/sys/arch/hppa/hppa/trap.c
index afacb556abd..dc503021337 100644
--- a/sys/arch/hppa/hppa/trap.c
+++ b/sys/arch/hppa/hppa/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.111 2010/11/27 19:57:23 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.112 2010/12/21 14:56:23 claudio Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -36,8 +36,6 @@
#include <sys/signalvar.h>
#include <sys/user.h>
-#include <net/netisr.h>
-
#include "systrace.h"
#include <dev/systrace.h>
diff --git a/sys/arch/hppa/include/intr.h b/sys/arch/hppa/include/intr.h
index 692044d6d98..8bb543c0ad1 100644
--- a/sys/arch/hppa/include/intr.h
+++ b/sys/arch/hppa/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.34 2010/07/02 00:00:45 jsing Exp $ */
+/* $OpenBSD: intr.h,v 1.35 2010/12/21 14:56:23 claudio Exp $ */
/*
* Copyright (c) 2002-2004 Michael Shalayeff
@@ -156,7 +156,6 @@ int hppa_ipi_send(struct cpu_info *, u_long);
#endif
#define setsoftast(p) (p->p_md.md_astpending = 1)
-#define setsoftnet() softintr(1 << (IPL_SOFTNET - 1))
void *softintr_establish(int, void (*)(void *), void *);
void softintr_disestablish(void *);
diff --git a/sys/arch/hppa64/hppa64/locore.S b/sys/arch/hppa64/hppa64/locore.S
index 316720017db..39b7d679eb6 100644
--- a/sys/arch/hppa64/hppa64/locore.S
+++ b/sys/arch/hppa64/hppa64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.10 2010/08/18 21:01:14 jasper Exp $ */
+/* $OpenBSD: locore.S,v 1.11 2010/12/21 14:56:23 claudio Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -44,10 +44,6 @@
.data
- .export netisr, data
- .align 16
-netisr
- .word 0
.align 16
$kpsl
.word PSL_W | PSL_Q | PSL_P | PSL_C | PSL_D | PSL_S | PSL_O
diff --git a/sys/arch/hppa64/hppa64/trap.c b/sys/arch/hppa64/hppa64/trap.c
index c39dc52feff..02cdc09cc05 100644
--- a/sys/arch/hppa64/hppa64/trap.c
+++ b/sys/arch/hppa64/hppa64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.11 2010/11/27 19:57:23 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.12 2010/12/21 14:56:23 claudio Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -27,8 +27,6 @@
#include <sys/signalvar.h>
#include <sys/user.h>
-#include <net/netisr.h>
-
#include "systrace.h"
#include <dev/systrace.h>
diff --git a/sys/arch/hppa64/include/cpu.h b/sys/arch/hppa64/include/cpu.h
index 41da51b3fdf..88b5d46be49 100644
--- a/sys/arch/hppa64/include/cpu.h
+++ b/sys/arch/hppa64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.18 2010/09/28 20:27:54 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.19 2010/12/21 14:56:23 claudio Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -110,9 +110,6 @@
#define splx(c) spllower(c)
#define setsoftast() (astpending = 1)
-#define setsoftclock() /* TODO */
-#define setsoftnet() /* TODO */
-#define setsofttty() /* TODO */
#ifndef _LOCORE
#include <sys/time.h>
diff --git a/sys/arch/i386/i386/apicvec.s b/sys/arch/i386/i386/apicvec.s
index 8be396dbad4..8e30149aff3 100644
--- a/sys/arch/i386/i386/apicvec.s
+++ b/sys/arch/i386/i386/apicvec.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: apicvec.s,v 1.21 2010/01/11 23:09:52 kettenis Exp $ */
+/* $OpenBSD: apicvec.s,v 1.22 2010/12/21 14:56:23 claudio Exp $ */
/* $NetBSD: apicvec.s,v 1.1.2.2 2000/02/21 21:54:01 sommerfeld Exp $ */
/*-
@@ -207,13 +207,6 @@ XINTR(softclock):
decl CPUVAR(IDEPTH)
jmp _C_LABEL(Xdoreti)
-#define DONETISR(s, c) \
- .globl _C_LABEL(c) ;\
- testl $(1 << s),%edi ;\
- jz 1f ;\
- call _C_LABEL(c) ;\
-1:
-
XINTR(softnet):
pushl $0
pushl $T_ASTFLT
@@ -228,11 +221,6 @@ XINTR(softnet):
#ifdef MULTIPROCESSOR
call _C_LABEL(i386_softintlock)
#endif
- xorl %edi,%edi
- xchgl _C_LABEL(netisr),%edi
-
-#include <net/netisr_dispatch.h>
-
pushl $I386_SOFTINTR_SOFTNET
call _C_LABEL(softintr_dispatch)
addl $4,%esp
diff --git a/sys/arch/i386/include/intr.h b/sys/arch/i386/include/intr.h
index bfba600f8de..25af9b82e12 100644
--- a/sys/arch/i386/include/intr.h
+++ b/sys/arch/i386/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.39 2009/08/13 13:24:48 kettenis Exp $ */
+/* $OpenBSD: intr.h,v 1.40 2010/12/21 14:56:23 claudio Exp $ */
/* $NetBSD: intr.h,v 1.5 1996/05/13 06:11:28 mycroft Exp $ */
/*
@@ -126,9 +126,6 @@ void splassert_check(int, const char *);
#define spllock() splhigh()
#define spl0() spllower(IPL_NONE)
-#define setsoftnet() softintr(SIR_NET)
-#define setsofttty() softintr(SIR_TTY)
-
#include <machine/pic.h>
struct cpu_info;
diff --git a/sys/arch/i386/isa/icu.s b/sys/arch/i386/isa/icu.s
index 42ab42a2370..2d83f61843a 100644
--- a/sys/arch/i386/isa/icu.s
+++ b/sys/arch/i386/isa/icu.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: icu.s,v 1.30 2010/05/09 12:03:16 kettenis Exp $ */
+/* $OpenBSD: icu.s,v 1.31 2010/12/21 14:56:23 claudio Exp $ */
/* $NetBSD: icu.s,v 1.45 1996/01/07 03:59:34 mycroft Exp $ */
/*-
@@ -30,14 +30,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <net/netisr.h>
-
.data
- .globl _C_LABEL(imen),_C_LABEL(netisr)
+ .globl _C_LABEL(imen)
_C_LABEL(imen):
.long 0xffff # interrupt mask enable (all off)
-_C_LABEL(netisr):
- .long 0 # scheduling bits for network
.text
/*
@@ -136,13 +132,6 @@ IDTVEC(softtty)
#endif
jmp *%esi
-#define DONETISR(s, c) \
- .globl _C_LABEL(c) ;\
- testl $(1 << s),%edi ;\
- jz 1f ;\
- call _C_LABEL(c) ;\
-1:
-
IDTVEC(softnet)
movl $IPL_SOFTNET,%eax
movl %eax,CPL
@@ -150,11 +139,6 @@ IDTVEC(softnet)
#ifdef MULTIPROCESSOR
call _C_LABEL(i386_softintlock)
#endif
- xorl %edi,%edi
- xchgl _C_LABEL(netisr),%edi
-
-#include <net/netisr_dispatch.h>
-
pushl $I386_SOFTINTR_SOFTNET
call _C_LABEL(softintr_dispatch)
addl $4,%esp
diff --git a/sys/arch/loongson/include/intr.h b/sys/arch/loongson/include/intr.h
index 31b07c61af7..95bed3bdd7a 100644
--- a/sys/arch/loongson/include/intr.h
+++ b/sys/arch/loongson/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.2 2010/04/23 03:50:22 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.3 2010/12/21 14:56:24 claudio Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -106,11 +106,6 @@ void *softintr_establish(int, void (*)(void *), void *);
void softintr_init(void);
void softintr_schedule(void *);
-/* XXX For legacy software interrupts. */
-extern struct soft_intrhand *softnet_intrhand;
-
-#define setsoftnet() softintr_schedule(softnet_intrhand)
-
#define splsoft() splraise(IPL_SOFTINT)
#define splbio() splraise(IPL_BIO)
#define splnet() splraise(IPL_NET)
diff --git a/sys/arch/luna88k/luna88k/isr.c b/sys/arch/luna88k/luna88k/isr.c
index afc031d44e4..3e9fbaf9d57 100644
--- a/sys/arch/luna88k/luna88k/isr.c
+++ b/sys/arch/luna88k/luna88k/isr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isr.c,v 1.8 2010/09/20 06:33:47 matthew Exp $ */
+/* $OpenBSD: isr.c,v 1.9 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: isr.c,v 1.5 2000/07/09 08:08:20 nisimura Exp $ */
/*-
@@ -42,8 +42,6 @@
#include <uvm/uvm_extern.h>
-#include <net/netisr.h>
-
#include <machine/cpu.h>
#include <luna88k/luna88k/isr.h>
diff --git a/sys/arch/m68k/include/intr.h b/sys/arch/m68k/include/intr.h
index 02846b8d158..b8258f4a270 100644
--- a/sys/arch/m68k/include/intr.h
+++ b/sys/arch/m68k/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.1 2009/03/15 20:40:25 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.2 2010/12/21 14:56:24 claudio Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
* All rights reserved.
@@ -101,11 +101,6 @@ void softintr_schedule(void *);
extern int softpending;
-/* XXX For legacy software interrupts. */
-extern struct soft_intrhand *softnet_intrhand;
-
-#define setsoftnet() softintr_schedule(softnet_intrhand)
-
#endif /* _LOCORE */
#endif /* _KERNEL */
diff --git a/sys/arch/m68k/m68k/softintr.c b/sys/arch/m68k/m68k/softintr.c
index 35f0237335f..2aad54ef56a 100644
--- a/sys/arch/m68k/m68k/softintr.c
+++ b/sys/arch/m68k/m68k/softintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softintr.c,v 1.1 2009/03/15 20:40:25 miod Exp $ */
+/* $OpenBSD: softintr.c,v 1.2 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */
/*
@@ -39,9 +39,6 @@
#include <sys/param.h>
#include <sys/malloc.h>
-/* XXX Network interrupts should be converted to new softintrs. */
-#include <net/netisr.h>
-
#include <uvm/uvm_extern.h>
#include <machine/atomic.h>
@@ -49,10 +46,6 @@
struct soft_intrq soft_intrq[SI_NQUEUES];
-struct soft_intrhand *softnet_intrhand;
-
-void netintr(void);
-
/*
* Initialize the software interrupt system.
*/
@@ -68,10 +61,6 @@ softintr_init(void)
siq->siq_si = i;
mtx_init(&siq->siq_mtx, IPL_HIGH);
}
-
- /* XXX Establish legacy software interrupt handlers. */
- softnet_intrhand = softintr_establish(IPL_SOFTNET,
- (void (*)(void *))netintr, NULL);
}
/*
@@ -177,22 +166,3 @@ softintr_schedule(void *arg)
}
mtx_leave(&siq->siq_mtx);
}
-
-int netisr;
-
-void
-netintr(void)
-{
- int n;
-
- while ((n = netisr) != 0) {
- atomic_clearbits_int(&netisr, n);
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << (bit))) \
- fn(); \
- } while (0)
-#include <net/netisr_dispatch.h>
-#undef DONETISR
- }
-}
diff --git a/sys/arch/m88k/include/intr.h b/sys/arch/m88k/include/intr.h
index 27839399923..9b1b9c0c5a1 100644
--- a/sys/arch/m88k/include/intr.h
+++ b/sys/arch/m88k/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.11 2009/03/15 20:39:53 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.12 2010/12/21 14:56:24 claudio Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
* All rights reserved.
@@ -150,11 +150,6 @@ void softintr_schedule(void *);
extern int softpending;
-/* XXX For legacy software interrupts. */
-extern struct soft_intrhand *softnet_intrhand;
-
-#define setsoftnet() softintr_schedule(softnet_intrhand)
-
#endif /* _LOCORE */
#endif /* _KERNEL */
diff --git a/sys/arch/m88k/m88k/softintr.c b/sys/arch/m88k/m88k/softintr.c
index 1b96a35ab07..2aad54ef56a 100644
--- a/sys/arch/m88k/m88k/softintr.c
+++ b/sys/arch/m88k/m88k/softintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softintr.c,v 1.1 2009/03/15 20:39:53 miod Exp $ */
+/* $OpenBSD: softintr.c,v 1.2 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */
/*
@@ -39,9 +39,6 @@
#include <sys/param.h>
#include <sys/malloc.h>
-/* XXX Network interrupts should be converted to new softintrs. */
-#include <net/netisr.h>
-
#include <uvm/uvm_extern.h>
#include <machine/atomic.h>
@@ -49,10 +46,6 @@
struct soft_intrq soft_intrq[SI_NQUEUES];
-struct soft_intrhand *softnet_intrhand;
-
-void netintr(void);
-
/*
* Initialize the software interrupt system.
*/
@@ -68,10 +61,6 @@ softintr_init(void)
siq->siq_si = i;
mtx_init(&siq->siq_mtx, IPL_HIGH);
}
-
- /* XXX Establish legacy software interrupt handlers. */
- softnet_intrhand = softintr_establish(IPL_SOFTNET,
- (void (*)(void *))netintr, NULL);
}
/*
@@ -177,21 +166,3 @@ softintr_schedule(void *arg)
}
mtx_leave(&siq->siq_mtx);
}
-
-int netisr;
-
-void
-netintr(void)
-{
- int n;
-
- while ((n = atomic_clear_int(&netisr)) != 0) {
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << (bit))) \
- fn(); \
- } while (0)
-#include <net/netisr_dispatch.h>
-#undef DONETISR
- }
-}
diff --git a/sys/arch/mips64/mips64/softintr.c b/sys/arch/mips64/mips64/softintr.c
index 0ad480f8b0d..8ed66087834 100644
--- a/sys/arch/mips64/mips64/softintr.c
+++ b/sys/arch/mips64/mips64/softintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softintr.c,v 1.11 2010/01/18 17:00:28 miod Exp $ */
+/* $OpenBSD: softintr.c,v 1.12 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */
/*
@@ -39,9 +39,6 @@
#include <sys/param.h>
#include <sys/malloc.h>
-/* XXX Network interrupts should be converted to new softintrs. */
-#include <net/netisr.h>
-
#include <uvm/uvm_extern.h>
#include <machine/atomic.h>
@@ -49,8 +46,6 @@
struct soft_intrq soft_intrq[SI_NQUEUES];
-struct soft_intrhand *softnet_intrhand;
-
void netintr(void);
/*
@@ -68,10 +63,6 @@ softintr_init(void)
siq->siq_si = i;
mtx_init(&siq->siq_mtx, IPL_HIGH);
}
-
- /* XXX Establish legacy software interrupt handlers. */
- softnet_intrhand = softintr_establish(IPL_SOFTNET,
- (void (*)(void *))netintr, NULL);
}
/*
@@ -180,25 +171,6 @@ softintr_schedule(void *arg)
mtx_leave(&siq->siq_mtx);
}
-int netisr;
-
-void
-netintr(void)
-{
- int n;
-
- while ((n = netisr) != 0) {
- atomic_clearbits_int(&netisr, n);
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << (bit))) \
- fn(); \
- } while (0)
-#include <net/netisr_dispatch.h>
-#undef DONETISR
- }
-}
-
void
dosoftint()
{
diff --git a/sys/arch/mvmeppc/mvmeppc/machdep.c b/sys/arch/mvmeppc/mvmeppc/machdep.c
index e06fc506035..83841797a7c 100644
--- a/sys/arch/mvmeppc/mvmeppc/machdep.c
+++ b/sys/arch/mvmeppc/mvmeppc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.63 2009/08/22 02:54:50 mk Exp $ */
+/* $OpenBSD: machdep.c,v 1.64 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: machdep.c,v 1.4 1996/10/16 19:33:11 ws Exp $ */
/*
@@ -49,8 +49,6 @@
#include <sys/systm.h>
#include <sys/user.h>
-#include <net/netisr.h>
-
#include <machine/bat.h>
#include <machine/bugio.h>
#include <machine/pmap.h>
@@ -594,22 +592,6 @@ dumpsys()
volatile int cpl, ipending, astpending;
int imask[IPL_NUM];
-int netisr;
-
-/*
- * Soft networking interrupts.
- */
-void
-softnet(isr)
- int isr;
-{
-#define DONETISR(flag, func) \
- if (isr & (1 << (flag))) \
- (func)();
-
-#include <net/netisr_dispatch.h>
-#undef DONETISR
-}
int
lcsplx(ipl)
diff --git a/sys/arch/powerpc/include/intr.h b/sys/arch/powerpc/include/intr.h
index 6cbf762efba..955605df495 100644
--- a/sys/arch/powerpc/include/intr.h
+++ b/sys/arch/powerpc/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.44 2010/04/23 03:50:22 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.45 2010/12/21 14:56:24 claudio Exp $ */
/*
* Copyright (c) 1997 Per Fogelstrom, Opsycon AB and RTMX Inc, USA.
@@ -115,11 +115,6 @@ void *softintr_establish(int, void (*)(void *), void *);
void softintr_init(void);
void softintr_schedule(void *);
-/* XXX For legacy software interrupts. */
-extern struct soft_intrhand *softnet_intrhand;
-
-#define setsoftnet() softintr_schedule(softnet_intrhand)
-
#define SINT_CLOCK SINTMASK(SI_SOFTCLOCK)
#define SINT_NET SINTMASK(SI_SOFTNET)
#define SINT_TTY SINTMASK(SI_SOFTTTY)
diff --git a/sys/arch/powerpc/powerpc/softintr.c b/sys/arch/powerpc/powerpc/softintr.c
index 230ab75681f..3c476466524 100644
--- a/sys/arch/powerpc/powerpc/softintr.c
+++ b/sys/arch/powerpc/powerpc/softintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softintr.c,v 1.2 2009/11/08 21:05:18 kettenis Exp $ */
+/* $OpenBSD: softintr.c,v 1.3 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */
/*
@@ -39,9 +39,6 @@
#include <sys/param.h>
#include <sys/malloc.h>
-/* XXX Network interrupts should be converted to new softintrs. */
-#include <net/netisr.h>
-
#include <uvm/uvm_extern.h>
#include <machine/atomic.h>
@@ -51,8 +48,6 @@ struct soft_intrq soft_intrq[SI_NQUEUES];
struct soft_intrhand *softnet_intrhand;
-void netintr(void);
-
/*
* Initialize the software interrupt system.
*/
@@ -68,10 +63,6 @@ softintr_init(void)
siq->siq_si = i;
mtx_init(&siq->siq_mtx, IPL_HIGH);
}
-
- /* XXX Establish legacy software interrupt handlers. */
- softnet_intrhand = softintr_establish(IPL_SOFTNET,
- (void (*)(void *))netintr, NULL);
}
/*
@@ -184,25 +175,6 @@ softintr_schedule(void *arg)
mtx_leave(&siq->siq_mtx);
}
-int netisr;
-
-void
-netintr(void)
-{
- int n;
-
- while ((n = netisr) != 0) {
- atomic_clearbits_int(&netisr, n);
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << (bit))) \
- fn(); \
- } while (0)
-#include <net/netisr_dispatch.h>
-#undef DONETISR
- }
-}
-
#if 0
void
dosoftint(int xcpl)
diff --git a/sys/arch/sgi/include/intr.h b/sys/arch/sgi/include/intr.h
index 9b46c2bf5d1..d7cc3dc7c6e 100644
--- a/sys/arch/sgi/include/intr.h
+++ b/sys/arch/sgi/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.41 2010/01/18 16:59:23 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.42 2010/12/21 14:56:24 claudio Exp $ */
/*
* Copyright (c) 2001-2004 Opsycon AB (www.opsycon.se / www.opsycon.com)
@@ -107,11 +107,6 @@ void *softintr_establish(int, void (*)(void *), void *);
void softintr_init(void);
void softintr_schedule(void *);
-/* XXX For legacy software interrupts. */
-extern struct soft_intrhand *softnet_intrhand;
-
-#define setsoftnet() softintr_schedule(softnet_intrhand)
-
#define splsoft() splraise(IPL_SOFTINT)
#define splbio() splraise(IPL_BIO)
#define splnet() splraise(IPL_NET)
diff --git a/sys/arch/sh/include/intr.h b/sys/arch/sh/include/intr.h
index 886494c6dd7..706b4dc169f 100644
--- a/sys/arch/sh/include/intr.h
+++ b/sys/arch/sh/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.7 2009/04/19 18:54:06 oga Exp $ */
+/* $OpenBSD: intr.h,v 1.8 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: intr.h,v 1.22 2006/01/24 23:51:42 uwe Exp $ */
/*-
@@ -114,11 +114,6 @@ void *softintr_establish(int, void (*)(void *), void *);
void softintr_init(void);
void softintr_schedule(void *);
-/* XXX For legacy software interrupts. */
-extern struct sh_soft_intrhand *softnet_intrhand;
-
-#define setsoftnet() softintr_schedule(softnet_intrhand)
-
#endif /* _KERNEL */
#endif /* !_SH_INTR_H_ */
diff --git a/sys/arch/sh/sh/interrupt.c b/sys/arch/sh/sh/interrupt.c
index 3aed3e0238a..131b26c3292 100644
--- a/sys/arch/sh/sh/interrupt.c
+++ b/sys/arch/sh/sh/interrupt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: interrupt.c,v 1.11 2010/09/20 06:33:47 matthew Exp $ */
+/* $OpenBSD: interrupt.c,v 1.12 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: interrupt.c,v 1.18 2006/01/25 00:02:57 uwe Exp $ */
/*-
@@ -35,8 +35,6 @@
#include <uvm/uvm_extern.h> /* uvmexp.intrs */
-#include <net/netisr.h>
-
#include <sh/clock.h>
#include <sh/trap.h>
#include <sh/intcreg.h>
@@ -61,8 +59,6 @@ void tmu2_oneshot(void);
int tmu2_intr(void *);
void setsoft(int);
-int netisr;
-
/*
* EVTCODE to intc_intrhand mapper.
* max #76 is SH4_INTEVT_TMU4 (0xb80)
@@ -75,7 +71,6 @@ struct intc_intrhand __intc_intrhand[_INTR_N + 1] = {
};
struct sh_soft_intr sh_soft_intrs[_IPL_NSOFT];
-struct sh_soft_intrhand *softnet_intrhand;
/*
* SH INTC support.
@@ -588,11 +583,6 @@ softintr_init(void)
asi->softintr_ipl = IPL_SOFT + i;
}
- /* XXX Establish legacy soft interrupt handlers. */
- softnet_intrhand = softintr_establish(IPL_SOFTNET,
- (void (*)(void *))netintr, NULL);
- KDASSERT(softnet_intrhand != NULL);
-
intc_intr_establish(SH_INTEVT_TMU1_TUNI1, IST_LEVEL, IPL_SOFT,
tmu1_intr, NULL, "tmu1");
intc_intr_establish(SH_INTEVT_TMU2_TUNI2, IST_LEVEL, IPL_SOFTNET,
@@ -690,29 +680,6 @@ void softintr_schedule(void *arg)
}
/*
- * Software (low priority) network interrupt. i.e. softnet().
- */
-void
-netintr(void)
-{
- int n;
-
- while ((n = netisr) != 0) {
- atomic_clearbits_int(&netisr, n);
-
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << bit)) \
- fn(); \
- } while (/*CONSTCOND*/0)
-
-#include <net/netisr_dispatch.h>
-
-#undef DONETISR
- }
-}
-
-/*
* Software interrupt is simulated with TMU one-shot timer.
*/
void
diff --git a/sys/arch/sparc/include/intr.h b/sys/arch/sparc/include/intr.h
index b4fff3a96ac..79078575957 100644
--- a/sys/arch/sparc/include/intr.h
+++ b/sys/arch/sparc/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.1 2009/04/10 20:53:54 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.2 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: cpu.h,v 1.24 1997/03/15 22:25:15 pk Exp $ */
/*
@@ -94,9 +94,5 @@ void softintr_disestablish(void *);
void *softintr_establish(int, void (*)(void *), void *);
void softintr_schedule(void *);
-/* XXX legacy software interrupts */
-extern void *softnet_ih;
-#define setsoftnet() softintr_schedule(softnet_ih)
-
#endif /* _KERNEL */
#endif /* _SPARC_INTR_H_ */
diff --git a/sys/arch/sparc/sparc/intr.c b/sys/arch/sparc/sparc/intr.c
index 7caa1889400..139ada0343a 100644
--- a/sys/arch/sparc/sparc/intr.c
+++ b/sys/arch/sparc/sparc/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.36 2010/09/28 18:52:00 deraadt Exp $ */
+/* $OpenBSD: intr.c,v 1.37 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: intr.c,v 1.20 1997/07/29 09:42:03 fair Exp $ */
/*
@@ -51,9 +51,6 @@
#include <dev/cons.h>
-#include <net/netisr.h>
-#include <net/if.h>
-
#include <machine/atomic.h>
#include <machine/cpu.h>
#include <machine/ctlreg.h>
@@ -62,26 +59,11 @@
#include <sparc/sparc/cpuvar.h>
-#ifdef INET
-#include <netinet/in.h>
-#include <netinet/if_ether.h>
-#include <netinet/ip_var.h>
-#endif
-
-#ifdef INET6
-# ifndef INET
-# include <netinet/in.h>
-# endif
-#include <netinet/ip6.h>
-#include <netinet6/ip6_var.h>
-#endif
-
extern void raise(int, int);
void ih_insert(struct intrhand **, struct intrhand *);
void ih_remove(struct intrhand **, struct intrhand *);
-void softnet(void *);
void strayintr(struct clockframe *);
/*
@@ -180,8 +162,6 @@ intr_init()
evcount_attach(&level10.ih_count, "clock", &level10.ih_vec);
level14.ih_vec = level14.ih_ipl >> 8;
evcount_attach(&level14.ih_count, "prof", &level14.ih_vec);
-
- softnet_ih = softintr_establish(IPL_SOFTNET, softnet, NULL);
}
/*
@@ -556,29 +536,6 @@ softintr_schedule(void *arg)
splx(s);
}
-void *softnet_ih;
-int netisr;
-
-void
-softnet(void *arg)
-{
- int n;
-
- while ((n = netisr) != 0) {
- atomic_clearbits_int(&netisr, n);
-
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << bit)) \
- fn(); \
- } while (0)
-
-#include <net/netisr_dispatch.h>
-
-#undef DONETISR
- }
-}
-
#ifdef DIAGNOSTIC
void
splassert_check(int wantipl, const char *func)
diff --git a/sys/arch/sparc64/include/cpu.h b/sys/arch/sparc64/include/cpu.h
index ce179324090..9ef70cd12b6 100644
--- a/sys/arch/sparc64/include/cpu.h
+++ b/sys/arch/sparc64/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.74 2010/11/27 19:41:48 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.75 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: cpu.h,v 1.28 2001/06/14 22:56:58 thorpej Exp $ */
/*
@@ -221,8 +221,6 @@ struct clockframe {
extern void (*cpu_start_clock)(void);
-void setsoftnet(void);
-
#define aston(p) ((p)->p_md.md_astpending = 1)
/*
diff --git a/sys/arch/sparc64/sparc64/intr.c b/sys/arch/sparc64/sparc64/intr.c
index 411535565c8..50a2950b594 100644
--- a/sys/arch/sparc64/sparc64/intr.c
+++ b/sys/arch/sparc64/sparc64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.38 2010/09/27 17:39:43 deraadt Exp $ */
+/* $OpenBSD: intr.c,v 1.39 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: intr.c,v 1.39 2001/07/19 23:38:11 eeh Exp $ */
/*
@@ -48,8 +48,6 @@
#include <dev/cons.h>
-#include <net/netisr.h>
-
#include <machine/atomic.h>
#include <machine/cpu.h>
#include <machine/ctlreg.h>
@@ -69,7 +67,6 @@ struct intrhand *intrlev[MAXINTNUM];
void strayintr(const struct trapframe64 *, int);
int softintr(void *);
-int softnet(void *);
int intr_list_handler(void *);
void intr_ack(struct intrhand *);
@@ -125,37 +122,6 @@ strayintr(fp, vectored)
* Soft clock interrupt
*/
-int netisr;
-
-int
-softnet(fp)
- void *fp;
-{
- int n;
-
- while ((n = netisr) != 0) {
- atomic_clearbits_int(&netisr, n);
-
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << bit)) \
- fn(); \
- } while (0)
-
-#include <net/netisr_dispatch.h>
-
-#undef DONETISR
- }
- return (1);
-}
-
-struct intrhand soft01net = { softnet, NULL, 1 };
-
-void
-setsoftnet() {
- send_softint(-1, IPL_SOFTNET, &soft01net);
-}
-
/*
* PCI devices can share interrupts so we need to have
* a handler to hand out interrupts.
diff --git a/sys/arch/vax/include/intr.h b/sys/arch/vax/include/intr.h
index 4a6e3c5ee42..39ccf31ad00 100644
--- a/sys/arch/vax/include/intr.h
+++ b/sys/arch/vax/include/intr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.h,v 1.12 2010/04/23 03:50:22 miod Exp $ */
+/* $OpenBSD: intr.h,v 1.13 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: intr.h,v 1.1 1998/08/18 23:55:00 matt Exp $ */
/*
@@ -155,11 +155,6 @@ void *softintr_establish(int, void (*)(void *), void *);
void softintr_init(void);
void softintr_schedule(void *);
-/* XXX For legacy software interrupts. */
-extern struct soft_intrhand *softnet_intrhand;
-
-#define setsoftnet() softintr_schedule(softnet_intrhand)
-
#endif /* _LOCORE */
#endif /* _VAX_INTR_H */
diff --git a/sys/arch/vax/vax/locore.S b/sys/arch/vax/vax/locore.S
index 404a821187d..ce3eba0e020 100644
--- a/sys/arch/vax/vax/locore.S
+++ b/sys/arch/vax/vax/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.4 2010/11/27 18:04:23 miod Exp $ */
+/* $OpenBSD: locore.S,v 1.5 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: intvec.s,v 1.39 1999/06/28 08:20:48 itojun Exp $ */
/*
@@ -35,7 +35,6 @@
#include "assym.h"
#include <machine/asm.h>
-#include <net/netisr.h>
#define JSBENTRY(x) \
.text; _ALIGN_TEXT; .globl x; x:
@@ -279,11 +278,6 @@ TRAPCALL(astintr, T_ASTFLT)
FASTINTR(softintr,softintr_dispatch)
- .data
- .global _netisr
-_netisr:
- .long 0 # scheduling bits for network
-
TRAPCALL(ddbtrap, T_KDBTRAP)
JSBENTRY(hardclock)
diff --git a/sys/arch/vax/vax/machdep.c b/sys/arch/vax/vax/machdep.c
index 5e50eefaceb..ac4a9c2f61d 100644
--- a/sys/arch/vax/vax/machdep.c
+++ b/sys/arch/vax/vax/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.110 2010/06/29 18:46:34 tedu Exp $ */
+/* $OpenBSD: machdep.c,v 1.111 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: machdep.c,v 1.108 2000/09/13 15:00:23 thorpej Exp $ */
/*
@@ -76,7 +76,6 @@
#include <uvm/uvm.h>
-#include <net/netisr.h>
#include <net/if.h>
#ifdef INET
diff --git a/sys/arch/vax/vax/softintr.c b/sys/arch/vax/vax/softintr.c
index 13cd95c6c53..1d99ca7cdc4 100644
--- a/sys/arch/vax/vax/softintr.c
+++ b/sys/arch/vax/vax/softintr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: softintr.c,v 1.1 2009/03/20 18:39:30 miod Exp $ */
+/* $OpenBSD: softintr.c,v 1.2 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: softintr.c,v 1.2 2003/07/15 00:24:39 lukem Exp $ */
/*
@@ -39,9 +39,6 @@
#include <sys/param.h>
#include <sys/malloc.h>
-/* XXX Network interrupts should be converted to new softintrs. */
-#include <net/netisr.h>
-
#include <uvm/uvm_extern.h>
#include <machine/atomic.h>
@@ -171,22 +168,3 @@ softintr_schedule(void *arg)
}
mtx_leave(&siq->siq_mtx);
}
-
-int netisr;
-
-void
-netintr(void)
-{
- int n;
-
- while ((n = netisr) != 0) {
- atomic_clearbits_int(&netisr, n);
-#define DONETISR(bit, fn) \
- do { \
- if (n & (1 << (bit))) \
- fn(); \
- } while (0)
-#include <net/netisr_dispatch.h>
-#undef DONETISR
- }
-}
diff --git a/sys/conf/files b/sys/conf/files
index ad9b07f8ea5..e7d875e4c6c 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.504 2010/10/06 22:19:20 mikeb Exp $
+# $OpenBSD: files,v 1.505 2010/12/21 14:56:24 claudio Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -807,6 +807,7 @@ file net/if_loop.c loop
file net/if_media.c ifmedia
file net/if_sl.c sl needs-count
file net/if_ppp.c ppp needs-count
+file net/netisr.c
file net/ppp_tty.c ppp
file net/bsd-comp.c ppp_bsdcomp
file net/ppp-deflate.c ppp_deflate
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index 34beffbe642..61805f1e16c 100644
--- a/sys/kern/init_main.c
+++ b/sys/kern/init_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_main.c,v 1.171 2010/09/08 14:15:56 jsing Exp $ */
+/* $OpenBSD: init_main.c,v 1.172 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: init_main.c,v 1.84.4.1 1996/06/02 09:08:06 mrg Exp $ */
/*
@@ -89,6 +89,7 @@
#include <net/if.h>
#include <net/raw_cb.h>
+#include <net/netisr.h>
#if defined(CRYPTO)
#include <crypto/cryptodev.h>
@@ -396,6 +397,7 @@ main(void *framep)
* until everything is ready.
*/
s = splnet();
+ netisr_init();
domaininit();
if_attachdomain();
splx(s);
diff --git a/sys/net/netisr.c b/sys/net/netisr.c
new file mode 100644
index 00000000000..cebb285409f
--- /dev/null
+++ b/sys/net/netisr.c
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2010 Owain G. Ainsworth <oga@openbsd.org>
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+#include <sys/param.h>
+#include <sys/systm.h>
+
+#include <net/netisr.h>
+
+#include <machine/intr.h>
+
+#include "bluetooth.h"
+#include "ether.h"
+#include "ppp.h"
+#include "bridge.h"
+#include "pppoe.h"
+#include "pfsync.h"
+
+void netintr(void *);
+
+int netisr;
+void *netisr_intr;
+
+void
+netintr(void *unused) /* ARGSUSED */
+{
+ int n;
+ while ((n = netisr) != 0) {
+ atomic_clearbits_int(&netisr, n);
+
+#ifdef INET
+#if NETHER > 0
+ if (n & (1 << NETISR_ARP))
+ arpintr();
+#endif
+ if (n & (1 << NETISR_IP))
+ ipintr();
+#endif
+#ifdef INET6
+ if (n & (1 << NETISR_IPV6))
+ ip6intr();
+#endif
+#ifdef MPLS
+ if (n & (1 << NETISR_MPLS))
+ mplsintr();
+#endif
+#ifdef NETATALK
+ if (n & (1 << NETISR_ATALK))
+ atintr();
+#endif
+#if NATM > 0
+ if (n & (1 << NETISR_NATM))
+ natmintr();
+#endif
+#if NPPP > 0
+ if (n & (1 << NETISR_PPP))
+ pppintr();
+#endif
+#if NBRIDGE > 0
+ if (n & (1 << NETISR_BRIDGE))
+ bridgeintr();
+#endif
+#if NPPPOE > 0
+ if (n & (1 << NETISR_PPPOE))
+ pppoeintr();
+#endif
+#if NBLUETOOTH > 0
+ if (n & (1 << NETISR_BT))
+ btintr();
+#endif
+#if NPFSYNC > 0
+ if (n & (1 << NETISR_PFSYNC))
+ pfsyncintr();
+#endif
+ if (n & (1 << NETISR_TX))
+ nettxintr();
+ }
+}
+
+void
+netisr_init(void)
+{
+ netisr_intr = softintr_establish(IPL_SOFTNET, netintr, NULL);
+ if (netisr_intr == NULL)
+ panic("can't establish softnet handler");
+}
diff --git a/sys/net/netisr.h b/sys/net/netisr.h
index e8788bd2c53..9508a056d35 100644
--- a/sys/net/netisr.h
+++ b/sys/net/netisr.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: netisr.h,v 1.34 2009/02/16 00:31:25 dlg Exp $ */
+/* $OpenBSD: netisr.h,v 1.35 2010/12/21 14:56:24 claudio Exp $ */
/* $NetBSD: netisr.h,v 1.12 1995/08/12 23:59:24 mycroft Exp $ */
/*
@@ -41,9 +41,6 @@
* The software interrupt level for the network is higher than the software
* level for the clock (so you can enter the network in routines called
* at timeout time).
- *
- * The routine to request a network software interrupt, setsoftnet(),
- * is defined in the machine-specific include files.
*/
/*
@@ -86,11 +83,16 @@ void mplsintr(void);
void pfsyncintr(void);
#include <machine/atomic.h>
+
+extern void *netisr_intr;
#define schednetisr(anisr) \
do { \
atomic_setbits_int(&netisr, (1 << (anisr))); \
- setsoftnet(); \
-} while (0)
+ softintr_schedule(netisr_intr); \
+} while (/* CONSTCOND */0)
+
+void netisr_init(void);
+
#endif
#endif
diff --git a/sys/net/netisr_dispatch.h b/sys/net/netisr_dispatch.h
deleted file mode 100644
index 8ccbba635bc..00000000000
--- a/sys/net/netisr_dispatch.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* $OpenBSD: netisr_dispatch.h,v 1.17 2009/02/16 00:31:25 dlg Exp $ */
-/* $NetBSD: netisr_dispatch.h,v 1.2 2000/07/02 04:40:47 cgd Exp $ */
-
-/*
- * netisr_dispatch: This file is included by the
- * machine dependant softnet function. The
- * DONETISR macro should be set before including
- * this file. i.e.:
- *
- * softintr() {
- * ...do setup stuff...
- * #define DONETISR(bit, fn) do { ... } while (0)
- * #include <net/netisr_dispatch.h>
- * #undef DONETISR
- * ...do cleanup stuff.
- * }
- */
-
-#ifndef _NET_NETISR_H_
-#error <net/netisr.h> must be included before <net/netisr_dispatch.h>
-#endif
-
-#ifndef _NET_NETISR_DISPATCH_H_
-#define _NET_NETISR_DISPATCH_H_
-#include "bluetooth.h"
-#include "ether.h"
-#include "ppp.h"
-#include "bridge.h"
-#include "pppoe.h"
-#include "pfsync.h"
-#endif
-
-/*
- * When adding functions to this list, be sure to add headers to provide
- * their prototypes in <net/netisr.h> (if necessary).
- */
-
-#ifdef INET
-#if NETHER > 0
- DONETISR(NETISR_ARP,arpintr);
-#endif
- DONETISR(NETISR_IP,ipintr);
-#endif
-#ifdef INET6
- DONETISR(NETISR_IPV6,ip6intr);
-#endif
-#ifdef MPLS
- DONETISR(NETISR_MPLS,mplsintr);
-#endif
-#ifdef NETATALK
- DONETISR(NETISR_ATALK,atintr);
-#endif
-#if NATM > 0
- DONETISR(NETISR_NATM,natmintr);
-#endif
-#if NPPP > 0
- DONETISR(NETISR_PPP,pppintr);
-#endif
-#if NBRIDGE > 0
- DONETISR(NETISR_BRIDGE,bridgeintr);
-#endif
-#if NPPPOE > 0
- DONETISR(NETISR_PPPOE,pppoeintr);
-#endif
-#if NBLUETOOTH > 0
- DONETISR(NETISR_BT,btintr);
-#endif
-#if NPFSYNC > 0
- DONETISR(NETISR_PFSYNC,pfsyncintr);
-#endif
- DONETISR(NETISR_TX,nettxintr);