<!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-02-28)</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>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-02-28 Joel Sherrill <joel.sherrill@oarcorp.com>
* console/erc32_console.c: Add polled support. Tinker with interrupt
handler to not dequeue characters unless TX is empty.
</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.161&r2=text&tr2=1.162&diff_format=h">M</a></td><td width='1%'>1.162</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.2&diff_format=h">M</a></td><td width='1%'>1.2</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.161 rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog:1.162
--- rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog:1.161 Fri Feb 11 04:06:48 2011
+++ rtems/c/src/lib/libbsp/sparc/erc32/ChangeLog Mon Feb 28 14:14:29 2011
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2011-02-28 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * console/erc32_console.c: Add polled support. Tinker with interrupt
+ handler to not dequeue characters unless TX is empty.
+
</font> 2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
* include/tm27.h, startup/spurious.c:
<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.2
--- 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 Mon Feb 28 14:14:29 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'>@@ -46,12 +47,21 @@
</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,19 +70,32 @@
</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",
</font><font color='#000088'>+ .sDeviceName = "/dev/console_a",
</font> .deviceType = SERIAL_CUSTOM,
.pDeviceFns = &erc32_fns,
.deviceProbe = NULL,
.pDeviceFlow = NULL,
.ulMargin = 16,
.ulHysteresis = 8,
<font color='#880000'>- .pDeviceParams = (void *) 1,
</font><font color='#000088'>+ .pDeviceParams = (void *) -1, /* could be baud rate */
</font> .ulCtrlPort1 = 0,
.ulCtrlPort2 = 0,
.ulDataPort = 0,
<font color='#997700'>@@ -91,7 +114,7 @@
</font> .pDeviceFlow = NULL,
.ulMargin = 16,
.ulHysteresis = 8,
<font color='#880000'>- .pDeviceParams = (void *) 1,
</font><font color='#000088'>+ .pDeviceParams = (void *) -1, /* could be baud rate */
</font> .ulCtrlPort1 = 0,
.ulCtrlPort2 = 0,
.ulDataPort = 0,
<font color='#997700'>@@ -129,6 +152,7 @@
</font> return 0;
}
<font color='#000088'>+#if (CONSOLE_USE_INTERRUPTS)
</font> static ssize_t erc32_console_write_support_int(int minor, const char *buf, size_t len)
{
console_data *cd = &Console_Port_Data[minor];
<font color='#997700'>@@ -185,10 +209,13 @@
</font>
/* dequeue transmitted chars */
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)) {
</font><font color='#000088'>+ 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->bActive = false;
ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_A_RX_TX);
<font color='#000088'>+ }
</font> }
} while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_A_RX_TX));
}
<font color='#997700'>@@ -224,13 +251,36 @@
</font>
/* dequeue transmitted chars */
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)) {
</font><font color='#000088'>+ 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->bActive = false;
ERC32_Clear_interrupt (ERC32_INTERRUPT_UART_B_RX_TX);
<font color='#000088'>+ }
</font> }
} while (ERC32_Is_interrupt_pending (ERC32_INTERRUPT_UART_B_RX_TX));
}
<font color='#000088'>+#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;
+}
+
+#endif
</font>
/*
<font color='#997700'>@@ -257,6 +307,8 @@
</font> /*
* Initialize Hardware
*/
<font color='#000088'>+#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>