summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hellstrom <daniel@gaisler.com>2014-06-13 15:14:54 +0200
committerDaniel Hellstrom <daniel@gaisler.com>2014-06-26 10:25:25 +0200
commit313c3ca2cbde5ac312816f2b9babbae2234195a3 (patch)
tree1cf9c72d92e1000bd0c9ad248307194cb38ae31d
parent2d7215e4ebd0cfafd074f9ce2dfc0f233fcc0a8c (diff)
LEON3: fix console close handling
On SMP rtems_interrupt_lock_context must be used. Most tests fail with a NULL pointer exception when exiting, except on NGMP where main memory is at 0x00000000.
-rw-r--r--c/src/lib/libbsp/sparc/leon3/console/console.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/c/src/lib/libbsp/sparc/leon3/console/console.c b/c/src/lib/libbsp/sparc/leon3/console/console.c
index cdfbf2a599..8742436622 100644
--- a/c/src/lib/libbsp/sparc/leon3/console/console.c
+++ b/c/src/lib/libbsp/sparc/leon3/console/console.c
@@ -355,12 +355,12 @@ static int leon3_console_last_close(int major, int minor, void *arg)
{
struct rtems_termios_tty *tty = leon3_console_get_tty(arg);
struct apbuart_priv *uart = leon3_console_get_uart(minor);
- rtems_interrupt_level level;
+ rtems_interrupt_lock_context lock_ctx;
/* Turn off RX interrupts */
- rtems_termios_interrupt_lock_acquire(tty, level);
+ rtems_termios_interrupt_lock_acquire(tty, &lock_ctx);
uart->regs->ctrl &= ~(LEON_REG_UART_CTRL_RI);
- rtems_termios_interrupt_lock_release(tty, level);
+ rtems_termios_interrupt_lock_release(tty, &lock_ctx);
/**** Flush device ****/
while (uart->sending) {