summaryrefslogtreecommitdiffstats
path: root/sys/pc98/cbus/sio.c
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2003-08-28 11:20:54 +0000
committernyan <nyan@FreeBSD.org>2003-08-28 11:20:54 +0000
commit66f7142c64a948eae88f9d1692f0b37c5be14c52 (patch)
treebd3c5eec4e4fd9b73456379d2cee7e892d6c2444 /sys/pc98/cbus/sio.c
parent6fe35ffd35bfa5d51ae6dba2d9c8c3859d27619f (diff)
downloadFreeBSD-src-66f7142c64a948eae88f9d1692f0b37c5be14c52.zip
FreeBSD-src-66f7142c64a948eae88f9d1692f0b37c5be14c52.tar.gz
Merged from sys/dev/sio/sio.c revisions 1.403 and 1.404.
Diffstat (limited to 'sys/pc98/cbus/sio.c')
-rw-r--r--sys/pc98/cbus/sio.c49
1 files changed, 15 insertions, 34 deletions
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c
index c1cecb4..620735c 100644
--- a/sys/pc98/cbus/sio.c
+++ b/sys/pc98/cbus/sio.c
@@ -133,6 +133,10 @@
#include <sys/rman.h>
#include <sys/timepps.h>
#include <sys/uio.h>
+#include <sys/cons.h>
+#if DDB > 0
+#include <ddb/ddb.h>
+#endif
#include <isa/isavar.h>
@@ -343,6 +347,9 @@ struct com_s {
struct timeval dcd_timestamp;
struct pps_state pps;
int pps_bit;
+#ifdef ALT_BREAK_TO_DEBUGGER
+ int alt_brk_state;
+#endif
u_long bytes_in; /* statistics */
u_long bytes_out;
@@ -2661,35 +2668,13 @@ more_intr:
recv_data = 0;
else
recv_data = inb(com->data_port);
-#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER)
- /*
- * Solaris implements a new BREAK which is initiated
- * by a character sequence CR ~ ^b which is similar
- * to a familiar pattern used on Sun servers by the
- * Remote Console.
- */
-#define KEY_CRTLB 2 /* ^B */
-#define KEY_CR 13 /* CR '\r' */
-#define KEY_TILDE 126 /* ~ */
-
- if (com->unit == comconsole) {
- static int brk_state1 = 0, brk_state2 = 0;
- if (recv_data == KEY_CR) {
- brk_state1 = recv_data;
- brk_state2 = 0;
- } else if (brk_state1 == KEY_CR && (recv_data == KEY_TILDE || recv_data == KEY_CRTLB)) {
- if (recv_data == KEY_TILDE)
- brk_state2 = recv_data;
- else if (brk_state2 == KEY_TILDE && recv_data == KEY_CRTLB) {
- breakpoint();
- brk_state1 = brk_state2 = 0;
- goto cont;
- } else
- brk_state2 = 0;
- } else
- brk_state1 = 0;
- }
-#endif
+#ifdef DDB
+#ifdef ALT_BREAK_TO_DEBUGGER
+ if (com->unit == comconsole &&
+ db_alt_break(recv_data, &com->alt_brk_state) != 0)
+ breakpoint();
+#endif /* ALT_BREAK_TO_DEBUGGER */
+#endif /* DDB */
if (line_status & (LSR_BI | LSR_FE | LSR_PE)) {
/*
* Don't store BI if IGNBRK or FE/PE if IGNPAR.
@@ -3970,8 +3955,6 @@ disc_optim(tp, t, com)
/*
* Following are all routines needed for SIO to act as console
*/
-#include <sys/cons.h>
-
struct siocnstate {
u_char dlbl;
u_char dlbh;
@@ -4006,10 +3989,8 @@ CONS_DRIVER(sio, siocnprobe, siocninit, siocnterm, siocngetc, siocncheckc,
siocnputc, NULL);
#endif
-/* To get the GDB related variables */
#if DDB > 0
-#include <ddb/ddb.h>
-struct consdev gdbconsdev;
+static struct consdev gdbconsdev;
#endif
static void
OpenPOWER on IntegriCloud