diff options
| author | Nate Lawson <njl@FreeBSD.org> | 2003-08-26 05:37:48 +0000 |
|---|---|---|
| committer | Nate Lawson <njl@FreeBSD.org> | 2003-08-26 05:37:48 +0000 |
| commit | 6e433dcdea3c7ca411c6c5a2455d0437b81d331b (patch) | |
| tree | a048a8e7018cf17942e48bf46ce1850ebde3e6e2 /sys/dev/sio/sio.c | |
| parent | 1809be3cd462d071c04e67a2648af4ed71925153 (diff) | |
Notes
Diffstat (limited to 'sys/dev/sio/sio.c')
| -rw-r--r-- | sys/dev/sio/sio.c | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 3ba6d6952289..3d3ffc2141b1 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -73,6 +73,10 @@ __FBSDID("$FreeBSD$"); #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> @@ -257,6 +261,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; @@ -1786,39 +1793,19 @@ siointr1(com) recv_data = 0; else recv_data = inb(com->data_port); -#if defined(DDB) && defined(ALT_BREAK_TO_DEBUGGER) +#ifdef DDB +#ifdef 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 = 0; - brk_state2 = 0; - goto cont; - } else - brk_state2 = 0; - } else - brk_state1 = 0; - } -#endif + 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. @@ -2773,8 +2760,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; @@ -2809,11 +2794,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> static struct consdev gdbconsdev; - #endif static void |
