summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/powerpc/shared/console/console.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2003-02-20 21:32:07 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2003-02-20 21:32:07 +0000
commit4f3e4f33db96df1182c0fb24c987fd9cbed95062 (patch)
tree791e7ffa208a92511c7f899ec4905b8afe24f9c3 /c/src/lib/libbsp/powerpc/shared/console/console.c
parent2003-02-20 Till Straumann <strauman@slac.stanford.edu> (diff)
downloadrtems-4f3e4f33db96df1182c0fb24c987fd9cbed95062.tar.bz2
2003-02-20 Till Straumann <strauman@slac.stanford.edu>
PR 349/bsps * console/console.c, console/uart.c, console/uart.h: implement IOCTLs for the serial (UART) console to install/retrieve a BREAK-IRQ callback. The callback routine (if installed) is invoked from the UART ISR when a BREAK interrupt is detected. This can be used e.g. to enforce a "hotkey" reboot a la vxWorks Ctrl-X (although we use the serial line break condition) NOTE: The callback runs in ISR context.
Diffstat (limited to 'c/src/lib/libbsp/powerpc/shared/console/console.c')
-rw-r--r--c/src/lib/libbsp/powerpc/shared/console/console.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/c/src/lib/libbsp/powerpc/shared/console/console.c b/c/src/lib/libbsp/powerpc/shared/console/console.c
index b6d9b73095..4fcef5a2a9 100644
--- a/c/src/lib/libbsp/powerpc/shared/console/console.c
+++ b/c/src/lib/libbsp/powerpc/shared/console/console.c
@@ -257,11 +257,24 @@ console_write(rtems_device_major_number major,
* Handle ioctl request.
*/
rtems_device_driver
-console_control(rtems_device_major_number major,
- rtems_device_minor_number minor,
- void * arg
+console_control(rtems_device_major_number major,
+ rtems_device_minor_number minor,
+ void *arg
)
{
+/* does the BSP support break callbacks ? */
+#if defined(BIOCSETBREAKCB) && defined(BIOCGETBREAKCB)
+rtems_libio_ioctl_args_t *ioa=arg;
+ switch (ioa->command) {
+ case BIOCSETBREAKCB:
+ return BSP_uart_set_break_cb(minor, ioa);
+ case BIOCGETBREAKCB:
+ return BSP_uart_get_break_cb(minor, ioa);
+
+ default:
+ break;
+ }
+#endif
return rtems_termios_ioctl (arg);
}