summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2015-04-02 09:52:42 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2015-04-02 09:52:42 -0500
commitbbad85e85affa9083c9f292f0460d4138f3cd917 (patch)
treeeb3a63bc7bfe57528203faab2e90e91e820467a5
parentAdd configurations for erc32, leon2, and leon3 in GDB SIS (diff)
downloadrtems-tools-bbad85e85affa9083c9f292f0460d4138f3cd917.tar.bz2
Update gdb-sim-lm32uart.diff to gdb-7.9
-rw-r--r--tools/4.11/gdb/lm32/gdb-7.9-lm32uart.diff75
1 files changed, 75 insertions, 0 deletions
diff --git a/tools/4.11/gdb/lm32/gdb-7.9-lm32uart.diff b/tools/4.11/gdb/lm32/gdb-7.9-lm32uart.diff
new file mode 100644
index 0000000..aed5f52
--- /dev/null
+++ b/tools/4.11/gdb/lm32/gdb-7.9-lm32uart.diff
@@ -0,0 +1,75 @@
+diff -ur gdb-7.9.orig/sim/lm32/dv-lm32uart.c gdb-7.9/sim/lm32/dv-lm32uart.c
+--- gdb-7.9.orig/sim/lm32/dv-lm32uart.c 2015-02-19 05:58:08.000000000 -0600
++++ gdb-7.9/sim/lm32/dv-lm32uart.c 2015-04-01 17:21:09.078882329 -0500
+@@ -22,9 +22,6 @@
+ #include "hw-main.h"
+ #include "sim-assert.h"
+
+-#include <stdio.h>
+-#include <sys/time.h>
+-
+ struct lm32uart
+ {
+ unsigned base; /* Base address of this UART. */
+@@ -38,6 +35,8 @@
+ unsigned char lsr;
+ unsigned char msr;
+ unsigned char div;
++ int saved_count;
++ char saved_byte;
+ struct hw_event *event;
+ };
+
+@@ -83,6 +82,7 @@
+ static void
+ do_uart_tx_event (struct hw *me, void *data)
+ {
++ SIM_DESC sd = hw_system (me);
+ struct lm32uart *uart = hw_data (me);
+ char c;
+
+@@ -115,7 +115,8 @@
+ c &= 0x7f;
+ break;
+ }
+- printf ("%c", c);
++ sim_io_write_stdout (sd, &c, 1);
++ sim_io_flush_stdout (sd);
+ }
+
+ static unsigned
+@@ -200,6 +201,7 @@
+ void *dest,
+ int space, unsigned_word base, unsigned nr_bytes)
+ {
++ SIM_DESC sd = hw_system (me);
+ struct lm32uart *uart = hw_data (me);
+ int uart_reg;
+ int value;
+@@ -214,7 +216,8 @@
+ switch (uart_reg)
+ {
+ case LM32_UART_RBR:
+- value = getchar ();
++ value = uart->saved_byte;
++ --uart->saved_count;
+ uart->lsr &= ~LM32_UART_LSR_RX_RDY;
+ break;
+ case LM32_UART_IER:
+@@ -231,12 +234,10 @@
+ break;
+ case LM32_UART_LSR:
+ /* Check to see if any data waiting in stdin. */
+- FD_ZERO (&fd);
+- FD_SET (fileno (stdin), &fd);
+- tv.tv_sec = 0;
+- tv.tv_usec = 1;
+- if (select (fileno (stdin) + 1, &fd, NULL, NULL, &tv))
+- uart->lsr |= LM32_UART_LSR_RX_RDY;
++ if (uart->saved_count <= 0)
++ uart->saved_count = sim_io_poll_read (sd, 0/*STDIN*/,
++ &uart->saved_byte, 1);
++ uart->lsr |= uart->saved_count ? LM32_UART_LSR_RX_RDY : 0;
+ value = uart->lsr;
+ break;
+ case LM32_UART_MSR: