summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-10-26 23:38:05 +0000
committerriastradh <riastradh@NetBSD.org>2022-10-26 23:38:05 +0000
commite00aa03357859b099adb406ea48fc4b768ce8062 (patch)
treea2ee465659d91a3d28f5f79c2fb25cfcf9d6bfec /sys/dev
parent7ae44118a5996177761d43556c3ceb7bae194443 (diff)
ddb/db_active.h: New home for extern db_active.
This can be included unconditionally, and db_active can then be queried unconditionally; if DDB is not in the kernel, then db_active is a constant zero. Reduces need for #include opt_ddb.h, #ifdef DDB.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/com.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index cc56f41e3c2..b52dd97c1ee 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.378 2022/10/03 20:15:50 riastradh Exp $ */
+/* $NetBSD: com.c,v 1.379 2022/10/26 23:38:09 riastradh Exp $ */
/*-
* Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.378 2022/10/03 20:15:50 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com.c,v 1.379 2022/10/26 23:38:09 riastradh Exp $");
#include "opt_com.h"
#include "opt_ddb.h"
@@ -119,9 +119,10 @@ __KERNEL_RCSID(0, "$NetBSD: com.c,v 1.378 2022/10/03 20:15:50 riastradh Exp $");
#include <sys/rndsource.h>
#endif
-
#include <sys/bus.h>
+#include <ddb/db_active.h>
+
#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
#include <dev/ic/ns16550reg.h>
@@ -2516,10 +2517,7 @@ com_common_getc(dev_t dev, struct com_regs *regsp)
stat = CSR_READ_1(regsp, COM_REG_IIR);
{
int cn_trapped = 0; /* required by cn_trap, see above */
-#ifdef DDB
- extern int db_active;
if (!db_active)
-#endif
cn_check_magic(dev, c, com_cnm_state);
}
splx(s);