<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 13, 2014 at 8:24 PM, Joel Sherrill <span dir="ltr"><<a href="mailto:joel.sherrill@oarcorp.com" target="_blank">joel.sherrill@oarcorp.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF" text="#000000"><span class="">
    <br>
    <div>On 10/13/2014 1:06 PM, Hesham Moustafa
      wrote:<br>
    </div>
    <blockquote 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 href="mailto:heshamelmatary@gmail.com" target="_blank">heshamelmatary@gmail.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style: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></span>
    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.</div></blockquote><div>It's a pointer to the ISR method, and initially 0 (Null) within the ISR vector table. Since Clock_driver_support_install_isr is first called when installing the clock driver, old_isr would be always Null. Other BSPs do the same thing. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><span class=""><br>
    <blockquote type="cite">
      <div class="gmail_extra">
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style: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></span>
    This all looks right. I did this same thing to a LOT of BSPs. :(<div><div class="h5"><br>
    <blockquote type="cite">
      <div class="gmail_extra">
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style: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><font color="#888888">--<br>
                1.9.3<br>
                <br>
              </font></span></blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    </div></div><span class=""><font color="#888888"><pre cols="72">-- 
Joel Sherrill, Ph.D.             Director of Research & Development
<a href="mailto:joel.sherrill@OARcorp.com" target="_blank">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>
  </font></span></div>

</blockquote></div><br></div></div>