summaryrefslogtreecommitdiffstats
path: root/sys/dev/ofw
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-02-07 16:20:09 +0000
committerharti <harti@FreeBSD.org>2003-02-07 16:20:09 +0000
commit0dc52ce602578351f1f08cab5e7fb91cb4838655 (patch)
tree6d67c3cdbd98e18b4f2a137a02df867ca8102d1e /sys/dev/ofw
parent06f90317df3eb009169f540a5e8b284c44b2d18d (diff)
downloadFreeBSD-src-0dc52ce602578351f1f08cab5e7fb91cb4838655.zip
FreeBSD-src-0dc52ce602578351f1f08cab5e7fb91cb4838655.tar.gz
Implement the ALT_BREAK_TO_DEBUGGER option for the ofw console. This is very
handy if the machine is on another floor. A minor issue with this is that these functions are also used by the debugger, so its possible to break into the debugger from the debugger. PR: sparc64/47143 Reviewed by: benno Approved by: jake (mentor)
Diffstat (limited to 'sys/dev/ofw')
-rw-r--r--sys/dev/ofw/ofw_console.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys/dev/ofw/ofw_console.c b/sys/dev/ofw/ofw_console.c
index 27f8766..149739f 100644
--- a/sys/dev/ofw/ofw_console.c
+++ b/sys/dev/ofw/ofw_console.c
@@ -28,6 +28,9 @@ static const char rcsid[] =
"$FreeBSD$";
#endif /* not lint */
+#include "opt_ddb.h"
+#include "opt_comconsole.h"
+
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
@@ -39,6 +42,8 @@ static const char rcsid[] =
#include <dev/ofw/openfirm.h>
+#include <ddb/ddb.h>
+
#define OFW_POLL_HZ 4
static d_open_t ofw_dev_open;
@@ -68,6 +73,10 @@ static int polltime;
static struct callout_handle ofw_timeouthandle
= CALLOUT_HANDLE_INITIALIZER(&ofw_timeouthandle);
+#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER)
+static int alt_break_state;
+#endif
+
static void ofw_tty_start(struct tty *);
static int ofw_tty_param(struct tty *, struct termios *);
static void ofw_tty_stop(struct tty *, int);
@@ -296,6 +305,11 @@ ofw_cons_getc(dev_t dev)
}
}
+#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER)
+ if (db_alt_break(ch, &alt_break_state))
+ breakpoint();
+#endif
+
return (ch);
}
@@ -305,6 +319,10 @@ ofw_cons_checkc(dev_t dev)
unsigned char ch;
if (OF_read(stdin, &ch, 1) > 0) {
+#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER)
+ if (db_alt_break(ch, &alt_break_state))
+ breakpoint();
+#endif
return (ch);
}
OpenPOWER on IntegriCloud