summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2019-07-20 23:06:51 +0000
committermpi <mpi@openbsd.org>2019-07-20 23:06:51 +0000
commitcfc2cdf6e59832252c69d5dea5bafc064ba44bf3 (patch)
tree8b297d28b1829e4439418f3b43817780395e7b1c
parentIncrement `db_active' before entering db_trap() like other archs do. (diff)
downloadwireguard-openbsd-cfc2cdf6e59832252c69d5dea5bafc064ba44bf3.tar.xz
wireguard-openbsd-cfc2cdf6e59832252c69d5dea5bafc064ba44bf3.zip
Get rid of `ddb_is_active' instead use `db_active'.
From Christian Ludwig <christian_ludwig at genua dot de> ok visa@
-rw-r--r--sys/arch/macppc/dev/zs.c10
-rw-r--r--sys/arch/sparc64/sparc64/ipifuncs.c4
-rw-r--r--sys/ddb/db_trap.c4
-rw-r--r--sys/ddb/db_var.h3
-rw-r--r--sys/dev/pci/drm/include/linux/kernel.h4
-rw-r--r--sys/dev/pci/drm/include/linux/kgdb.h4
-rw-r--r--sys/kern/subr_prf.c16
-rw-r--r--sys/kern/subr_witness.c4
8 files changed, 14 insertions, 35 deletions
diff --git a/sys/arch/macppc/dev/zs.c b/sys/arch/macppc/dev/zs.c
index ba4453683ca..a714bacf53c 100644
--- a/sys/arch/macppc/dev/zs.c
+++ b/sys/arch/macppc/dev/zs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zs.c,v 1.28 2017/12/30 20:46:59 guenther Exp $ */
+/* $OpenBSD: zs.c,v 1.29 2019/07/20 23:06:51 mpi Exp $ */
/* $NetBSD: zs.c,v 1.17 2001/06/19 13:42:15 wiz Exp $ */
/*
@@ -1091,12 +1091,8 @@ zs_abort(struct zs_chanstate *channel)
} while (rr0 & ZSRR0_BREAK);
#if defined(DDB)
- {
- extern int db_active;
-
- if (!db_active)
- db_enter();
- }
+ if (!db_active)
+ db_enter();
#endif
}
diff --git a/sys/arch/sparc64/sparc64/ipifuncs.c b/sys/arch/sparc64/sparc64/ipifuncs.c
index 1ffeb666bf4..7df0bac09a3 100644
--- a/sys/arch/sparc64/sparc64/ipifuncs.c
+++ b/sys/arch/sparc64/sparc64/ipifuncs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipifuncs.c,v 1.17 2017/12/03 10:55:50 mpi Exp $ */
+/* $OpenBSD: ipifuncs.c,v 1.18 2019/07/20 23:06:51 mpi Exp $ */
/* $NetBSD: ipifuncs.c,v 1.8 2006/10/07 18:11:36 rjs Exp $ */
/*-
@@ -39,8 +39,6 @@
#include <machine/pmap.h>
#include <machine/sparc64.h>
-extern int db_active;
-
#define SPARC64_IPI_RETRIES 10000
#define sparc64_ipi_sleep() delay(1000)
diff --git a/sys/ddb/db_trap.c b/sys/ddb/db_trap.c
index 85467256e61..f4109a1a6e4 100644
--- a/sys/ddb/db_trap.c
+++ b/sys/ddb/db_trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_trap.c,v 1.28 2017/01/09 17:58:44 mpi Exp $ */
+/* $OpenBSD: db_trap.c,v 1.29 2019/07/20 23:06:51 mpi Exp $ */
/* $NetBSD: db_trap.c,v 1.9 1996/02/05 01:57:18 christos Exp $ */
/*
@@ -52,7 +52,6 @@ db_trap(int type, int code)
boolean_t bkpt;
boolean_t watchpt;
- db_is_active = 1;
bkpt = IS_BREAKPOINT_TRAP(type, code);
watchpt = IS_WATCHPOINT_TRAP(type, code);
@@ -94,5 +93,4 @@ db_trap(int type, int code)
}
db_restart_at_pc(&ddb_regs, watchpt);
- db_is_active = 0;
}
diff --git a/sys/ddb/db_var.h b/sys/ddb/db_var.h
index 3bb02b5d34d..cfb76a81bbd 100644
--- a/sys/ddb/db_var.h
+++ b/sys/ddb/db_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_var.h,v 1.12 2016/09/04 09:22:29 mpi Exp $ */
+/* $OpenBSD: db_var.h,v 1.13 2019/07/20 23:06:51 mpi Exp $ */
/*
* Copyright (c) 1996 Michael Shalayeff. All rights reserved.
@@ -67,7 +67,6 @@ extern int db_max_line;
extern int db_panic;
extern int db_console;
extern int db_log;
-extern int db_is_active;
extern int db_profile;
int ddb_sysctl(int *, u_int, void *, size_t *, void *, size_t,
diff --git a/sys/dev/pci/drm/include/linux/kernel.h b/sys/dev/pci/drm/include/linux/kernel.h
index 188efad2f4f..d0b274c88c8 100644
--- a/sys/dev/pci/drm/include/linux/kernel.h
+++ b/sys/dev/pci/drm/include/linux/kernel.h
@@ -9,8 +9,6 @@
#include <sys/stdarg.h>
#include <sys/malloc.h>
-#include <ddb/db_var.h>
-
#include <linux/types.h>
#include <linux/compiler.h>
#include <linux/bitops.h>
@@ -119,7 +117,7 @@ static inline int
_in_dbg_master(void)
{
#ifdef DDB
- return (db_is_active);
+ return (db_active);
#endif
return (0);
}
diff --git a/sys/dev/pci/drm/include/linux/kgdb.h b/sys/dev/pci/drm/include/linux/kgdb.h
index 73759b3be75..874a0ebe0be 100644
--- a/sys/dev/pci/drm/include/linux/kgdb.h
+++ b/sys/dev/pci/drm/include/linux/kgdb.h
@@ -3,13 +3,13 @@
#ifndef _LINUX_KGDB_H
#define _LINUX_KGDB_H
-#include <ddb/db_var.h>
+#include <sys/systm.h>
static inline int
in_dbg_master(void)
{
#ifdef DDB
- return (db_is_active);
+ return (db_active);
#endif
return (0);
}
diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c
index 6abac53452a..9047e83f2a7 100644
--- a/sys/kern/subr_prf.c
+++ b/sys/kern/subr_prf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_prf.c,v 1.98 2019/05/08 16:22:42 anton Exp $ */
+/* $OpenBSD: subr_prf.c,v 1.99 2019/07/20 23:06:51 mpi Exp $ */
/* $NetBSD: subr_prf.c,v 1.45 1997/10/24 18:14:25 chuck Exp $ */
/*-
@@ -118,11 +118,6 @@ int db_console = 1;
#else
int db_console = 0;
#endif
-
-/*
- * flag to indicate if we are currently in ddb (on some processor)
- */
-int db_is_active;
#endif
/*
@@ -330,16 +325,11 @@ void
kputchar(int c, int flags, struct tty *tp)
{
extern int msgbufmapped;
- int ddb_active = 0;
-
-#ifdef DDB
- ddb_active = db_is_active;
-#endif
if (panicstr)
constty = NULL;
- if ((flags & TOCONS) && tp == NULL && constty && !ddb_active) {
+ if ((flags & TOCONS) && tp == NULL && constty != NULL && !db_active) {
tp = constty;
flags |= TOTTY;
}
@@ -349,7 +339,7 @@ kputchar(int c, int flags, struct tty *tp)
if ((flags & TOLOG) &&
c != '\0' && c != '\r' && c != 0177 && msgbufmapped)
msgbuf_putchar(msgbufp, c);
- if ((flags & TOCONS) && (constty == NULL || ddb_active) && c != '\0')
+ if ((flags & TOCONS) && (constty == NULL || db_active) && c != '\0')
(*v_putc)(c);
#ifdef DDB
if (flags & TODDB)
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index 6a45ccd3735..4cc82e9244a 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_witness.c,v 1.33 2019/06/06 16:45:10 visa Exp $ */
+/* $OpenBSD: subr_witness.c,v 1.34 2019/07/20 23:06:51 mpi Exp $ */
/*-
* Copyright (c) 2008 Isilon Systems, Inc.
@@ -2051,7 +2051,7 @@ witness_ddb_list(struct proc *p)
struct witness_cpu *wc = &witness_cpu[cpu_number()];
KASSERTMSG(witness_cold == 0, "%s: witness_cold", __func__);
- KASSERTMSG(db_is_active, "%s: not in the debugger", __func__);
+ KASSERTMSG(db_active, "%s: not in the debugger", __func__);
if (witness_watch < 1)
return;