diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 72e578ccc8d3..e473f07406e9 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.48 1996/10/15 23:52:51 cgd Exp $ */ +/* $NetBSD: machdep.c,v 1.49 1996/10/18 20:35:23 cgd Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -95,12 +95,26 @@ #include #endif -#include #include +#include + +#ifdef INET #include +#include #include -#include -#include "ether.h" +#endif +#ifdef NS +#include +#endif +#ifdef ISO +#include +#include +#endif +#include "ppp.h" +#if NPPP > 0 +#include +#include +#endif #include "le_ioasic.h" /* for le_iomem creation */ @@ -1456,42 +1470,40 @@ setregs(p, pack, stack, retval) void netintr() { + int n, s; + + s = splhigh(); + n = netisr; + netisr = 0; + splx(s); + +#define DONETISR(bit, fn) \ + do { \ + if (n & (1 << (bit))) \ + fn; \ + } while (0) + #ifdef INET -#if NETHER > 0 - if (netisr & (1 << NETISR_ARP)) { - netisr &= ~(1 << NETISR_ARP); - arpintr(); - } -#endif - if (netisr & (1 << NETISR_IP)) { - netisr &= ~(1 << NETISR_IP); - ipintr(); - } + DONETISR(NETISR_ARP, arpintr()); + DONETISR(NETISR_IP, ipintr()); #endif #ifdef NS - if (netisr & (1 << NETISR_NS)) { - netisr &= ~(1 << NETISR_NS); - nsintr(); - } + DONETISR(NETISR_NS, nsintr()); #endif #ifdef ISO - if (netisr & (1 << NETISR_ISO)) { - netisr &= ~(1 << NETISR_ISO); - clnlintr(); - } + DONETISR(NETISR_ISO, clnlintr()); #endif #ifdef CCITT - if (netisr & (1 << NETISR_CCITT)) { - netisr &= ~(1 << NETISR_CCITT); - ccittintr(); - } + DONETISR(NETISR_CCITT, ccittintr()); #endif -#ifdef PPP - if (netisr & (1 << NETISR_PPP)) { - netisr &= ~(1 << NETISR_PPP); - pppintr(); - } +#ifdef NATM + DONETISR(NETISR_NATM, natmintr()); #endif +#if NPPP > 1 + DONETISR(NETISR_PPP, pppintr()); +#endif + +#undef DONETISR } void