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/aa13b2d33b78
branches: trunk
changeset: 352171:aa13b2d33b78
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 940a7472a56d -r aa13b2d33b78 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