2 * Copyright (c) 2003 Matthew Dillon
4 * $DragonFly: src/sys/net/netisr.c,v 1.1 2003/06/29 03:28:45 dillon Exp $
10 #include <sys/interrupt.h>
11 #include <net/netisr.h>
12 #include <machine/cpufunc.h>
13 #include <machine/ipl.h>
16 static int isrsoftint_installed;
17 static netisr_t *netisrs[NETISR_MAX];
26 while ((mask = isrmask) != 0) {
28 if (btrl(&isrmask, bit)) {
29 if ((func = netisrs[bit]) != NULL)
36 register_netisr(int num, netisr_t *handler)
38 if (num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs)) ) {
39 printf("register_netisr: bad isr number: %d\n", num);
42 if (isrsoftint_installed == 0) {
43 isrsoftint_installed = 1;
44 register_swi(SWI_NET, swi_net, NULL, "swi_net");
46 netisrs[num] = handler;
51 unregister_netisr(int num)
53 if (num < 0 || num >= (sizeof(netisrs)/sizeof(*netisrs)) ) {
54 printf("unregister_netisr: bad isr number: %d\n", num);
62 schednetisr(int isrnum)
64 atomic_set_int(&isrmask, 1 << isrnum);