Slight cleanup; do all of the spl*()s with imask[].

This commit is contained in:
thorpej 1999-08-04 15:54:28 +00:00
parent 7bff22bddc
commit 51fe928d5e
2 changed files with 19 additions and 7 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: psl.h,v 1.19 1997/11/13 20:57:31 phil Exp $ */
/* $NetBSD: psl.h,v 1.20 1999/08/04 15:54:28 thorpej Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -76,8 +76,11 @@
#define IPL_TTY 4 /* terminal */
#define IPL_CLOCK 5 /* clock */
#define IPL_IMP 6 /* memory allocation */
#define NIPL 7 /* number of interrupt priority levels */
#define IPL_NAMES {"zero", "", "bio", "net", "tty", "clock", "imp"}
#define IPL_SOFTCLOCK 7 /* softlock */
#define IPL_SOFTNET 8 /* softnet */
#define NIPL 9 /* number of interrupt priority levels */
#define IPL_NAMES {"zero", "", "bio", "net", "tty", "clock", "imp", \
"softclock", "softnet" }
/* IPL_RTTY (for the scn driver) is the same as IPL_HIGH. */
#define IPL_RTTY IPL_HIGH
@ -190,13 +193,13 @@ splx(ncpl)
* NOTE: splsoftclock() is used by hardclock() to lower the priority from
* clock to softclock before it calls softclock().
*/
#define splsoftclock() splx(SIR_CLOCKMASK | imask[IPL_ZERO])
#define splsoftnet() splraise(SIR_NETMASK)
#define splsoftclock() splx(imask[IPL_SOFTCLOCK])
#define splsoftnet() splraise(imask[IPL_SOFTNET])
/*
* Miscellaneous
*/
#define splhigh() splraise(-1)
#define splhigh() splraise(imask[IPL_HIGH])
#define spl0() splx(imask[IPL_ZERO])
#define splnone() spl0()

View File

@ -1,4 +1,4 @@
/* $NetBSD: intr.c,v 1.21 1999/03/24 05:51:08 mrg Exp $ */
/* $NetBSD: intr.c,v 1.22 1999/08/04 15:54:28 thorpej Exp $ */
/*
* Copyright (c) 1994 Matthias Pfaller.
@ -74,6 +74,10 @@ intr_init()
icu_init(icu_table);
/* Initialize the base software interrupt masks. */
imask[IPL_SOFTCLOCK] = SIR_CLOCKMASK | imask[IPL_ZERO];
imask[IPL_SOFTNET] = SIR_NETMASK;
for (i = 0; i < 16; i++) {
ivt[i].iv_vec = badhard;
ivt[i].iv_level = IPL_ZERO;
@ -223,6 +227,11 @@ intr_establish(intr, vector, arg, use, blevel, rlevel, mode)
*/
imask[IPL_ZERO] &= ~(1 << intr);
/*
* Update IPL_SOFTCLOCK to reflect the new IPL_ZERO.
*/
imask[IPL_SOFTCLOCK] = SIR_CLOCKMASK | imask[IPL_ZERO];
/*
* Update run masks for all handlers.
*/