From b76bb1d472e4dd07af106bb573d2543a0654c6d3 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Wed, 3 Jun 1998 09:43:38 +0000 Subject: Fixed a printf() arg botch in the previous commit. Only complain about an irq mismatch in the probe if the configured irq doesn't become active, and then print the bitmap of irqs that became active (including clock irqs) instead of just the first (not including clock irqs). Bugs reported by: msmith --- sys/dev/sio/sio.c | 13 ++++++------- sys/i386/isa/sio.c | 13 ++++++------- sys/isa/sio.c | 13 ++++++------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index c12221373c7e..63c4248e8fb1 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.202 1998/05/20 06:46:58 phk Exp $ + * $Id: sio.c,v 1.203 1998/05/31 10:53:55 bde Exp $ */ #include "opt_comconsole.h" @@ -775,14 +775,13 @@ sioprobe(dev) enable_intr(); - /* XXX the magic mask is to discard transient (clock) irqs. */ - irqs = irqmap[1] & ~irqmap[0] & ~0x0105; - if (irqs != idev->id_irq) + irqs = irqmap[1] & ~irqmap[0]; + if (idev->id_irq != 0 && (idev->id_irq & irqs) == 0) printf( - "sio%d: probed irq %d does not match configured irq %d\n", - ffs(irqs) - 1, ffs(idev->id_irq) - 1); + "sio%d: configured irq %d not in bitmap of probed irqs %#x\n", + dev->id_unit, ffs(idev->id_irq) - 1, irqs); if (bootverbose) - printf("sio%d: irq maps: %04x %04x %04x %04x\n", + printf("sio%d: irq maps: %#x %#x %#x %#x\n", dev->id_unit, irqmap[0], irqmap[1], irqmap[2], irqmap[3]); result = IO_COMSIZE; diff --git a/sys/i386/isa/sio.c b/sys/i386/isa/sio.c index c12221373c7e..63c4248e8fb1 100644 --- a/sys/i386/isa/sio.c +++ b/sys/i386/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.202 1998/05/20 06:46:58 phk Exp $ + * $Id: sio.c,v 1.203 1998/05/31 10:53:55 bde Exp $ */ #include "opt_comconsole.h" @@ -775,14 +775,13 @@ sioprobe(dev) enable_intr(); - /* XXX the magic mask is to discard transient (clock) irqs. */ - irqs = irqmap[1] & ~irqmap[0] & ~0x0105; - if (irqs != idev->id_irq) + irqs = irqmap[1] & ~irqmap[0]; + if (idev->id_irq != 0 && (idev->id_irq & irqs) == 0) printf( - "sio%d: probed irq %d does not match configured irq %d\n", - ffs(irqs) - 1, ffs(idev->id_irq) - 1); + "sio%d: configured irq %d not in bitmap of probed irqs %#x\n", + dev->id_unit, ffs(idev->id_irq) - 1, irqs); if (bootverbose) - printf("sio%d: irq maps: %04x %04x %04x %04x\n", + printf("sio%d: irq maps: %#x %#x %#x %#x\n", dev->id_unit, irqmap[0], irqmap[1], irqmap[2], irqmap[3]); result = IO_COMSIZE; diff --git a/sys/isa/sio.c b/sys/isa/sio.c index c12221373c7e..63c4248e8fb1 100644 --- a/sys/isa/sio.c +++ b/sys/isa/sio.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * from: @(#)com.c 7.5 (Berkeley) 5/16/91 - * $Id: sio.c,v 1.202 1998/05/20 06:46:58 phk Exp $ + * $Id: sio.c,v 1.203 1998/05/31 10:53:55 bde Exp $ */ #include "opt_comconsole.h" @@ -775,14 +775,13 @@ sioprobe(dev) enable_intr(); - /* XXX the magic mask is to discard transient (clock) irqs. */ - irqs = irqmap[1] & ~irqmap[0] & ~0x0105; - if (irqs != idev->id_irq) + irqs = irqmap[1] & ~irqmap[0]; + if (idev->id_irq != 0 && (idev->id_irq & irqs) == 0) printf( - "sio%d: probed irq %d does not match configured irq %d\n", - ffs(irqs) - 1, ffs(idev->id_irq) - 1); + "sio%d: configured irq %d not in bitmap of probed irqs %#x\n", + dev->id_unit, ffs(idev->id_irq) - 1, irqs); if (bootverbose) - printf("sio%d: irq maps: %04x %04x %04x %04x\n", + printf("sio%d: irq maps: %#x %#x %#x %#x\n", dev->id_unit, irqmap[0], irqmap[1], irqmap[2], irqmap[3]); result = IO_COMSIZE; -- cgit v1.3