Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 #if DIAGNOSTIC panic ---> KASSERT



details:   https://anonhg.NetBSD.org/src/rev/b68393825928
branches:  trunk
changeset: 822422:b68393825928
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Mar 19 22:19:05 2017 +0000

description:
#if DIAGNOSTIC panic ---> KASSERT

diffstat:

 sys/arch/x86/x86/intr.c |  15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)

diffs (36 lines):

diff -r e71eeb8583f7 -r b68393825928 sys/arch/x86/x86/intr.c
--- a/sys/arch/x86/x86/intr.c   Sun Mar 19 20:29:30 2017 +0000
+++ b/sys/arch/x86/x86/intr.c   Sun Mar 19 22:19:05 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: intr.c,v 1.96 2016/12/06 15:09:04 maxv Exp $   */
+/*     $NetBSD: intr.c,v 1.97 2017/03/19 22:19:05 riastradh Exp $      */
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.96 2016/12/06 15:09:04 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.97 2017/03/19 22:19:05 riastradh Exp $");
 
 #include "opt_intrdebug.h"
 #include "opt_multiprocessor.h"
@@ -925,13 +925,10 @@
        const char *intrstr;
        char intrstr_buf[INTRIDBUF];
 
-#ifdef DIAGNOSTIC
-       if (legacy_irq != -1 && (legacy_irq < 0 || legacy_irq > 15))
-               panic("%s: bad legacy IRQ value", __func__);
-
-       if (legacy_irq == -1 && pic == &i8259_pic)
-               panic("intr_establish: non-legacy IRQ on i8259");
-#endif
+       KASSERTMSG((legacy_irq == -1 || (0 <= legacy_irq && legacy_irq < 16)),
+           "bad legacy IRQ value: %d", legacy_irq);
+       KASSERTMSG((legacy_irq != -1 || pic != &i8259_pic),
+           "non-legacy IRQ on i8259");
 
        ih = kmem_alloc(sizeof(*ih), KM_SLEEP);
        if (ih == NULL) {



Home | Main Index | Thread Index | Old Index