<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><span>Hello,</span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br></span></div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">Submitting the patch again. Hope I've made all the corrections that I mentioned in my previous email. The network.c file in arm csb337 currently uses 4 space indent in many functions. For the current function at91rm9200_emac_init() , I've made all the statements use 2 space indents. If the main changes in the following patch regarding the generic framework are correct, I'll update the whole file to use 2 space indent
later.</div><div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="background-color: transparent;"><div style="background-color: transparent;"><span style="font-size: 13px;">commit 9e50e8f22be111aff9f8725bcef6d99f2a6d36f5</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">Author: Vipul Nayyar <nayyar_vipul@yahoo.com></span></div><div style="background-color: transparent;"><span style="font-size: 13px;">Date: Fri Jul 5 20:53:33 2013 +0530</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"><br></span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> Updated Legacy code in arm csb337</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"><br></span></div><div style="background-color:
transparent;"><span style="font-size: 13px;">diff --git a/c/src/lib/libbsp/arm/csb337/network/network.c b/c/src/lib/libbsp/arm/csb337/network/network.c</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">index e31bcc0..f577e8e 100644</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">--- a/c/src/lib/libbsp/arm/csb337/network/network.c</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+++ b/c/src/lib/libbsp/arm/csb337/network/network.c</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">@@ -22,6 +22,7 @@</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> #include <errno.h></span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> #include
<rtems/error.h></span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+#include <assert.h></span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> #include <sys/param.h></span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> #include <sys/mbuf.h></span></div><div style="background-color: transparent;"><span style="font-size: 13px;">@@ -83,19 +84,9 @@</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> #define START_TRANSMIT_EVENT RTEMS_EVENT_2</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> static void at91rm9200_emac_isr
(rtems_irq_hdl_param unused);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-static void at91rm9200_emac_isr_on(const rtems_irq_connect_data *unused);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-static void at91rm9200_emac_isr_off(const rtems_irq_connect_data *unused);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-static int at91rm9200_emac_isr_is_on(const rtems_irq_connect_data *irq);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-/* Replace the first value with the clock's interrupt name. */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-rtems_irq_connect_data at91rm9200_emac_isr_data = {</span></div><div style="background-color: transparent;"><span
style="font-size: 13px;">- AT91RM9200_INT_EMAC,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- at91rm9200_emac_isr,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- NULL,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- at91rm9200_emac_isr_on,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- at91rm9200_emac_isr_off,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- at91rm9200_emac_isr_is_on</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-};</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+static void at91rm9200_emac_isr_on();</span></div><div style="background-color: transparent;"><span
style="font-size: 13px;">+static void at91rm9200_emac_isr_off();</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+static int at91rm9200_emac_isr_is_on();</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> /* use the values defined in linkcmds for our use of SRAM */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">@@ -356,51 +347,61 @@ int rtems_at91rm9200_emac_attach (</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> void at91rm9200_emac_init(void *arg)</span></div><div style="background-color: transparent;"><span
style="font-size: 13px;"> {</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- at91rm9200_emac_softc_t *sc = arg;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- struct ifnet *ifp = &sc->arpcom.ac_if;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ at91rm9200_emac_softc_t *sc = arg;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ struct ifnet *ifp = &sc->arpcom.ac_if;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ rtems_status_code status = RTEMS_SUCCESSFUL;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ /*</span></div><div
style="background-color: transparent;"><span style="font-size: 13px;">+ *This is for stuff that only gets done once (at91rm9200_emac_init()</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ * gets called multiple times</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ if (sc->txDaemonTid == 0) {</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ /* Set up EMAC hardware */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ at91rm9200_emac_init_hw(sc);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ /*
Start driver tasks */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ sc->rxDaemonTid = rtems_bsdnet_newproc("ENrx",</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ 4096,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ at91rm9200_emac_rxDaemon,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ sc);</span></div><div style="background-color:
transparent;"><span style="font-size: 13px;">+ sc->txDaemonTid = rtems_bsdnet_newproc("ENtx",</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ 4096,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ at91rm9200_emac_txDaemon,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ sc);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ } /* if
txDaemonTid */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ /* set our priority in the AIC */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ AIC_SMR_REG(AIC_SMR_EMAC) = AIC_SMR_PRIOR(EMAC_INT_PRIORITY);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ /* install the interrupt handler */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ status = rtems_interrupt_handler_install(</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ AT91RM9200_INT_EMAC,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+
"Network",</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ RTEMS_INTERRUPT_UNIQUE,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ at91rm9200_emac_isr,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ NULL</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ ); </span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ at91rm9200_emac_isr_on(); </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- /*</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- *This is for stuff that only gets done once
(at91rm9200_emac_init()</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- * gets called multiple times</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- if (sc->txDaemonTid == 0) {</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- /* Set up EMAC hardware */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- at91rm9200_emac_init_hw(sc);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- /* Start driver tasks */</span></div><div
style="background-color: transparent;"><span style="font-size: 13px;">- sc->rxDaemonTid = rtems_bsdnet_newproc("ENrx",</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- 4096,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- at91rm9200_emac_rxDaemon,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- sc);</span></div><div
style="background-color: transparent;"><span style="font-size: 13px;">- sc->txDaemonTid = rtems_bsdnet_newproc("ENtx",</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- 4096,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- at91rm9200_emac_txDaemon,</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- sc);</span></div><div
style="background-color: transparent;"><span style="font-size: 13px;">- } /* if txDaemonTid */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- /* set our priority in the AIC */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- AIC_SMR_REG(AIC_SMR_EMAC) = AIC_SMR_PRIOR(EMAC_INT_PRIORITY);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- /* install the interrupt handler */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- BSP_install_rtems_irq_handler(&at91rm9200_emac_isr_data);</span></div><div style="background-color: transparent;"><span style="font-size:
13px;">-</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- /* EMAC doesn't support promiscuous, so ignore requests */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- if (ifp->if_flags & IFF_PROMISC) {</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- printk ("Warning - AT91RM9200 Ethernet driver"</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ assert(status == RTEMS_SUCCESSFUL);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ /* EMAC doesn't support promiscuous, so ignore requests */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ if (ifp->if_flags
& IFF_PROMISC) {</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ printk ("Warning - AT91RM9200 Ethernet driver"</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> " doesn't support Promiscuous Mode!\n");</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- }</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ }</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- /*</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- * Tell the world that we're running.</span></div><div style="background-color: transparent;"><span
style="font-size: 13px;">- */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- ifp->if_flags |= IFF_RUNNING;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ /*</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ * Tell the world that we're running.</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ ifp->if_flags |= IFF_RUNNING;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- /* Enable TX/RX and clear the statistics counters */</span></div><div style="background-color: transparent;"><span style="font-size:
13px;">- EMAC_REG(EMAC_CTL) = (EMAC_CTL_TE | EMAC_CTL_RE | EMAC_CTL_CSR);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ /* Enable TX/RX and clear the statistics counters */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ EMAC_REG(EMAC_CTL) = (EMAC_CTL_TE | EMAC_CTL_RE | EMAC_CTL_CSR);</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- /* clear any pending interrupts */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- EMAC_REG(EMAC_TSR) = 0xffffffff;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">- EMAC_REG(EMAC_RSR) = 0xffffffff;</span></div><div style="background-color: transparent;"><span
style="font-size: 13px;">+ /* clear any pending interrupts */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ EMAC_REG(EMAC_TSR) = 0xffffffff;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+ EMAC_REG(EMAC_RSR) = 0xffffffff;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> } /* at91rm9200_emac_init() */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;">@@ -767,7 +768,7 @@ void at91rm9200_emac_stats (at91rm9200_emac_softc_t *sc)</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span
style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> /* Enables at91rm9200_emac interrupts. */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-static void at91rm9200_emac_isr_on(const rtems_irq_connect_data *unused)</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+static void at91rm9200_emac_isr_on()</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> {</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> /* Enable various TX/RX interrupts */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> EMAC_REG(EMAC_IER) = (EMAC_INT_RCOM | /* Receive complete */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">@@ -780,7 +781,7 @@
static void at91rm9200_emac_isr_on(const rtems_irq_connect_data *unused)</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> }</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> </span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> /* Disables at91rm9200_emac interrupts */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-static void at91rm9200_emac_isr_off(const rtems_irq_connect_data *unused)</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+static void at91rm9200_emac_isr_off()</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> {</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> /* disable all various TX/RX interrupts */</span></div><div
style="background-color: transparent;"><span style="font-size: 13px;"> EMAC_REG(EMAC_IDR) = 0xffffffff;</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">@@ -791,7 +792,7 @@ static void at91rm9200_emac_isr_off(const rtems_irq_connect_data *unused)</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> * returns non-0 if so.</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> * If interrupt is not enabled, returns 0.</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">-static int at91rm9200_emac_isr_is_on(const rtems_irq_connect_data *irq)</span></div><div style="background-color: transparent;"><span style="font-size: 13px;">+static int at91rm9200_emac_isr_is_on()</span></div><div
style="background-color: transparent;"><span style="font-size: 13px;"> {</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> return EMAC_REG(EMAC_IMR); /* any interrupts enabled? */</span></div><div style="background-color: transparent;"><span style="font-size: 13px;"> }</span></div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;"><br></div></div><div style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">Regards</div><div style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span style="background-color:transparent;line-height:1.22;">Vipul Nayyar </span></div><div style="font-family: arial, helvetica, clean, sans-serif; font-size:
12.727272033691406px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><br></div> <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Joel Sherrill <joel.sherrill@oarcorp.com><br> <b><span style="font-weight: bold;">To:</span></b> Vipul Nayyar <nayyar_vipul@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "sebastian.huber@embedded-brains.de" <sebastian.huber@embedded-brains.de>; "rtems-devel@rtems.org" <rtems-devel@rtems.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Friday, 5 July 2013 6:59 PM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Patch]
Removing legacy method from arm csb337<br> </font> </div> <div class="y_msg_container"><br><div id="yiv0136898726">
<div>
<div class="yiv0136898726moz-cite-prefix">On 7/4/2013 10:24 AM, Vipul Nayyar
wrote:<br>
</div>
<blockquote type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 10pt;">
<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><span>Hello,</span></div>
<div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br>
</span></div>
<div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span>Before submitting a
patch again, I wanted to clarify some things which I
understood & places where I need a little more guidance,
so that I do things the right way. </span></div>
<div style="font-family: arial, helvetica, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span><br>
</span></div>
<div style="background-color:transparent;"><span><font size="2">1)
Before submitting any patch I'll definitely compile it
first. </font></span><span style="font-size:13px;">So do
I need to bootstrap, run the configure </span><span style="font-size:10pt;">using specific BSP name &
target in cmd options </span><span style="
background-color:transparent;"><font size="2">at top of RTEMS tree and do
make every time, I change something ? Or is there a
simpler method ?</font></span></div>
<div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="
background-color:transparent;"><font size="2"><br>
</font></span></div>
</div>
</blockquote>
<font size="2"><font size="2">Sebastian pointed out that you can
build all ARM BSPs in one pass. Or specify a set of<br>
<font size="2">BSPs with --enable-rtemsbsp="XXX YYY".<br>
<br>
<font size="2">I don't think you<font size="2"> need to run
bootstrap after your tree is cloned and bootstrapped once.<br>
<font size="2">It only needs to be run if you add<font size="2"> files, delete files, or something else that
i<font size="2">m<font size="2">pacts the<br>
<font size="2">configure<font size="2">.ac or
Makefile.am files<font size="2">. But you can
run bootstrap from any directory with<br>
<font size="2">a configure.ac and it will
handle things recursively from there. If
you are working on a single<br>
<font size="2">BSP<font size="2">, it
saves a lot of time.<br>
<br>
<font size="2">You also should<font size="2">n't need to build all the
tests. I would recommend
--enable-tests<font size="2">=samples<br>
<font size="2">and --<font size="2">disable-posix on
your build. I believe you
still want to have
networking enabled be<font size="2">cause<br>
<font size="2">t<font size="2">here are
network drivers.<br>
<br>
<font size="2"><font size="2"><font size="2"></font><br>
</font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font>
<blockquote type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 10pt;">
<div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="
background-color:transparent;"><font size="2">2) According to the legacy
method BSP_install_rtems_irq_handler, it uses the 'on' (
at91rm9200_emac_isr_on() in case of csb337) function only
after calling rtems_interrupt_handler_install. And these
functions require a pointer to a rtems_irq_connect_data
type.So I should probably remove that parameter from the
function definition right ?</font></span></div>
<div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="
background-color:transparent;"><font size="2"><br>
</font></span></div>
</div>
</blockquote>
<font size="2">Sebastian.</font><br>
<blockquote type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 10pt;">
<div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="
background-color:transparent;"><font size="2">3) rtems_interrupt_handler_install()
does not accept pointer to the </font></span><span style="font-size:small;"> </span><span style="
font-size:13px;">rtems_irq_connect_data type , so it definitely does
not use at91rm9200_emac_isr_off()
& at91rm9200_emac_isr_is_on() functions. I think we
should remove these 2 functions, because they're not being
used in the any csb337 file.</span></div>
<div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="font-size:13px;"><br>
</span></div>
</div>
</blockquote>
Sebastian..<br>
<blockquote type="cite">
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: arial, helvetica, sans-serif; font-size: 10pt;">
<div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="font-size:13px;">4) If you
say so, I'll use assert() for time being. Plus, do I need to
include <assert.h> ? If yes, then in each file where I
used assert() or it can be included somewhere central ?</span></div>
<div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><br>
</div>
<div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;">Hoping to hear from you</div>
<div style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br>
</div>
<div style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">Regards</div>
<div style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span style="background-color:transparent;line-height:1.22;">Vipul
Nayyar </span></div>
<div style="font-family: arial, helvetica, clean, sans-serif; font-size: 12.727272033691406px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br>
</div>
<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><br>
</div>
<div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">
<div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;">
<div dir="ltr">
<hr size="1"> <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Sebastian
Huber <a rel="nofollow" class="yiv0136898726moz-txt-link-rfc2396E" ymailto="mailto:sebastian.huber@embedded-brains.de" target="_blank" href="mailto:sebastian.huber@embedded-brains.de"><sebastian.huber@embedded-brains.de></a><br>
<b><span style="font-weight:bold;">To:</span></b> Vipul
Nayyar <a rel="nofollow" class="yiv0136898726moz-txt-link-rfc2396E" ymailto="mailto:nayyar_vipul@yahoo.com" target="_blank" href="mailto:nayyar_vipul@yahoo.com"><nayyar_vipul@yahoo.com></a> <br>
<b><span style="font-weight:bold;">Cc:</span></b>
<a rel="nofollow" class="yiv0136898726moz-txt-link-rfc2396E" ymailto="mailto:rtems-devel@rtems.org" target="_blank" href="mailto:rtems-devel@rtems.org">"rtems-devel@rtems.org"</a> <a rel="nofollow" class="yiv0136898726moz-txt-link-rfc2396E" ymailto="mailto:rtems-devel@rtems.org" target="_blank" href="mailto:rtems-devel@rtems.org"><rtems-devel@rtems.org></a>;
Joel Sherrill <a rel="nofollow" class="yiv0136898726moz-txt-link-rfc2396E" ymailto="mailto:joel.sherrill@oarcorp.com" target="_blank" href="mailto:joel.sherrill@oarcorp.com"><joel.sherrill@oarcorp.com></a> <br>
<b><span style="font-weight:bold;">Sent:</span></b>
Wednesday, 3 July 2013 12:37 PM<br>
<b><span style="font-weight:bold;">Subject:</span></b>
Re: [Patch] Removing legacy method from arm csb337<br>
</font> </div>
<div class="yiv0136898726y_msg_container"><br>
On 07/02/2013 01:26 PM, Vipul Nayyar wrote:<br>
> Hello,<br>
><br>
> Thanks for pointing out the mistakes in the previous
patches. Updated the<br>
> csb337 patch, and did away with the use of
rtems_irq_connect_data structure in<br>
> the file. Is this what you were suggesting ? Hoping
I've followed the<br>
> indentation rules.<br>
><br>
> commit d24fbcb472b0164ed4e6b51233155df7f6dd57b4<br>
> Author: Vipul Nayyar <<a rel="nofollow" ymailto="mailto:nayyar_vipul@yahoo.com" target="_blank" href="mailto:nayyar_vipul@yahoo.com">nayyar_vipul@yahoo.com</a>><br>
> Date: Tue Jul 2 16:52:29 2013 +0530<br>
><br>
> Updated Legacy code in arm csb337<br>
><br>
> diff --git
a/c/src/lib/libbsp/arm/csb337/network/network.c<br>
> b/c/src/lib/libbsp/arm/csb337/network/network.c<br>
> index e31bcc0..1c1dd0e 100644<br>
> --- a/c/src/lib/libbsp/arm/csb337/network/network.c<br>
> +++ b/c/src/lib/libbsp/arm/csb337/network/network.c<br>
> @@ -87,17 +87,6 @@ static void
at91rm9200_emac_isr_on(const<br>
> rtems_irq_connect_data *unused);<br>
> static void at91rm9200_emac_isr_off(const
rtems_irq_connect_data *unused);<br>
> static int at91rm9200_emac_isr_is_on(const
rtems_irq_connect_data *irq);<br>
> -/* Replace the first value with the clock's
interrupt name. */<br>
> -rtems_irq_connect_data at91rm9200_emac_isr_data = {<br>
> - AT91RM9200_INT_EMAC,<br>
> - at91rm9200_emac_isr,<br>
> - NULL,<br>
> - at91rm9200_emac_isr_on,<br>
> - at91rm9200_emac_isr_off,<br>
> - at91rm9200_emac_isr_is_on<br>
<br>
Where are the at91rm9200_emac_isr_on(),
at91rm9200_emac_isr_off() and <br>
at91rm9200_emac_isr_is_on() called now? Did you compile
the code after the <br>
changes? You should get warnings now about unused static
functions.<br>
<br>
Are they really all superfluous?<br>
<br>
> -};<br>
> -<br>
> -<br>
> /* use the values defined in linkcmds for our use of
SRAM */<br>
> extern void * at91rm9200_emac_rxbuf_hdrs;<br>
> extern void * at91rm9200_emac_txbuf;<br>
> @@ -358,6 +347,7 @@ void at91rm9200_emac_init(void
*arg)<br>
> {<br>
> at91rm9200_emac_softc_t *sc = arg;<br>
> struct ifnet *ifp = &sc->arpcom.ac_if;<br>
> + rtems_status_code status = RTEMS_SUCCESSFUL;<br>
> /*<br>
> *This is for stuff that only gets done once
(at91rm9200_emac_init()<br>
> @@ -382,7 +372,19 @@ void at91rm9200_emac_init(void
*arg)<br>
> AIC_SMR_REG(AIC_SMR_EMAC) =
AIC_SMR_PRIOR(EMAC_INT_PRIORITY);<br>
> /* install the interrupt handler */<br>
> -
BSP_install_rtems_irq_handler(&at91rm9200_emac_isr_data);<br>
> + status = rtems_interrupt_handler_install(<br>
> + AT91RM9200_INT_EMAC,<br>
> + "Network",<br>
> + RTEMS_INTERRUPT_UNIQUE,<br>
> + at91rm9200_emac_isr,<br>
> + NULL<br>
> + );<br>
> + if (status != RTEMS_SUCCESSFUL) {<br>
> + rtems_fatal(<br>
> + RTEMS_FATAL_SOURCE_BSP_SPECIFIC,<br>
> + BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION<br>
> + );<br>
> + }<br>
[...]<br>
<br>
As I wrote before, the indentation level is two
characters.<br>
<br>
The purpose of the fatal errors is<br>
<br>
1. terminate the system, and<br>
2. allow the exact identification of the error source in
the code.<br>
<br>
From 2. follows that a (source, code) pair must be used a
most once in the <br>
RTEMS source code.<br>
<br>
In the documentation we have:<br>
<br>
<a rel="nofollow" target="_blank" href="http://www.rtems.org/onlinedocs/doxygen/cpukit/html/group__ScoreIntErr.html#ga878b4de77df7d0b83d19609d4de42c26">http://www.rtems.org/onlinedocs/doxygen/cpukit/html/group__ScoreIntErr.html#ga878b4de77df7d0b83d19609d4de42c26</a><br>
<br>
[...]<br>
RTEMS_FATAL_SOURCE_BSP_GENERIC <br>
<br>
Fatal source for generic BSP errors.<br>
<br>
The fatal codes are defined in
<bsp/generic-fatal.h>. Examples are interrupt <br>
and exception initialization.<br>
<br>
See also:<br>
bsp_generic_fatal_code and bsp_generic_fatal().<br>
<br>
RTEMS_FATAL_SOURCE_BSP_SPECIFIC <br>
<br>
Fatal source for BSP specific errors.<br>
<br>
The fatal code is BSP specific.<br>
[...]<br>
<br>
The BSP_GENERIC_FATAL_INTERRUPT_INITIALIZATION is generic
BSP error code, so <br>
don't use it with RTEMS_FATAL_SOURCE_BSP_SPECIFIC.<br>
<br>
I would use simply assert(). If there is time, we can
change all the assert() <br>
into BSP specific fatal errors later.<br>
<br>
-- <br>
Sebastian Huber, embedded brains GmbH<br>
<br>
Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>
Phone : +49 89 189 47 41-16<br>
Fax : +49 89 189 47 41-09<br>
E-Mail : <a rel="nofollow" ymailto="mailto:sebastian.huber@embedded-brains.de" target="_blank" href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a><br>
PGP : Public key available on request.<br>
<br>
Diese Nachricht ist keine geschäftliche Mitteilung im
Sinne des EHUG.<br>
<br>
<br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
<br>
<pre class="yiv0136898726moz-signature">--
Joel Sherrill, Ph.D. Director of Research & Development
<a rel="nofollow" class="yiv0136898726moz-txt-link-abbreviated" ymailto="mailto:joel.sherrill@OARcorp.com" target="_blank" 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>
</div>
</div><br><br></div> </div> </div> </div></body></html>