summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/sparc/leon3/console/console.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-07 16:28:04 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-10-07 16:35:13 +0200
commit7fd5e89c96cc92254e36012eee733748d255ff29 (patch)
treee17930368a0dbdd460e99808795beaa1f815497f /c/src/lib/libbsp/sparc/leon3/console/console.c
parenttermios: Separate flow control from normal handler (diff)
downloadrtems-7fd5e89c96cc92254e36012eee733748d255ff29.tar.bz2
termios: Partially hide rtems_termios_tty
Move interrupt lock to device context and expose only this structure to the read, write and set attributes device handler. This makes these device handler independent of the general Termios infrastructure suitable for direct use in printk() support.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/sparc/leon3/console/console.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/console/console.c b/c/src/lib/libbsp/sparc/leon3/console/console.c
index 513d45d256..35767ce786 100644
--- a/c/src/lib/libbsp/sparc/leon3/console/console.c
+++ b/c/src/lib/libbsp/sparc/leon3/console/console.c
@@ -36,7 +36,7 @@ int syscon_uart_index __attribute__((weak)) = 0;
static struct apbuart_context apbuarts[BSP_NUMBER_OF_TERMIOS_PORTS];
static int uarts = 0;
-static struct apbuart_context *leon3_console_get_uart(int minor)
+static rtems_termios_device_context *leon3_console_get_context(int minor)
{
struct apbuart_context *uart;
@@ -45,7 +45,9 @@ static struct apbuart_context *leon3_console_get_uart(int minor)
else
uart = &apbuarts[minor - 1];
- return uart;
+ rtems_termios_device_context_initialize(&uart->base, "APBUART");
+
+ return &uart->base;
}
/* AMBA PP find routine. Extract AMBA PnP information into data structure. */
@@ -132,7 +134,7 @@ rtems_device_driver console_initialize(
minor,
handler,
NULL,
- leon3_console_get_uart(syscon_uart_index)
+ leon3_console_get_context(syscon_uart_index)
);
if (status != RTEMS_SUCCESSFUL)
bsp_fatal(LEON3_FATAL_CONSOLE_REGISTER_DEV);
@@ -149,7 +151,7 @@ rtems_device_driver console_initialize(
minor,
handler,
NULL,
- leon3_console_get_uart(syscon_uart_index)
+ leon3_console_get_context(syscon_uart_index)
);
}