i noticed this when trying to figure out what level a cardslot would
interrupt at.
now we have splraise this is a lot more straightforward.
avoiding an splraise when we're not sure whats actually lower than
IPL_BIO is not worth the effort. splraise to a lower level is fine.
ok?
Index: pccbb.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/pccbb.c,v
retrieving revision 1.96
diff -u -p -r1.96 pccbb.c
--- pccbb.c 11 Sep 2015 09:15:44 -0000 1.96
+++ pccbb.c 24 Aug 2016 09:47:08 -0000
@@ -960,50 +960,16 @@ pccbbintr_function(struct pccbb_softc *s
{
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;