diff options
author | iedowse <iedowse@FreeBSD.org> | 2001-06-20 16:47:23 +0000 |
---|---|---|
committer | iedowse <iedowse@FreeBSD.org> | 2001-06-20 16:47:23 +0000 |
commit | a4c30a870ecf7d7d23259d7902957c614a43491c (patch) | |
tree | 9c65929450215310ad4e0f96a7fcbd7ba74e4341 /sys/dev | |
parent | 8a223ad3ced39a21f12ed05f9d6b6adc39bb4ab3 (diff) | |
download | FreeBSD-src-a4c30a870ecf7d7d23259d7902957c614a43491c.zip FreeBSD-src-a4c30a870ecf7d7d23259d7902957c614a43491c.tar.gz |
The serial console break-to-debugger support only functioned while
the console device was open. At other times, the interrupts that
are used to detect the break signal or ~^B sequence were disabled,
so these events would not be noticed until the next open (e.g. the
next kernel printf). This was mainly a problem while there was no
getty running on the console, such as during bootup or shutdown.
For serial consoles with break-to-debugger support, we now enable
the generation of interrupts at attach time, and we leave them
enabled while the device is closed.
Reviewed by: bde (I've since made chages as per his suggestions)
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sio/sio.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 1bbf598..954ebd4 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -1356,6 +1356,16 @@ determined_type: ; } if (ret) device_printf(dev, "could not activate interrupt\n"); +#if defined(DDB) && (defined(BREAK_TO_DEBUGGER) || \ + defined(ALT_BREAK_TO_DEBUGGER)) + /* + * Enable interrupts for early break-to-debugger support + * on the console. + */ + if (ret == 0 && unit == comconsole) + outb(siocniobase + com_ier, IER_ERXRDY | IER_ERLS | + IER_EMSC); +#endif } return (0); @@ -1597,9 +1607,19 @@ comhardclose(com) com->do_dcd_timestamp = FALSE; com->pps.ppsparam.mode = 0; sio_setreg(com, com_cfcr, com->cfcr_image &= ~CFCR_SBREAK); + tp = com->tp; + +#if defined(DDB) && (defined(BREAK_TO_DEBUGGER) || \ + defined(ALT_BREAK_TO_DEBUGGER)) + /* + * Leave interrupts enabled and don't clear DTR if this is the + * console. This allows us to detect break-to-debugger events + * while the console device is closed. + */ + if (com->unit != comconsole) +#endif { sio_setreg(com, com_ier, 0); - tp = com->tp; if (tp->t_cflag & HUPCL /* * XXX we will miss any carrier drop between here and the |