[rtems commit] LEON3: fix console close handling
Daniel Hellstrom
danielh at rtems.org
Mon Jun 30 13:37:48 UTC 2014
Module: rtems
Branch: master
Commit: 9f99232e4b76bc8a02d0d01f7fd2c7725a4662d5
Changeset: http://git.rtems.org/rtems/commit/?id=9f99232e4b76bc8a02d0d01f7fd2c7725a4662d5
Author: Daniel Hellstrom <daniel at gaisler.com>
Date: Fri Jun 13 15:14:54 2014 +0200
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.
---
c/src/lib/libbsp/sparc/leon3/console/console.c | 6 +++---
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 cdfbf2a..8742436 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) {
More information about the vc
mailing list