summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2001-08-31 01:05:45 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2001-08-31 01:05:45 +0000
commite039c349ee3c58f175950109989f55408b308ad7 (patch)
treec1b2633b12c1691959c4f5da58a02869ac2bb92e /sys/arch/mvme88k
parentdb9da0396880db0af636d8eb2465926f6e6def75 (diff)
Clean the DDB entry procedure for all console drivers, and honour
db_console setting.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r--sys/arch/mvme88k/dev/cl.c28
-rw-r--r--sys/arch/mvme88k/dev/dart.c34
-rw-r--r--sys/arch/mvme88k/dev/vx.c14
3 files changed, 41 insertions, 35 deletions
diff --git a/sys/arch/mvme88k/dev/cl.c b/sys/arch/mvme88k/dev/cl.c
index 92e8c46f7fc..8fbcb608af8 100644
--- a/sys/arch/mvme88k/dev/cl.c
+++ b/sys/arch/mvme88k/dev/cl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cl.c,v 1.13 2001/08/26 02:37:07 miod Exp $ */
+/* $OpenBSD: cl.c,v 1.14 2001/08/31 01:05:44 miod Exp $ */
/*
* Copyright (c) 1995 Dale Rahn. All rights reserved.
@@ -41,15 +41,23 @@
#include <sys/systm.h>
#include <sys/time.h>
#include <sys/device.h>
+#include <sys/syslog.h>
+
#include <machine/cpu.h>
#include <machine/autoconf.h>
+#include <machine/psl.h>
+
#include <dev/cons.h>
#include <mvme88k/dev/clreg.h>
-#include <sys/syslog.h>
+
#include "cl.h"
#include "pcctwo.h"
#include <mvme88k/dev/pcctworeg.h>
-#include <machine/psl.h>
+
+#ifdef DDB
+#include <ddb/db_var.h>
+#endif
+
#define splcl() splx(IPL_TTY)
/* min timeout 0xa, what is a good value */
@@ -70,7 +78,6 @@
#ifdef DEBUG
#undef DEBUG
#endif
-#define DEBUG_KERN 1
struct cl_cons {
void *cl_paddr;
volatile struct clreg *cl_vaddr;
@@ -1641,7 +1648,7 @@ cl_rxintr(arg)
int i;
u_char reoir;
u_char buffer[CL_FIFO_MAX +1];
-#ifdef CONSOLEBREAKDDB
+#ifdef DDB
int wantddb = 0;
#endif
@@ -1676,7 +1683,7 @@ cl_rxintr(arg)
reoir = 0x08;
} else
if (risrl & 0x01) {
-#ifdef CONSOLEBREAKDDB
+#ifdef DDB
if (sc->sc_cl[channel].cl_consio)
wantddb = 1;
#endif
@@ -1803,8 +1810,8 @@ log(LOG_WARNING, "cl_txintr: DMAMODE channel %x dmabsts %x risrl %x risrh %x\n",
reoir = 0x08;
sc->cl_reg->cl_reoir = reoir;
}
-#ifdef CONSOLEBREAKDDB
- if (wantddb)
+#ifdef DDB
+ if (wantddb != 0 && db_console != 0)
Debugger();
#endif
return 1;
@@ -1850,8 +1857,9 @@ cl_break (sc, channel)
struct clsoftc *sc;
int channel;
{
-#ifdef DEBUG_KERN
- Debugger();
+#ifdef DDB
+ if (db_console != 0)
+ Debugger();
#else
log(LOG_WARNING, "%s%d[%d]: break detected\n", cl_cd.cd_name, 0, channel);
#endif
diff --git a/sys/arch/mvme88k/dev/dart.c b/sys/arch/mvme88k/dev/dart.c
index 1e6dae463e8..3c541c11b2b 100644
--- a/sys/arch/mvme88k/dev/dart.c
+++ b/sys/arch/mvme88k/dev/dart.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dart.c,v 1.10 2001/08/26 02:37:07 miod Exp $ */
+/* $OpenBSD: dart.c,v 1.11 2001/08/31 01:05:44 miod Exp $ */
/*
* Mach Operating System
@@ -36,24 +36,24 @@
#include <sys/time.h>
#include <sys/device.h>
#include <sys/simplelock.h>
-#include <machine/cpu.h>
+#include <sys/syslog.h>
+
+#include <machine/asm_macro.h> /* enable/disable interrupts */
#include <machine/autoconf.h>
+#include <machine/cpu.h>
#include <machine/cpu_number.h>
-#include <machine/asm_macro.h> /* enable/disable interrupts */
+#include <machine/psl.h>
+
#include <dev/cons.h>
+
#include <mvme88k/dev/sysconreg.h>
#include <mvme88k/dev/dartreg.h>
-#include <sys/syslog.h>
+
#include "dart.h"
-#include <machine/psl.h>
#define spldart() splx(IPL_TTY)
-#if defined(DDB)
-#include <machine/db_machdep.h> /* for details on entering kdb */
-#define DDB_ENTER_BREAK 0x1
-#define DDB_ENTER_CHAR 0x2
-unsigned char ddb_break_mode = DDB_ENTER_BREAK;
-unsigned char ddb_break_char = 0;
+#ifdef DDB
+#include <db_variables.h>
#endif
#ifdef DEBUG
@@ -983,9 +983,9 @@ dartrint(sc, port)
ptaddr->write.wr_cr = ERRRESET;
#if defined(DDB)
- if (ddb_break_mode & DDB_ENTER_BREAK) {
+ if (db_console != 0) {
dprintf(("dartrint: break detected - entering debugger\n"));
- gimmeabreak();
+ Debugger();
}
#endif
} else {
@@ -1001,13 +1001,7 @@ dartrint(sc, port)
ptaddr->write.wr_cr = ERRRESET;
} else {
/* no errors */
-#if defined(DDB)
- if ((ddb_break_mode & DDB_ENTER_CHAR) && (ddb_break_char == data)) {
- dprintf(("dartrint: ddb_break_char detected - entering debugger\n"));
- gimmeabreak();
- } else
-#endif
- (*linesw[tp->t_line].l_rint)(data,tp);
+ (*linesw[tp->t_line].l_rint)(data,tp);
#if 0
{
if (tp->t_ispeed == B134) /* CS6 */
diff --git a/sys/arch/mvme88k/dev/vx.c b/sys/arch/mvme88k/dev/vx.c
index 1cd64de6b72..f946a62e2ed 100644
--- a/sys/arch/mvme88k/dev/vx.c
+++ b/sys/arch/mvme88k/dev/vx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vx.c,v 1.9 2001/08/26 02:37:07 miod Exp $ */
+/* $OpenBSD: vx.c,v 1.10 2001/08/31 01:05:44 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -43,6 +43,7 @@
#include <machine/cpu.h>
#include <machine/autoconf.h>
+#include <machine/psl.h>
#include <dev/cons.h>
@@ -54,13 +55,15 @@
#include <mvme88k/dev/vme.h>
#endif
-#include <machine/psl.h>
+#ifdef DDB
+#include <ddb/db_variables.h>
+#endif
+
#define splvx() spltty()
#ifdef DEBUG
#undef DEBUG
#endif
-#define DEBUG_KERN 1
struct vx_info {
struct tty *tty;
@@ -1295,8 +1298,9 @@ vx_break (sc, port)
struct vxsoftc *sc;
int port;
{
-#ifdef DEBUG_KERN
- Debugger();
+#ifdef DDB
+ if (db_console != 0)
+ Debugger();
#else
log(LOG_WARNING, "%s port %d: break detected\n", sc->sc_dev.dv_xname, port);
#endif