<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-03-03)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
<font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>Formatting.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2759&r2=text&tr2=1.2760&diff_format=h">M</a></td><td width='1%'>1.2760</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2346.2.79&r2=text&tr2=1.2346.2.80&diff_format=h">M</a></td><td width='1%'>1.2346.2.80</td><td width='100%'>cpukit/ChangeLog</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2759 rtems/cpukit/ChangeLog:1.2760
--- rtems/cpukit/ChangeLog:1.2759 Thu Mar 3 00:22:47 2011
+++ rtems/cpukit/ChangeLog Thu Mar 3 07:34:45 2011
</font><font color='#997700'>@@ -1,8 +1,9 @@
</font> 2011-03-03 Chris Johns <chrisj@rtems.org>
<font color='#880000'>- * libcsupport/src/mknod.c, libfs/src/rfs/rtems-rfs-inode.c: PR
- 1749. Fix the incorrect handling of the file type in the mode
- value to reject invalid types as per the standard.
</font><font color='#000088'>+ PR 1749/filesystem
+ * libcsupport/src/mknod.c, libfs/src/rfs/rtems-rfs-inode.c:
+ Fix the incorrect handling of the file type in the mode value
+ to reject invalid types as per the standard.
</font>
2011-03-02 Ralf Corsépius <ralf.corsepius@rtems.org>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2346.2.79 rtems/cpukit/ChangeLog:1.2346.2.80
--- rtems/cpukit/ChangeLog:1.2346.2.79 Thu Mar 3 00:33:14 2011
+++ rtems/cpukit/ChangeLog Thu Mar 3 07:34:34 2011
</font><font color='#997700'>@@ -1,8 +1,9 @@
</font> 2011-03-03 Chris Johns <chrisj@rtems.org>
<font color='#880000'>- * libcsupport/src/mknod.c, libfs/src/rfs/rtems-rfs-inode.c: PR
- 1749. Fix the incorrect handling of the file type in the mode
- value to reject invalid types as per the standard.
</font><font color='#000088'>+ PR 1749/filesystem
+ * libcsupport/src/mknod.c, libfs/src/rfs/rtems-rfs-inode.c:<span style="background-color: #FF0000"> </span>
+ Fix the incorrect handling of the file type in the mode value<span style="background-color: #FF0000"> </span>
+ to reject invalid types as per the standard.
</font>
2011-02-08 Brett Swimley <bswimley@advanced.pro>
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
<font color='#225522'><em>(on branch rtems-4-9-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-03 Chris Johns <chrisj@rtems.org>
PR 1749/filesystem
* libcsupport/src/mknod.c: Fix the incorrect handling of the file type
in the mode value o reject invalid types as per the standard.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.1539.2.70&r2=text&tr2=1.1539.2.71&diff_format=h">M</a></td><td width='1%'>1.1539.2.71</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libcsupport/src/mknod.c.diff?r1=text&tr1=1.13&r2=text&tr2=1.13.6.1&diff_format=h">M</a></td><td width='1%'>1.13.6.1</td><td width='100%'>cpukit/libcsupport/src/mknod.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.1539.2.70 rtems/cpukit/ChangeLog:1.1539.2.71
--- rtems/cpukit/ChangeLog:1.1539.2.70 Fri Jan 21 13:40:35 2011
+++ rtems/cpukit/ChangeLog Thu Mar 3 07:38:50 2011
</font><font color='#997700'>@@ -1,3 +1,9 @@
</font><font color='#000088'>+2011-03-03 Chris Johns <chrisj@rtems.org>
+
+ PR 1749/filesystem
+ * libcsupport/src/mknod.c: Fix the incorrect handling of the file type
+ in the mode value o reject invalid types as per the standard.
+
</font> 2011-01-21 Eric Norum <wenorum@lbl.gov>
* libmisc/capture/capture.c: Avoid using TCB of task just deleted.
<font color='#006600'>diff -u rtems/cpukit/libcsupport/src/mknod.c:1.13 rtems/cpukit/libcsupport/src/mknod.c:1.13.6.1
--- rtems/cpukit/libcsupport/src/mknod.c:1.13 Sun Apr 18 01:05:34 2004
+++ rtems/cpukit/libcsupport/src/mknod.c Thu Mar 3 07:38:52 2011
</font><font color='#997700'>@@ -40,8 +40,19 @@
</font> const char *name_start;
int result;
<font color='#880000'>- if ( !(mode & (S_IFREG|S_IFCHR|S_IFBLK|S_IFIFO) ) )
- rtems_set_errno_and_return_minus_one( EINVAL );
</font><font color='#000088'>+ /*
+ * The file type is field within the mode. Check we have a sane mode set.
+ */
+ switch (mode & S_IFMT) {
+ case S_IFDIR:
+ case S_IFCHR:
+ case S_IFBLK:
+ case S_IFREG:
+ case S_IFIFO:
+ break;
+ default:
+ rtems_set_errno_and_return_minus_one( EINVAL );
+ }
</font>
if ( S_ISFIFO(mode) )
rtems_set_errno_and_return_minus_one( ENOTSUP );
</pre>
<p> </p>
<a name='cs3'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-03 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1750/bsps
* console/erc32_console.c, make/custom/erc32.cfg: The new console
driver did not support polled mode. It also had a bug in which it
could lose a transmitter interrupt.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog.diff?r1=text&tr1=1.162&r2=text&tr2=1.163&diff_format=h">M</a></td><td width='1%'>1.163</td><td width='100%'>c/src/lib/libbsp/sparc/erc32/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c.diff?r1=text&tr1=1.2&r2=text&tr2=1.3&diff_format=h">M</a></td><td width='1%'>1.3</td><td width='100%'>c/src/lib/libbsp/sparc/erc32/console/erc32_console.c</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/erc32/make/custom/erc32.cfg.diff?r1=text&tr1=1.4&r2=text&tr2=1.5&diff_format=h">M</a></td><td width='1%'>1.5</td><td width='100%'>c/src/lib/libbsp/sparc/erc32/make/custom/erc32.cfg</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog:1.162 rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog:1.163
--- rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog:1.162 Mon Feb 28 14:14:29 2011
+++ rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog Thu Mar 3 08:03:40 2011
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2011-03-03 Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+ PR 1750/bsps
+ * console/erc32_console.c, make/custom/erc32.cfg: The new console
+ driver did not support polled mode. It also had a bug in which it
+ could lose a transmitter interrupt.
+
</font> 2011-02-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* console/erc32_console.c: Add polled support. Tinker with interrupt
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c:1.2 rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c:1.3
--- rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c:1.2 Mon Feb 28 14:14:29 2011
+++ rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c Thu Mar 3 08:03:41 2011
</font><font color='#997700'>@@ -36,25 +36,25 @@
</font>
static uint8_t erc32_console_get_register(uint32_t addr, uint8_t i)
{
<font color='#880000'>- volatile uint32_t *reg = (volatile uint32_t *)addr;
- return (uint8_t) reg [i];
</font><font color='#000088'>+ volatile uint32_t *reg = (volatile uint32_t *)addr;
+ return (uint8_t) reg [i];
</font> }
static void erc32_console_set_register(uint32_t addr, uint8_t i, uint8_t val)
{
<font color='#880000'>- volatile uint32_t *reg = (volatile uint32_t *)addr;
- reg [i] = val;
</font><font color='#000088'>+ volatile uint32_t *reg = (volatile uint32_t *)addr;
+ reg [i] = val;
</font> }
static int erc32_console_first_open(int major, int minor, void *arg);
#if (CONSOLE_USE_INTERRUPTS)
<font color='#880000'>-static ssize_t erc32_console_write_support_int(
</font><font color='#000088'>+ static ssize_t erc32_console_write_support_int(
</font> int minor, const char *buf, size_t len);
#else
<font color='#880000'>-int console_inbyte_nonblocking( int port );
-static ssize_t erc32_console_write_support_polled(
- int minor, const char *buf, size_t len);
</font><font color='#000088'>+ int console_inbyte_nonblocking( int port );
+ static ssize_t erc32_console_write_support_polled(
+ int minor, const char *buf, size_t len);
</font> #endif
static void erc32_console_initialize(int minor);
<font color='#997700'>@@ -87,44 +87,44 @@
</font> #endif
console_tbl Console_Port_Tbl [] = {
<font color='#880000'>- {
- .sDeviceName = "/dev/console_a",
- .deviceType = SERIAL_CUSTOM,
- .pDeviceFns = &erc32_fns,
- .deviceProbe = NULL,
- .pDeviceFlow = NULL,
- .ulMargin = 16,
- .ulHysteresis = 8,
- .pDeviceParams = (void *) -1, /* could be baud rate */
- .ulCtrlPort1 = 0,
- .ulCtrlPort2 = 0,
- .ulDataPort = 0,
- .getRegister = erc32_console_get_register,
- .setRegister = erc32_console_set_register,
- .getData = NULL,
- .setData = NULL,
- .ulClock = 16,
- .ulIntVector = ERC32_INTERRUPT_UART_A_RX_TX
- },
- {
- .sDeviceName = "/dev/console_b",
- .deviceType = SERIAL_CUSTOM,
- .pDeviceFns = &erc32_fns,
- .deviceProbe = NULL,
- .pDeviceFlow = NULL,
- .ulMargin = 16,
- .ulHysteresis = 8,
- .pDeviceParams = (void *) -1, /* could be baud rate */
- .ulCtrlPort1 = 0,
- .ulCtrlPort2 = 0,
- .ulDataPort = 0,
- .getRegister = erc32_console_get_register,
- .setRegister = erc32_console_set_register,
- .getData = NULL,
- .setData = NULL,
- .ulClock = 16,
- .ulIntVector = ERC32_INTERRUPT_UART_B_RX_TX
- },
</font><font color='#000088'>+ {
+ .sDeviceName = "/dev/console_a",
+ .deviceType = SERIAL_CUSTOM,
+ .pDeviceFns = &erc32_fns,
+ .deviceProbe = NULL,
+ .pDeviceFlow = NULL,
+ .ulMargin = 16,
+ .ulHysteresis = 8,
+ .pDeviceParams = (void *) -1, /* could be baud rate */
+ .ulCtrlPort1 = 0,
+ .ulCtrlPort2 = 0,
+ .ulDataPort = 0,
+ .getRegister = erc32_console_get_register,
+ .setRegister = erc32_console_set_register,
+ .getData = NULL,
+ .setData = NULL,
+ .ulClock = 16,
+ .ulIntVector = ERC32_INTERRUPT_UART_A_RX_TX
+ },
+ {
+ .sDeviceName = "/dev/console_b",
+ .deviceType = SERIAL_CUSTOM,
+ .pDeviceFns = &erc32_fns,
+ .deviceProbe = NULL,
+ .pDeviceFlow = NULL,
+ .ulMargin = 16,
+ .ulHysteresis = 8,
+ .pDeviceParams = (void *) -1, /* could be baud rate */
+ .ulCtrlPort1 = 0,
+ .ulCtrlPort2 = 0,
+ .ulDataPort = 0,
+ .getRegister = erc32_console_get_register,
+ .setRegister = erc32_console_set_register,
+ .getData = NULL,
+ .setData = NULL,
+ .ulClock = 16,
+ .ulIntVector = ERC32_INTERRUPT_UART_B_RX_TX
+ },
</font> };
/* always exactly two uarts for erc32 */
<font color='#997700'>@@ -136,130 +136,130 @@
</font>
static int erc32_console_first_open(int major, int minor, void *arg)
{
<font color='#880000'>- /* Check minor number */
- if (minor < 0 || minor > 1) {
- return -1;
- }
-<span style="background-color: #FF0000"> </span>
- rtems_libio_open_close_args_t *oca = arg;
- struct rtems_termios_tty *tty = oca->iop->data1;
- console_tbl *ct = &Console_Port_Tbl [minor];
- console_data *cd = &Console_Port_Data [minor];
-<span style="background-color: #FF0000"> </span>
- cd->termios_data = tty;
- rtems_termios_set_initial_baud(tty, (int32_t)ct->pDeviceParams);
-<span style="background-color: #FF0000"> </span>
- return 0;
</font><font color='#000088'>+ /* Check minor number */
+ if (minor < 0 || minor > 1) {
+ return -1;
+ }
+<span style="background-color: #FF0000"> </span>
+ rtems_libio_open_close_args_t *oca = arg;
+ struct rtems_termios_tty *tty = oca->iop->data1;
+ console_tbl *ct = &Console_Port_Tbl [minor];
+ console_data *cd = &Console_Port_Data [minor];
+<span style="background-color: #FF0000"> </span>
+ cd->termios_data = tty;
+ rtems_termios_set_initial_baud(tty, (int32_t)ct->pDeviceParams);
+<span style="background-color: #FF0000"> </span>
+ return 0;
</font> }
#if (CONSOLE_USE_INTERRUPTS)
static ssize_t erc32_console_write_support_int(int minor, const char *buf, size_t len)
{
<font color='#880000'>- console_data *cd = &Console_Port_Data[minor];
- int k = 0;
</font><font color='#000088'>+ console_data *cd = &Console_Port_Data[minor];
+ int k = 0;
</font>
<font color='#880000'>- if (minor == 0) { /* uart a */
- for (k = 0; k < len && (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA); k ++) {
- ERC32_MEC.UART_Channel_A = (unsigned char)buf[k];
- }
- ERC32_Force_interrupt(ERC32_INTERRUPT_UART_A_RX_TX);
- } else { /* uart b */
- for (k = 0; k < len && (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB); k ++) {
- ERC32_MEC.UART_Channel_B = (unsigned char)buf[k];
- }
- ERC32_Force_interrupt(ERC32_INTERRUPT_UART_B_RX_TX);
</font><font color='#000088'>+ if (minor == 0) { /* uart a */
+ for (k = 0;
+ k < len && (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA); k ++) {
+ ERC32_MEC.UART_Channel_A = (unsigned char)buf[k];
</font> }
<font color='#880000'>-<span style="background-color: #FF0000"> </span>
- if (len > 0) {
- cd->pDeviceContext = (void *)k;
- cd->bActive = true;
</font><font color='#000088'>+ ERC32_Force_interrupt(ERC32_INTERRUPT_UART_A_RX_TX);
+ } else { /* uart b */
+ for (k = 0;
+ k < len && (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB); k ++) {
+ ERC32_MEC.UART_Channel_B = (unsigned char)buf[k];
</font> }
<font color='#880000'>-<span style="background-color: #FF0000"> </span>
- return 0;
</font><font color='#000088'>+ ERC32_Force_interrupt(ERC32_INTERRUPT_UART_B_RX_TX);
+ }
+<span style="background-color: #FF0000"> </span>
+ if (len > 0) {
+ cd->pDeviceContext = (void *)k;
+ cd->bActive = true;
+ }
+<span style="background-color: #FF0000"> </span>
+ return 0;
</font> }
static void erc32_console_isr_a(
<font color='#880000'>- rtems_vector_number vector
</font><font color='#000088'>+ rtems_vector_number vector
</font> )
{
<font color='#880000'>- console_data *cd = &Console_Port_Data[0];
</font><font color='#000088'>+ console_data *cd = &Console_Port_Data[0];
</font>
<font color='#880000'>- /* check for error */
- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_ERRA) {
- ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRA;
- ERC32_MEC.Control = ERC32_MEC.Control;
- }
</font><font color='#000088'>+ /* check for error */
+ if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_ERRA) {
+ ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRA;
+ ERC32_MEC.Control = ERC32_MEC.Control;
+ }
</font>
<font color='#880000'>- do {
- int chars_to_dequeue = (int)cd->pDeviceContext;
- int rv = 0;
- int i = 0;
- char buf[CONSOLE_BUF_SIZE];
</font><font color='#000088'>+ do {
+ int chars_to_dequeue = (int)cd->pDeviceContext;
+ int rv = 0;
+ int i = 0;
+ char buf[CONSOLE_BUF_SIZE];
</font>
<font color='#880000'>- /* enqueue received chars */
- while (i < CONSOLE_BUF_SIZE) {
- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRA) {
- buf[i] = ERC32_MEC.UART_Channel_A;
- ++i;
- } else {
- break;
- }
- }
- rtems_termios_enqueue_raw_characters(cd->termios_data, buf, i);
</font><font color='#000088'>+ /* enqueue received chars */
+ while (i < CONSOLE_BUF_SIZE) {
+ if (!(ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRA))
+ break;
+ buf[i] = ERC32_MEC.UART_Channel_A;
+ ++i;
+ }
+ if ( i )<span style="background-color: #FF0000"> </span>
+ rtems_termios_enqueue_raw_characters(cd->termios_data, buf, i);
</font>
<font color='#880000'>- /* dequeue transmitted chars */
</font><font color='#000088'>+ /* dequeue transmitted chars */
+ if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA) {
+ rv = rtems_termios_dequeue_characters(
+ cd->termios_data, chars_to_dequeue);
+ if ( !rv ) {
</font> cd->pDeviceContext = 0;
<font color='#880000'>- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA) {
- rv = rtems_termios_dequeue_characters(
- cd->termios_data, chars_to_dequeue);
- if ( !rv ) {
- cd->bActive = false;
- ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_A_RX_TX);
- }
- }
- } while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_A_RX_TX));
</font><font color='#000088'>+ cd->bActive = false;
+ }
+ ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_A_RX_TX);
+ }
+ } while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_A_RX_TX));
</font> }
static void erc32_console_isr_b(
<font color='#880000'>- rtems_vector_number vector
</font><font color='#000088'>+ rtems_vector_number vector
</font> )
{
<font color='#880000'>- console_data *cd = &Console_Port_Data[1];
</font><font color='#000088'>+ console_data *cd = &Console_Port_Data[1];
</font>
<font color='#880000'>- /* check for error */
- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_ERRB) {
- ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRB;
- ERC32_MEC.Control = ERC32_MEC.Control;
- }
</font><font color='#000088'>+ /* check for error */
+ if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_ERRB) {
+ ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRB;
+ ERC32_MEC.Control = ERC32_MEC.Control;
+ }
</font>
<font color='#880000'>- do {
- int chars_to_dequeue = (int)cd->pDeviceContext;
- int rv = 0;
- int i = 0;
- char buf[CONSOLE_BUF_SIZE];
</font><font color='#000088'>+ do {
+ int chars_to_dequeue = (int)cd->pDeviceContext;
+ int rv = 0;
+ int i = 0;
+ char buf[CONSOLE_BUF_SIZE];
</font>
<font color='#880000'>- /* enqueue received chars */
- while (i < CONSOLE_BUF_SIZE) {
- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRB) {
- buf[i] = ERC32_MEC.UART_Channel_B;
- ++i;
- } else {
- break;
- }
- }
- rtems_termios_enqueue_raw_characters(cd->termios_data, buf, i);
</font><font color='#000088'>+ /* enqueue received chars */
+ while (i < CONSOLE_BUF_SIZE) {
+ if (!(ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRB))
+ break;
+ buf[i] = ERC32_MEC.UART_Channel_B;
+ ++i;
+ }
+ if ( i )<span style="background-color: #FF0000"> </span>
+ rtems_termios_enqueue_raw_characters(cd->termios_data, buf, i);
</font>
<font color='#880000'>- /* dequeue transmitted chars */
</font><font color='#000088'>+ /* dequeue transmitted chars */
+ if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB) {
+ rv = rtems_termios_dequeue_characters(
+ cd->termios_data, chars_to_dequeue);
+ if ( !rv ) {
</font> cd->pDeviceContext = 0;
<font color='#880000'>- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB) {
- rv = rtems_termios_dequeue_characters(
- cd->termios_data, chars_to_dequeue);
- if ( !rv ) {
- cd->bActive = false;
- ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_B_RX_TX);
- }
- }
- } while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_B_RX_TX));
</font><font color='#000088'>+ cd->bActive = false;
+ }
+ ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_B_RX_TX);
+ }
+ } while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_B_RX_TX));
</font> }
#else
<font color='#997700'>@@ -292,23 +292,23 @@
</font> int minor
)
{
<font color='#880000'>- console_data *cd = &Console_Port_Data [minor];
</font><font color='#000088'>+ console_data *cd = &Console_Port_Data [minor];
</font>
<font color='#880000'>- cd->bActive = false;
- cd->pDeviceContext = 0;
</font><font color='#000088'>+ cd->bActive = false;
+ cd->pDeviceContext = 0;
</font>
<font color='#880000'>- /*
- * Initialize the Termios infrastructure. If Termios has already
- * been initialized by another device driver, then this call will
- * have no effect.
- */
- rtems_termios_initialize();
-
- /*
- * Initialize Hardware
- */
-#if (CONSOLE_USE_INTERRUPTS)
</font><font color='#000088'>+ /*
+ * Initialize the Termios infrastructure. If Termios has already
+ * been initialized by another device driver, then this call will
+ * have no effect.
+ */
+ rtems_termios_initialize();
+
+ /*
+ * Initialize Hardware
+ */
+ #if (CONSOLE_USE_INTERRUPTS)
</font> set_vector(erc32_console_isr_a, CONSOLE_UART_A_TRAP, 1);
set_vector(erc32_console_isr_b, CONSOLE_UART_B_TRAP, 1);
<font color='#880000'>-#endif
</font><font color='#000088'>+ #endif
</font> }
</pre>
<p> </p>
<a name='cs4'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
<font color='#bb2222'><strong>joel</strong></font>
<font color='#225522'><em>(on branch rtems-4-10-branch)</em></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-03 Joel Sherrill <joel.sherrilL@OARcorp.com>
PR 1750/bsps
* console/erc32_console.c: The new console driver did not support
polled mode. It also had a bug in which it could lose a transmitter
interrupt.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog.diff?r1=text&tr1=1.152.2.1&r2=text&tr2=1.152.2.2&diff_format=h">M</a></td><td width='1%'>1.152.2.2</td><td width='100%'>c/src/lib/libbsp/sparc/erc32/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c.diff?r1=text&tr1=1.1&r2=text&tr2=1.1.2.1&diff_format=h">M</a></td><td width='1%'>1.1.2.1</td><td width='100%'>c/src/lib/libbsp/sparc/erc32/console/erc32_console.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog:1.152.2.1 rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog:1.152.2.2
--- rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog:1.152.2.1 Wed Feb 2 09:17:14 2011
+++ rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog Thu Mar 3 08:03:48 2011
</font><font color='#997700'>@@ -1,3 +1,10 @@
</font><font color='#000088'>+2011-03-03 Joel Sherrill <joel.sherrilL@OARcorp.com>
+
+ PR 1750/bsps
+ * console/erc32_console.c: The new console driver did not support
+ polled mode. It also had a bug in which it could lose a transmitter
+ interrupt.
+
</font> 2011-02-02 Ralf Corsépius <ralf.corsepius@rtems.org>
* configure.ac: Require autoconf-2.68, automake-1.11.1.
<font color='#006600'>diff -u rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c:1.1 rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c:1.1.2.1
--- rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c:1.1 Fri May 7 07:13:23 2010
+++ rtems/c/src/lib/libbsp/sparc/erc32/console/erc32_console.c Thu Mar 3 08:03:48 2011
</font><font color='#997700'>@@ -27,6 +27,7 @@
</font> #include <libchip/sersupp.h>
#include <bsp.h>
<font color='#000088'>+#include <bspopts.h>
</font>
#define CONSOLE_BUF_SIZE (16)
<font color='#997700'>@@ -35,23 +36,32 @@
</font>
static uint8_t erc32_console_get_register(uint32_t addr, uint8_t i)
{
<font color='#880000'>- volatile uint32_t *reg = (volatile uint32_t *)addr;
- return (uint8_t) reg [i];
</font><font color='#000088'>+ volatile uint32_t *reg = (volatile uint32_t *)addr;
+ return (uint8_t) reg [i];
</font> }
static void erc32_console_set_register(uint32_t addr, uint8_t i, uint8_t val)
{
<font color='#880000'>- volatile uint32_t *reg = (volatile uint32_t *)addr;
- reg [i] = val;
</font><font color='#000088'>+ volatile uint32_t *reg = (volatile uint32_t *)addr;
+ reg [i] = val;
</font> }
static int erc32_console_first_open(int major, int minor, void *arg);
<font color='#880000'>-static ssize_t erc32_console_write_support_int(int minor, const char *buf, size_t len);
</font><font color='#000088'>+
+#if (CONSOLE_USE_INTERRUPTS)
+ static ssize_t erc32_console_write_support_int(
+ int minor, const char *buf, size_t len);
+#else
+ int console_inbyte_nonblocking( int port );
+ static ssize_t erc32_console_write_support_polled(
+ int minor, const char *buf, size_t len);
+#endif
</font> static void erc32_console_initialize(int minor);
rtems_device_minor_number Console_Port_Minor = 0;
<font color='#880000'>-console_fns erc32_fns = {
</font><font color='#000088'>+#if (CONSOLE_USE_INTERRUPTS)
+ console_fns erc32_fns = {
</font> libchip_serial_default_probe, /* deviceProbe */
erc32_console_first_open, /* deviceFirstOpen */
NULL, /* deviceLastClose */
<font color='#997700'>@@ -60,48 +70,61 @@
</font> erc32_console_initialize, /* deviceInitialize */
NULL, /* deviceWritePolled */
NULL, /* deviceSetAttributes */
<font color='#880000'>- true /* deviceOutputUsesInterrupts */
-};
</font><font color='#000088'>+ TERMIOS_IRQ_DRIVEN /* deviceOutputUsesInterrupts */
+ };
+#else
+ console_fns erc32_fns = {
+ libchip_serial_default_probe, /* deviceProbe */
+ erc32_console_first_open, /* deviceFirstOpen */
+ NULL, /* deviceLastClose */
+ console_inbyte_nonblocking, /* deviceRead */
+ erc32_console_write_support_polled, /* deviceWrite */
+ erc32_console_initialize, /* deviceInitialize */
+ NULL, /* deviceWritePolled */
+ NULL, /* deviceSetAttributes */
+ TERMIOS_POLLED /* deviceOutputUsesInterrupts */
+ };
+#endif
</font>
console_tbl Console_Port_Tbl [] = {
<font color='#880000'>- {
- .sDeviceName = "/dev/console",
- .deviceType = SERIAL_CUSTOM,
- .pDeviceFns = &erc32_fns,
- .deviceProbe = NULL,
- .pDeviceFlow = NULL,
- .ulMargin = 16,
- .ulHysteresis = 8,
- .pDeviceParams = (void *) 1,
- .ulCtrlPort1 = 0,
- .ulCtrlPort2 = 0,
- .ulDataPort = 0,
- .getRegister = erc32_console_get_register,
- .setRegister = erc32_console_set_register,
- .getData = NULL,
- .setData = NULL,
- .ulClock = 16,
- .ulIntVector = ERC32_INTERRUPT_UART_A_RX_TX
- },
- {
- .sDeviceName = "/dev/console_b",
- .deviceType = SERIAL_CUSTOM,
- .pDeviceFns = &erc32_fns,
- .deviceProbe = NULL,
- .pDeviceFlow = NULL,
- .ulMargin = 16,
- .ulHysteresis = 8,
- .pDeviceParams = (void *) 1,
- .ulCtrlPort1 = 0,
- .ulCtrlPort2 = 0,
- .ulDataPort = 0,
- .getRegister = erc32_console_get_register,
- .setRegister = erc32_console_set_register,
- .getData = NULL,
- .setData = NULL,
- .ulClock = 16,
- .ulIntVector = ERC32_INTERRUPT_UART_B_RX_TX
- },
</font><font color='#000088'>+ {
+ .sDeviceName = "/dev/console_a",
+ .deviceType = SERIAL_CUSTOM,
+ .pDeviceFns = &erc32_fns,
+ .deviceProbe = NULL,
+ .pDeviceFlow = NULL,
+ .ulMargin = 16,
+ .ulHysteresis = 8,
+ .pDeviceParams = (void *) -1, /* could be baud rate */
+ .ulCtrlPort1 = 0,
+ .ulCtrlPort2 = 0,
+ .ulDataPort = 0,
+ .getRegister = erc32_console_get_register,
+ .setRegister = erc32_console_set_register,
+ .getData = NULL,
+ .setData = NULL,
+ .ulClock = 16,
+ .ulIntVector = ERC32_INTERRUPT_UART_A_RX_TX
+ },
+ {
+ .sDeviceName = "/dev/console_b",
+ .deviceType = SERIAL_CUSTOM,
+ .pDeviceFns = &erc32_fns,
+ .deviceProbe = NULL,
+ .pDeviceFlow = NULL,
+ .ulMargin = 16,
+ .ulHysteresis = 8,
+ .pDeviceParams = (void *) -1, /* could be baud rate */
+ .ulCtrlPort1 = 0,
+ .ulCtrlPort2 = 0,
+ .ulDataPort = 0,
+ .getRegister = erc32_console_get_register,
+ .setRegister = erc32_console_set_register,
+ .getData = NULL,
+ .setData = NULL,
+ .ulClock = 16,
+ .ulIntVector = ERC32_INTERRUPT_UART_B_RX_TX
+ },
</font> };
/* always exactly two uarts for erc32 */
<font color='#997700'>@@ -113,125 +136,152 @@
</font>
static int erc32_console_first_open(int major, int minor, void *arg)
{
<font color='#880000'>- /* Check minor number */
- if (minor < 0 || minor > 1) {
- return -1;
- }
-<span style="background-color: #FF0000"> </span>
- rtems_libio_open_close_args_t *oca = arg;
- struct rtems_termios_tty *tty = oca->iop->data1;
- console_tbl *ct = &Console_Port_Tbl [minor];
- console_data *cd = &Console_Port_Data [minor];
-<span style="background-color: #FF0000"> </span>
- cd->termios_data = tty;
- rtems_termios_set_initial_baud(tty, (int32_t)ct->pDeviceParams);
-<span style="background-color: #FF0000"> </span>
- return 0;
</font><font color='#000088'>+ /* Check minor number */
+ if (minor < 0 || minor > 1) {
+ return -1;
+ }
+<span style="background-color: #FF0000"> </span>
+ rtems_libio_open_close_args_t *oca = arg;
+ struct rtems_termios_tty *tty = oca->iop->data1;
+ console_tbl *ct = &Console_Port_Tbl [minor];
+ console_data *cd = &Console_Port_Data [minor];
+<span style="background-color: #FF0000"> </span>
+ cd->termios_data = tty;
+ rtems_termios_set_initial_baud(tty, (int32_t)ct->pDeviceParams);
+<span style="background-color: #FF0000"> </span>
+ return 0;
</font> }
<font color='#000088'>+#if (CONSOLE_USE_INTERRUPTS)
</font> static ssize_t erc32_console_write_support_int(int minor, const char *buf, size_t len)
{
<font color='#880000'>- console_data *cd = &Console_Port_Data[minor];
- int k = 0;
</font><font color='#000088'>+ console_data *cd = &Console_Port_Data[minor];
+ int k = 0;
</font>
<font color='#880000'>- if (minor == 0) { /* uart a */
- for (k = 0; k < len && (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA); k ++) {
- ERC32_MEC.UART_Channel_A = (unsigned char)buf[k];
- }
- ERC32_Force_interrupt(ERC32_INTERRUPT_UART_A_RX_TX);
- } else { /* uart b */
- for (k = 0; k < len && (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB); k ++) {
- ERC32_MEC.UART_Channel_B = (unsigned char)buf[k];
- }
- ERC32_Force_interrupt(ERC32_INTERRUPT_UART_B_RX_TX);
- }
-<span style="background-color: #FF0000"> </span>
- if (len > 0) {
- cd->pDeviceContext = (void *)k;
- cd->bActive = true;
</font><font color='#000088'>+ if (minor == 0) { /* uart a */
+ for (k = 0;
+ k < len && (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA); k ++) {
+ ERC32_MEC.UART_Channel_A = (unsigned char)buf[k];
+ }
+ ERC32_Force_interrupt(ERC32_INTERRUPT_UART_A_RX_TX);
+ } else { /* uart b */
+ for (k = 0;
+ k < len && (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB); k ++) {
+ ERC32_MEC.UART_Channel_B = (unsigned char)buf[k];
</font> }
<font color='#880000'>-<span style="background-color: #FF0000"> </span>
- return 0;
</font><font color='#000088'>+ ERC32_Force_interrupt(ERC32_INTERRUPT_UART_B_RX_TX);
+ }
+<span style="background-color: #FF0000"> </span>
+ if (len > 0) {
+ cd->pDeviceContext = (void *)k;
+ cd->bActive = true;
+ }
+<span style="background-color: #FF0000"> </span>
+ return 0;
</font> }
static void erc32_console_isr_a(
<font color='#880000'>- rtems_vector_number vector
</font><font color='#000088'>+ rtems_vector_number vector
</font> )
{
<font color='#880000'>- console_data *cd = &Console_Port_Data[0];
</font><font color='#000088'>+ console_data *cd = &Console_Port_Data[0];
</font>
<font color='#880000'>- /* check for error */
- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_ERRA) {
- ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRA;
- ERC32_MEC.Control = ERC32_MEC.Control;
- }
-
- do {
- int chars_to_dequeue = (int)cd->pDeviceContext;
- int rv = 0;
- int i = 0;
- char buf[CONSOLE_BUF_SIZE];
</font><font color='#000088'>+ /* check for error */
+ if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_ERRA) {
+ ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRA;
+ ERC32_MEC.Control = ERC32_MEC.Control;
+ }
+
+ do {
+ int chars_to_dequeue = (int)cd->pDeviceContext;
+ int rv = 0;
+ int i = 0;
+ char buf[CONSOLE_BUF_SIZE];
</font>
<font color='#880000'>- /* enqueue received chars */
- while (i < CONSOLE_BUF_SIZE) {
- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRA) {
- buf[i] = ERC32_MEC.UART_Channel_A;
- ++i;
- } else {
- break;
- }
- }
- rtems_termios_enqueue_raw_characters(cd->termios_data, buf, i);
</font><font color='#000088'>+ /* enqueue received chars */
+ while (i < CONSOLE_BUF_SIZE) {
+ if (!(ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRA))
+ break;
+ buf[i] = ERC32_MEC.UART_Channel_A;
+ ++i;
+ }
+ if ( i )<span style="background-color: #FF0000"> </span>
+ rtems_termios_enqueue_raw_characters(cd->termios_data, buf, i);
</font>
<font color='#880000'>- /* dequeue transmitted chars */
</font><font color='#000088'>+ /* dequeue transmitted chars */
+ if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEA) {
+ rv = rtems_termios_dequeue_characters(
+ cd->termios_data, chars_to_dequeue);
+ if ( !rv ) {
</font> cd->pDeviceContext = 0;
<font color='#880000'>- rv = rtems_termios_dequeue_characters(cd->termios_data, chars_to_dequeue);
- if (rv == 0 && !(ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRA)) {
- cd->bActive = false;
- ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_A_RX_TX);
- }
- } while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_A_RX_TX));
</font><font color='#000088'>+ cd->bActive = false;
+ }
+ ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_A_RX_TX);
+ }
+ } while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_A_RX_TX));
</font> }
static void erc32_console_isr_b(
<font color='#880000'>- rtems_vector_number vector
</font><font color='#000088'>+ rtems_vector_number vector
</font> )
{
<font color='#880000'>- console_data *cd = &Console_Port_Data[1];
-
- /* check for error */
- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_ERRB) {
- ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRB;
- ERC32_MEC.Control = ERC32_MEC.Control;
- }
</font><font color='#000088'>+ console_data *cd = &Console_Port_Data[1];
</font>
<font color='#880000'>- do {
- int chars_to_dequeue = (int)cd->pDeviceContext;
- int rv = 0;
- int i = 0;
- char buf[CONSOLE_BUF_SIZE];
</font><font color='#000088'>+ /* check for error */
+ if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_ERRB) {
+ ERC32_MEC.UART_Status = ERC32_MEC_UART_STATUS_CLRB;
+ ERC32_MEC.Control = ERC32_MEC.Control;
+ }
+
+ do {
+ int chars_to_dequeue = (int)cd->pDeviceContext;
+ int rv = 0;
+ int i = 0;
+ char buf[CONSOLE_BUF_SIZE];
</font>
<font color='#880000'>- /* enqueue received chars */
- while (i < CONSOLE_BUF_SIZE) {
- if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRB) {
- buf[i] = ERC32_MEC.UART_Channel_B;
- ++i;
- } else {
- break;
- }
- }
- rtems_termios_enqueue_raw_characters(cd->termios_data, buf, i);
</font><font color='#000088'>+ /* enqueue received chars */
+ while (i < CONSOLE_BUF_SIZE) {
+ if (!(ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRB))
+ break;
+ buf[i] = ERC32_MEC.UART_Channel_B;
+ ++i;
+ }
+ if ( i )<span style="background-color: #FF0000"> </span>
+ rtems_termios_enqueue_raw_characters(cd->termios_data, buf, i);
</font>
<font color='#880000'>- /* dequeue transmitted chars */
</font><font color='#000088'>+ /* dequeue transmitted chars */
+ if (ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_THEB) {
+ rv = rtems_termios_dequeue_characters(
+ cd->termios_data, chars_to_dequeue);
+ if ( !rv ) {
</font> cd->pDeviceContext = 0;
<font color='#880000'>- rv = rtems_termios_dequeue_characters(cd->termios_data, chars_to_dequeue);
- if (rv == 0 && !(ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRB)) {
- cd->bActive = false;
- ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_B_RX_TX);
- }
- } while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_B_RX_TX));
</font><font color='#000088'>+ cd->bActive = false;
+ }
+ ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_B_RX_TX);
+ }
+ } while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_B_RX_TX));
+}
+#else
+
+extern void console_outbyte_polled( int port, unsigned char ch );
+
+static ssize_t erc32_console_write_support_polled(
+ int minor,
+ const char *buf,
+ size_t len
+)
+{
+ int nwrite = 0;
+
+ while (nwrite < len) {
+ console_outbyte_polled( minor, *buf++ );
+ nwrite++;
+ }
+ return nwrite;
</font> }
<font color='#000088'>+#endif
+
</font>
/*
* Console Device Driver Entry Points
<font color='#997700'>@@ -242,21 +292,23 @@
</font> int minor
)
{
<font color='#880000'>- console_data *cd = &Console_Port_Data [minor];
</font><font color='#000088'>+ console_data *cd = &Console_Port_Data [minor];
</font>
<font color='#880000'>- cd->bActive = false;
- cd->pDeviceContext = 0;
</font><font color='#000088'>+ cd->bActive = false;
+ cd->pDeviceContext = 0;
</font>
<font color='#880000'>- /*
- * Initialize the Termios infrastructure. If Termios has already
- * been initialized by another device driver, then this call will
- * have no effect.
- */
- rtems_termios_initialize();
-
- /*
- * Initialize Hardware
- */
</font><font color='#000088'>+ /*
+ * Initialize the Termios infrastructure. If Termios has already
+ * been initialized by another device driver, then this call will
+ * have no effect.
+ */
+ rtems_termios_initialize();
+
+ /*
+ * Initialize Hardware
+ */
+ #if (CONSOLE_USE_INTERRUPTS)
</font> set_vector(erc32_console_isr_a, CONSOLE_UART_A_TRAP, 1);
set_vector(erc32_console_isr_b, CONSOLE_UART_B_TRAP, 1);
<font color='#000088'>+ #endif
</font> }
</pre>
<p> </p>
<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>