change log for rtems (2011-02-28)
rtems-vc at rtems.org
rtems-vc at rtems.org
Mon Feb 28 21:10:19 UTC 2011
*joel*:
2011-02-28 Joel Sherrill <joel.sherrill at oarcorp.com>
* console/erc32_console.c: Add polled support. Tinker with interrupt
handler to not dequeue characters unless TX is empty.
M 1.162 c/src/lib/libbsp/sparc/erc32/ChangeLog
M 1.2 c/src/lib/libbsp/sparc/erc32/console/erc32_console.c
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
@@ -1,3 +1,8 @@
+2011-02-28 Joel Sherrill <joel.sherrill at oarcorp.com>
+
+ * console/erc32_console.c: Add polled support. Tinker with interrupt
+ handler to not dequeue characters unless TX is empty.
+
2011-02-11 Ralf Corsépius <ralf.corsepius at rtems.org>
* include/tm27.h, startup/spurious.c:
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
@@ -27,6 +27,7 @@
#include <libchip/sersupp.h>
#include <bsp.h>
+#include <bspopts.h>
#define CONSOLE_BUF_SIZE (16)
@@ -46,12 +47,21 @@
}
static int erc32_console_first_open(int major, int minor, void *arg);
-static ssize_t erc32_console_write_support_int(int minor, const char *buf, size_t len);
+
+#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
static void erc32_console_initialize(int minor);
rtems_device_minor_number Console_Port_Minor = 0;
-console_fns erc32_fns = {
+#if (CONSOLE_USE_INTERRUPTS)
+ console_fns erc32_fns = {
libchip_serial_default_probe, /* deviceProbe */
erc32_console_first_open, /* deviceFirstOpen */
NULL, /* deviceLastClose */
@@ -60,19 +70,32 @@
erc32_console_initialize, /* deviceInitialize */
NULL, /* deviceWritePolled */
NULL, /* deviceSetAttributes */
- true /* deviceOutputUsesInterrupts */
-};
+ 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
console_tbl Console_Port_Tbl [] = {
{
- .sDeviceName = "/dev/console",
+ .sDeviceName = "/dev/console_a",
.deviceType = SERIAL_CUSTOM,
.pDeviceFns = &erc32_fns,
.deviceProbe = NULL,
.pDeviceFlow = NULL,
.ulMargin = 16,
.ulHysteresis = 8,
- .pDeviceParams = (void *) 1,
+ .pDeviceParams = (void *) -1, /* could be baud rate */
.ulCtrlPort1 = 0,
.ulCtrlPort2 = 0,
.ulDataPort = 0,
@@ -91,7 +114,7 @@
.pDeviceFlow = NULL,
.ulMargin = 16,
.ulHysteresis = 8,
- .pDeviceParams = (void *) 1,
+ .pDeviceParams = (void *) -1, /* could be baud rate */
.ulCtrlPort1 = 0,
.ulCtrlPort2 = 0,
.ulDataPort = 0,
@@ -129,6 +152,7 @@
return 0;
}
+#if (CONSOLE_USE_INTERRUPTS)
static ssize_t erc32_console_write_support_int(int minor, const char *buf, size_t len)
{
console_data *cd = &Console_Port_Data[minor];
@@ -185,10 +209,13 @@
/* dequeue transmitted chars */
cd->pDeviceContext = 0;
- rv = rtems_termios_dequeue_characters(cd->termios_data, chars_to_dequeue);
- if (rv == 0 && !(ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRA)) {
+ 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));
}
@@ -224,13 +251,36 @@
/* dequeue transmitted chars */
cd->pDeviceContext = 0;
- rv = rtems_termios_dequeue_characters(cd->termios_data, chars_to_dequeue);
- if (rv == 0 && !(ERC32_MEC.UART_Status & ERC32_MEC_UART_STATUS_DRB)) {
+ 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));
}
+#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
/*
@@ -257,6 +307,8 @@
/*
* Initialize Hardware
*/
+#if (CONSOLE_USE_INTERRUPTS)
set_vector(erc32_console_isr_a, CONSOLE_UART_A_TRAP, 1);
set_vector(erc32_console_isr_b, CONSOLE_UART_B_TRAP, 1);
+#endif
}
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110228/6afa05cd/attachment-0001.html>
More information about the vc
mailing list