<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 10/13/2014 1:06 PM, Hesham Moustafa
wrote:<br>
</div>
<blockquote
cite="mid:CA+wsVCDtJmautE4qNO-1HcYj0mvSQxgtEOLkc5Oas9Vc+tut4Q@mail.gmail.com"
type="cite">
<div dir="ltr">Please have a look at this patch.</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Oct 10, 2014 at 6:45 PM, Hesham
ALMatary <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:heshamelmatary@gmail.com" target="_blank">heshamelmatary@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">---<br>
c/src/lib/libbsp/or1k/or1ksim/clock/clockdrv.c | 2 +-<br>
c/src/lib/libbsp/or1k/or1ksim/console/uart.c | 15
+++++++++++----<br>
2 files changed, 12 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/c/src/lib/libbsp/or1k/or1ksim/clock/clockdrv.c
b/c/src/lib/libbsp/or1k/or1ksim/clock/clockdrv.c<br>
index ad49d07..4169a11 100644<br>
--- a/c/src/lib/libbsp/or1k/or1ksim/clock/clockdrv.c<br>
+++ b/c/src/lib/libbsp/or1k/or1ksim/clock/clockdrv.c<br>
@@ -137,8 +137,8 @@ CPU_Counter_ticks
_CPU_Counter_difference(<br>
<br>
#define Clock_driver_support_install_isr(isr, old_isr) \<br>
do { \<br>
- or1ksim_clock_handler_install(isr, old_isr);
\<br>
old_isr = NULL; \<br>
+ or1ksim_clock_handler_install(isr, old_isr); \<br>
} while (0)<br>
<br>
</blockquote>
</div>
</div>
</blockquote>
Is old_isr an ISR or a pointer to an ISR method? I was wondering<br>
if that should be *old_isr and be set in or1k_clock_handler_install.<br>
<blockquote
cite="mid:CA+wsVCDtJmautE4qNO-1HcYj0mvSQxgtEOLkc5Oas9Vc+tut4Q@mail.gmail.com"
type="cite">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
#define Clock_driver_support_shutdown_hardware()
or1ksim_clock_cleanup()<br>
diff --git a/c/src/lib/libbsp/or1k/or1ksim/console/uart.c
b/c/src/lib/libbsp/or1k/or1ksim/console/uart.c<br>
index 7ceca81..31cdce6 100644<br>
--- a/c/src/lib/libbsp/or1k/or1ksim/console/uart.c<br>
+++ b/c/src/lib/libbsp/or1k/or1ksim/console/uart.c<br>
</blockquote>
</div>
</div>
</blockquote>
This all looks right. I did this same thing to a LOT of BSPs. :(<br>
<blockquote
cite="mid:CA+wsVCDtJmautE4qNO-1HcYj0mvSQxgtEOLkc5Oas9Vc+tut4Q@mail.gmail.com"
type="cite">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
@@ -21,6 +21,14 @@<br>
#include <bsp/uart.h><br>
#include <rtems/score/isr.h><br>
<br>
+static void uart_initialize(int minor);<br>
+static int uart_first_open(int major, int minor, void
*arg);<br>
+static int uart_last_close(int major, int minor, void
*arg);<br>
+static int uart_read_polled(int minor);<br>
+static ssize_t uart_write(int minor, const char *buf,
size_t len);<br>
+static void uart_write_polled(int minor, char c);<br>
+static int uart_set_attributes(int minor, const struct
termios *t);<br>
+<br>
static rtems_vector_number uart_get_irq_number(const
console_tbl *ct)<br>
{<br>
return ct->ulIntVector;<br>
@@ -86,10 +94,9 @@ static int uart_last_close(int major, int
minor, void *arg)<br>
return 0;<br>
}<br>
<br>
-static char uart_read_polled(int minor)<br>
+static int uart_read_polled(int minor)<br>
{<br>
unsigned char lsr;<br>
- char c;<br>
<br>
/* Get a character when avaiable */<br>
do {<br>
@@ -120,7 +127,7 @@ static void uart_write_polled(int minor,
char c)<br>
} while ( (lsr & transmit_finished) !=
transmit_finished );<br>
}<br>
<br>
-static ssize_t uart_write_support_polled(<br>
+static ssize_t uart_write(<br>
int minor,<br>
const char *s,<br>
size_t n<br>
@@ -145,7 +152,7 @@ const console_fns or1ksim_uart_fns = {<br>
.deviceFirstOpen = uart_first_open,<br>
.deviceLastClose = uart_last_close,<br>
.deviceRead = uart_read_polled,<br>
- .deviceWrite = uart_write_support_polled,<br>
+ .deviceWrite = uart_write,<br>
.deviceInitialize = uart_initialize,<br>
.deviceWritePolled = uart_write_polled,<br>
.deviceSetAttributes = uart_set_attributes,<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.3<br>
<br>
</font></span></blockquote>
</div>
<br>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985</pre>
</body>
</html>