diff options
author | Ian Dowse <iedowse@FreeBSD.org> | 2001-06-20 16:47:23 +0000 |
---|---|---|
committer | Ian Dowse <iedowse@FreeBSD.org> | 2001-06-20 16:47:23 +0000 |
commit | 11fbe665c07eb2dbeb0c5963da807863fedaa4a5 (patch) | |
tree | 9c65929450215310ad4e0f96a7fcbd7ba74e4341 /sys/isa | |
parent | 0e79fe6f0edbcbfab25b7803ac03750705883394 (diff) | |
download | src-11fbe665c07eb2dbeb0c5963da807863fedaa4a5.tar.gz src-11fbe665c07eb2dbeb0c5963da807863fedaa4a5.zip |
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)
Notes
Notes:
svn path=/head/; revision=78504
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/sio.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/isa/sio.c b/sys/isa/sio.c index 1bbf598d32f6..954ebd403a7f 100644 --- a/sys/isa/sio.c +++ b/sys/isa/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 |