summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--i386/i386at/com.c27
-rw-r--r--i386/i386at/com.h4
2 files changed, 30 insertions, 1 deletions
diff --git a/i386/i386at/com.c b/i386/i386at/com.c
index 5e65ad8..619e1af 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -518,10 +518,35 @@ comintr(int unit)
case RECi:
case CTIi: /* Character timeout indication */
if (tp->t_state&TS_ISOPEN) {
+ int escape = 0;
while ((line = inb(LINE_STAT(addr))) & iDR) {
c = inb(TXRX(addr));
- ttyinput(c, tp);
+
+ if (c == 0x1b) {
+ escape = 1;
+ continue;
+ }
+
+#if MACH_KDB
+ if (escape && c == 'D'-'@')
+ /* ctrl-alt-d pressed,
+ invoke debugger */
+ kdb_kintr();
+ else
+#endif /* MACH_KDB */
+ if (escape) {
+ ttyinput(0x1b, tp);
+ ttyinput(c, tp);
+ }
+ else
+ ttyinput(c, tp);
+
+ escape = 0;
}
+
+ if (escape)
+ /* just escape */
+ ttyinput(0x1b, tp);
} else
tt_open_wakeup(tp);
break;
diff --git a/i386/i386at/com.h b/i386/i386at/com.h
index 95baa45..779cdba 100644
--- a/i386/i386at/com.h
+++ b/i386/i386at/com.h
@@ -71,6 +71,10 @@ comsetstat(
int *data,
natural_t count);
+#if MACH_KDB
+extern void kdb_kintr(void);
+#endif /* MACH_KDB */
+
extern io_return_t comopen(dev_t dev, int flag, io_req_t ior);
extern void comclose(dev_t dev, int flag);
extern io_return_t comread(dev_t dev, io_req_t ior);