From: dlg Date: Tue, 17 Jul 2018 03:32:10 +0000 (+0000) Subject: we have splraise() now X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=8c0832a24f813ae37f6dc46451581ab175725d86;p=openbsd we have splraise() now previously the code would do a series of comparisons to IPL_FOO and IPL_BAR, and use splfoo() and splbar() as needed, but for like a dozen different IPl levels (i may be exaggerating). splraise() rolls all of that up. ok deraadt@ mpi@ --- diff --git a/sys/dev/pci/pccbb.c b/sys/dev/pci/pccbb.c index e81db231385..642e7879b7f 100644 --- a/sys/dev/pci/pccbb.c +++ b/sys/dev/pci/pccbb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pccbb.c,v 1.97 2017/09/08 05:36:52 deraadt Exp $ */ +/* $OpenBSD: pccbb.c,v 1.98 2018/07/17 03:32:10 dlg Exp $ */ /* $NetBSD: pccbb.c,v 1.96 2004/03/28 09:49:31 nakayama Exp $ */ /* @@ -959,50 +959,16 @@ pccbbintr_function(struct pccbb_softc *sc) { int retval = 0, val; struct pccbb_intrhand_list *pil; - int s, splchanged; + int s; for (pil = sc->sc_pil; pil != NULL; pil = pil->pil_next) { - /* - * XXX priority change. gross. I use if-else - * sentences instead of switch-case sentences in order - * to avoid duplicate case value error. More than one - * IPL_XXX may use the same value. It depends on the - * implementation. - */ - splchanged = 1; -#if 0 - if (pil->pil_level == IPL_SERIAL) { - s = splserial(); - } else if (pil->pil_level == IPL_HIGH) { -#endif - if (pil->pil_level == IPL_HIGH) { - s = splhigh(); - } else if (pil->pil_level == IPL_CLOCK) { - s = splclock(); - } else if (pil->pil_level == IPL_AUDIO) { - s = splaudio(); - } else if (pil->pil_level == IPL_VM) { - s = splvm(); - } else if (pil->pil_level == IPL_TTY) { - s = spltty(); -#if 0 - } else if (pil->pil_level == IPL_SOFTSERIAL) { - s = splsoftserial(); -#endif - } else if (pil->pil_level == IPL_NET) { - s = splnet(); - } else { - splchanged = 0; - /* XXX: ih lower than IPL_BIO runs w/ IPL_BIO. */ - } + s = splraise(pil->pil_level); val = (*pil->pil_func)(pil->pil_arg); if (val != 0) pil->pil_count.ec_count++; - if (splchanged != 0) { - splx(s); - } + splx(s); if (retval == 0 || val != 0) retval = val;