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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=26512
4 changed files with 23 additions and 10 deletions

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91 * 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 */ undirect_isa_irq(rirq); /* free for ISA */
} }
#endif /* APIC_IO */ #endif /* APIC_IO */
if (!isdp->id_conflicts) if ( !isdp->id_conflicts
register_intr(ffs(isdp->id_irq) - 1, isdp->id_id, || !intr_registered(ffs(isdp->id_irq) - 1))
isdp->id_ri_flags, isdp->id_intr, register_intr(ffs(isdp->id_irq) - 1,
isdp->id_id,
isdp->id_ri_flags,
isdp->id_intr,
mp, isdp->id_unit); mp, isdp->id_unit);
} }
} else { } else {

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* from: @(#)isa.c 7.2 (Berkeley) 5/13/91 * 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 */ undirect_isa_irq(rirq); /* free for ISA */
} }
#endif /* APIC_IO */ #endif /* APIC_IO */
if (!isdp->id_conflicts) if ( !isdp->id_conflicts
register_intr(ffs(isdp->id_irq) - 1, isdp->id_id, || !intr_registered(ffs(isdp->id_irq) - 1))
isdp->id_ri_flags, isdp->id_intr, register_intr(ffs(isdp->id_irq) - 1,
isdp->id_id,
isdp->id_ri_flags,
isdp->id_intr,
mp, isdp->id_unit); mp, isdp->id_unit);
} }
} else { } else {

View File

@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 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 ??? */ /* XXX better use NHWI from <machine/ipl.h> for array size ??? */
static intrec *intreclist_head[ICU_LEN]; static intrec *intreclist_head[ICU_LEN];
int
intr_registered(int irq)
{
return (intreclist_head[irq] != NULL);
}
static intrec* static intrec*
find_idesc(unsigned *maskptr, int irq) 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 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * 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 */ /* 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_connect(struct intrec *idesc);
int intr_disconnect(struct intrec *idesc); int intr_disconnect(struct intrec *idesc);
int intr_registered(int irq);
/* XXX emulate old interface for now ... */ /* XXX emulate old interface for now ... */
int register_intr __P((int intr, int device_id, u_int flags, int register_intr __P((int intr, int device_id, u_int flags,