Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / rump / librump / rumpnet / netisr.c
blob215cc32bad4793f5229e30a625c4ef9b676af19d
1 /* $NetBSD: netisr.c,v 1.3 2009/03/18 10:22:45 cegger Exp $ */
3 /*
4 * Copyright (c) 2008 Antti Kantee. All Rights Reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
16 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
28 #include <sys/cdefs.h>
29 __KERNEL_RCSID(0, "$NetBSD: netisr.c,v 1.3 2009/03/18 10:22:45 cegger Exp $");
31 #include <sys/param.h>
32 #include <sys/intr.h>
34 #include <netinet/in.h>
35 #include <netinet/ip_var.h>
36 #include <netinet/if_inarp.h>
37 #include <netinet/ip6.h>
38 #include <netinet6/ip6_var.h>
39 #include <net/netisr.h>
41 #include "rump_net_private.h"
43 static void *netisrs[NETISR_MAX];
44 void
45 schednetisr(int isr)
48 softint_schedule(netisrs[isr]);
52 * Provide weak aliases purely for linkage in case the real
53 * networking stack isn't used
55 void __ipintr_stub(void);
56 void
57 __ipintr_stub(void)
60 panic("ipintr called but networking stack missing");
62 __weak_alias(ipintr,__ipintr_stub);
64 void __arpintr_stub(void);
65 void
66 __arpintr_stub(void)
69 panic("arpintr called but networking stack missing");
71 __weak_alias(arpintr,__arpintr_stub);
73 void __ip6intr_stub(void);
74 void
75 __ip6intr_stub(void)
78 panic("ip6intr called but networking stack missing");
80 __weak_alias(ip6intr,__ip6intr_stub);
82 void
83 rump_netisr_init(void)
86 netisrs[NETISR_IP] = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
87 (void (*)(void *))ipintr, NULL);
88 netisrs[NETISR_ARP] = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
89 (void (*)(void *))arpintr, NULL);
90 netisrs[NETISR_IPV6] = softint_establish(SOFTINT_NET | SOFTINT_MPSAFE,
91 (void (*)(void *))ip6intr, NULL);