2008-11-03 Till Straumann <strauman@slac.stanford.edu>

PR 1332: call BSP_uart_termios_set()/BSP_uart_intr_ctrl()
	only from 'firstOpen' and only if this is a serial console.
This commit is contained in:
Till Straumann
2008-11-03 20:54:33 +00:00
parent f3a4c7a85a
commit c592a7f54a
2 changed files with 21 additions and 9 deletions

View File

@@ -1,3 +1,8 @@
2008-11-03 Till Straumann <strauman@slac.stanford.edu>
PR 1332: call BSP_uart_termios_set()/BSP_uart_intr_ctrl()
only from 'firstOpen' and only if this is a serial console.
2008-03-03 Joel Sherrill <joel.sherrill@OARcorp.com>
* startup/linkcmds: Add wildcard to gcc_except_table section so

View File

@@ -274,6 +274,20 @@ static int console_last_close(int major, int minor, void *arg)
return 0;
}
static int ser_console_first_open(int major, int minor, void *arg)
{
/*
* Pass data area info down to driver
*/
BSP_uart_termios_set(BSPConsolePort,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
return 0;
}
/*-------------------------------------------------------------------------+
| Console device driver OPEN entry point
+--------------------------------------------------------------------------*/
@@ -321,6 +335,8 @@ console_open(rtems_device_major_number major,
cb.write = BSP_uart_termios_write_com2;
}
cb.firstOpen = ser_console_first_open;
status = rtems_termios_open (major, minor, arg, &cb);
if(status != RTEMS_SUCCESSFUL)
@@ -329,15 +345,6 @@ console_open(rtems_device_major_number major,
return status;
}
/*
* Pass data area info down to driver
*/
BSP_uart_termios_set(BSPConsolePort,
((rtems_libio_open_close_args_t *)arg)->iop->data1);
/* Enable interrupts on channel */
BSP_uart_intr_ctrl(BSPConsolePort, BSP_UART_INTR_CTRL_TERMIOS);
return RTEMS_SUCCESSFUL;
}