diff options
author | Doug Rabson <dfr@FreeBSD.org> | 1998-09-26 14:25:32 +0000 |
---|---|---|
committer | Doug Rabson <dfr@FreeBSD.org> | 1998-09-26 14:25:32 +0000 |
commit | da653c61488152b27d2ac545fb72a7c6b5af15d9 (patch) | |
tree | 654f3403184466119dc6dea824ee085d366c02e9 /sys/alpha | |
parent | d4a2828cded9e0b1941efe91c0857ce7ec71ef78 (diff) | |
download | src-da653c61488152b27d2ac545fb72a7c6b5af15d9.tar.gz src-da653c61488152b27d2ac545fb72a7c6b5af15d9.zip |
Start using the new SWI registration system instead of hardwiring everything.
Notes
Notes:
svn path=/head/; revision=39680
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/ipl_funcs.c | 59 | ||||
-rw-r--r-- | sys/alpha/include/ipl.h | 4 |
2 files changed, 40 insertions, 23 deletions
diff --git a/sys/alpha/alpha/ipl_funcs.c b/sys/alpha/alpha/ipl_funcs.c index 251c4d28a94e..ad6670ecbbef 100644 --- a/sys/alpha/alpha/ipl_funcs.c +++ b/sys/alpha/alpha/ipl_funcs.c @@ -23,11 +23,12 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ipl_funcs.c,v 1.6 1998/09/16 08:21:12 dfr Exp $ + * $Id: ipl_funcs.c,v 1.7 1998/09/19 09:29:40 dfr Exp $ */ #include <sys/types.h> #include <sys/systm.h> +#include <sys/interrupt.h> #include <machine/ipl.h> #include <machine/cpu.h> #include <net/netisr.h> @@ -38,17 +39,28 @@ unsigned int bio_imask; /* XXX */ unsigned int cam_imask; /* XXX */ unsigned int net_imask; /* XXX */ +static void swi_net(void); +extern void swi_camnet(void); +extern void swi_cambio(void); + void (*netisrs[32]) __P((void)); +swihand_t *ihandlers[32] = { /* software interrupts */ + swi_null, swi_net, swi_camnet, swi_cambio, + swi_null, softclock, swi_null, swi_null, + swi_null, swi_null, swi_null, swi_null, + swi_null, swi_null, swi_null, swi_null, + swi_null, swi_null, swi_null, swi_null, + swi_null, swi_null, swi_null, swi_null, + swi_null, swi_null, swi_null, swi_null, + swi_null, swi_null, swi_null, swi_null, +}; + u_int32_t netisr; u_int32_t ipending; u_int32_t idelayed; #define getcpl() (alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) -static void swi_tty(void); -static void swi_net(void); -extern void swi_camnet(void); -extern void swi_cambio(void); static void atomic_setbit(u_int32_t* p, u_int32_t bit) { @@ -84,12 +96,17 @@ static u_int32_t atomic_readandclear(u_int32_t* p) return v; } -static void -swi_tty() +void +swi_null() +{ + /* No interrupt registered, do nothing */ +} + +void +swi_generic() { -#if NSIO > 0 - siopoll(); -#endif + /* Just a placeholder, we call swi_dispatcher directly */ + panic("swi_generic() called"); } static void @@ -109,23 +126,22 @@ void do_sir() { u_int32_t pend; + int i; splsoft(); while (pend = atomic_readandclear(&ipending)) { - if (pend & (1 << SWI_TTY)) - swi_tty(); - if (pend & (1 << SWI_NET)) - swi_net(); - if (pend & (1 << SWI_CAMNET)) - swi_camnet(); - if (pend & (1 << SWI_CAMBIO)) - swi_cambio(); - if (pend & (1 << SWI_CLOCK)) - softclock(); + for (i = 0; pend && i < 32; i++) { + if (pend & (1 << i)) { + if (ihandlers[i] == swi_generic) + swi_dispatcher(i); + else + ihandlers[i](); + pend &= ~(1 << i); + } + } } } - #define GENSET(name, ptr, bit) \ \ void name(void) \ @@ -202,4 +218,3 @@ splx(int s) else spl0(); } - diff --git a/sys/alpha/include/ipl.h b/sys/alpha/include/ipl.h index 571a93fd16e7..79e83f3d1016 100644 --- a/sys/alpha/include/ipl.h +++ b/sys/alpha/include/ipl.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ipl.h,v 1.5 1998/09/16 08:23:21 dfr Exp $ + * $Id: ipl.h,v 1.6 1998/09/19 09:29:40 dfr Exp $ */ #ifndef _MACHINE_IPL_H_ @@ -38,6 +38,8 @@ #define SWI_CAMBIO 3 #define SWI_VM 4 #define SWI_CLOCK 5 +#define NSWI 32 +#define NHWI 0 extern int splsoft(void); extern int splsoftclock(void); |