Add safety check in case "conflicts" keyword specified more times than

needed
This commit is contained in:
Andrey A. Chernov 1997-06-08 17:15:31 +00:00
parent 1886f4968c
commit 7f533ff73f
4 changed files with 23 additions and 10 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
* $Id: isa.c,v 1.89 1997/06/02 08:19:05 dfr Exp $
* $Id: isa.c,v 1.90 1997/06/08 16:43:37 ache Exp $
*/
/*
@ -537,9 +537,12 @@ config_isadev_c(isdp, mp, reconfig)
undirect_isa_irq(rirq); /* free for ISA */
}
#endif /* APIC_IO */
if (!isdp->id_conflicts)
register_intr(ffs(isdp->id_irq) - 1, isdp->id_id,
isdp->id_ri_flags, isdp->id_intr,
if ( !isdp->id_conflicts
|| !intr_registered(ffs(isdp->id_irq) - 1))
register_intr(ffs(isdp->id_irq) - 1,
isdp->id_id,
isdp->id_ri_flags,
isdp->id_intr,
mp, isdp->id_unit);
}
} else {

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91
* $Id: isa.c,v 1.89 1997/06/02 08:19:05 dfr Exp $
* $Id: isa.c,v 1.90 1997/06/08 16:43:37 ache Exp $
*/
/*
@ -537,9 +537,12 @@ config_isadev_c(isdp, mp, reconfig)
undirect_isa_irq(rirq); /* free for ISA */
}
#endif /* APIC_IO */
if (!isdp->id_conflicts)
register_intr(ffs(isdp->id_irq) - 1, isdp->id_id,
isdp->id_ri_flags, isdp->id_intr,
if ( !isdp->id_conflicts
|| !intr_registered(ffs(isdp->id_irq) - 1))
register_intr(ffs(isdp->id_irq) - 1,
isdp->id_id,
isdp->id_ri_flags,
isdp->id_intr,
mp, isdp->id_unit);
}
} else {

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: kern_intr.c,v 1.5 1997/06/02 08:19:06 dfr Exp $
* $Id: kern_intr.c,v 1.6 1997/06/02 10:46:28 dfr Exp $
*
*/
@ -88,6 +88,12 @@ intr_mux(void *arg)
/* XXX better use NHWI from <machine/ipl.h> for array size ??? */
static intrec *intreclist_head[ICU_LEN];
int
intr_registered(int irq)
{
return (intreclist_head[irq] != NULL);
}
static intrec*
find_idesc(unsigned *maskptr, int irq)
{

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: interrupt.h,v 1.3 1997/06/01 16:05:14 peter Exp $
* $Id: interrupt.h,v 1.4 1997/06/02 10:46:20 dfr Exp $
*/
/* XXX currently dev_instance must be set to the ISA device_id or -1 for PCI */
@ -37,6 +37,7 @@ int intr_destroy(struct intrec *idesc);
int intr_connect(struct intrec *idesc);
int intr_disconnect(struct intrec *idesc);
int intr_registered(int irq);
/* XXX emulate old interface for now ... */
int register_intr __P((int intr, int device_id, u_int flags,