diff options
author | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2003-08-28 11:20:54 +0000 |
---|---|---|
committer | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2003-08-28 11:20:54 +0000 |
commit | 65463a64006d8dad0c14dc722832d168759cf9c8 (patch) | |
tree | bd3c5eec4e4fd9b73456379d2cee7e892d6c2444 /sys/pc98 | |
parent | d7e9ef77f8a592224a6c3f7361745eea4b7b7249 (diff) | |
download | src-65463a64006d8dad0c14dc722832d168759cf9c8.tar.gz src-65463a64006d8dad0c14dc722832d168759cf9c8.zip |
Merged from sys/dev/sio/sio.c revisions 1.403 and 1.404.
Notes
Notes:
svn path=/head/; revision=119525
Diffstat (limited to 'sys/pc98')
-rw-r--r-- | sys/pc98/cbus/sio.c | 49 | ||||
-rw-r--r-- | sys/pc98/pc98/sio.c | 49 |
2 files changed, 30 insertions, 68 deletions
diff --git a/sys/pc98/cbus/sio.c b/sys/pc98/cbus/sio.c index c1cecb491a34..620735c3cce0 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 diff --git a/sys/pc98/pc98/sio.c b/sys/pc98/pc98/sio.c index c1cecb491a34..620735c3cce0 100644 --- a/sys/pc98/pc98/sio.c +++ b/sys/pc98/pc98/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 |