<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Normally with rtems-lwip I would complain that this doesn't follow the convention of using #ifdef __rtems__ to modify files from upstream sources (each root directory except rtemslwip has an upstream source), but the uLan authors have given permission to fully integrate this code into the rtemslwip directory where possible (the TI code will go into its own directory). This patch looks good.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 9, 2023 at 6:13 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This function is not present in the lwIP mainline.  Move it to the only<br>
user and rename it to tms570__data_sync_barier().<br>
---<br>
 uLan/ports/driver/tms570_emac/tms570_netif.c | 16 ++++++++++++----<br>
 uLan/ports/os/rtems/arch/sys_arch.h          |  5 -----<br>
 2 files changed, 12 insertions(+), 9 deletions(-)<br>
<br>
diff --git a/uLan/ports/driver/tms570_emac/tms570_netif.c b/uLan/ports/driver/tms570_emac/tms570_netif.c<br>
index 8d14687..e166869 100644<br>
--- a/uLan/ports/driver/tms570_emac/tms570_netif.c<br>
+++ b/uLan/ports/driver/tms570_emac/tms570_netif.c<br>
@@ -151,6 +151,14 @@ static void tms570_eth_init_netif_fill(struct netif *netif);<br>
 static void tms570_eth_init_buffer_descriptors(struct tms570_netif_state *nf_state);<br>
 static void tms570_eth_init_set_pinmux();<br>
<br>
+static inline void<br>
+tms570_data_sync_barier(void)<br>
+{<br>
+#ifdef __arm__<br>
+  _ARM_Data_synchronization_barrier();<br>
+#endif<br>
+}<br>
+<br>
 /***** initializing functions **********************************************/<br>
<br>
<br>
@@ -685,7 +693,7 @@ tms570_eth_send_raw(struct netif *netif, struct pbuf *pbuf)<br>
   if (curr_bd == NULL)<br>
     txch->inactive_tail = curr_bd;<br>
<br>
-  sys_arch_data_sync_barier();<br>
+  tms570_data_sync_barier();<br>
<br>
   if (txch->active_tail == NULL) {<br>
     txch->active_head = packet_head;<br>
@@ -767,7 +775,7 @@ tms570_eth_process_irq_rx(void *arg)<br>
     unsigned int processed_rx_len = 0;<br>
     int corrupt_fl = 0;<br>
<br>
-    sys_arch_data_sync_barier();<br>
+    tms570_data_sync_barier();<br>
<br>
     pbuf = curr_bd->pbuf;<br>
     total_rx_len = curr_bd->flags_pktlen & 0xFFFF;<br>
@@ -1086,7 +1094,7 @@ tms570_eth_rx_pbuf_refill(struct tms570_netif_state *nf_state, int single_fl)<br>
       rxch->inactive_head = curr_bd->next;<br>
<br>
       curr_bd->next = NULL;<br>
-      sys_arch_data_sync_barier();<br>
+      tms570_data_sync_barier();<br>
<br>
       if (rxch->active_head == NULL) {<br>
         rxch->active_head = curr_head;<br>
@@ -1094,7 +1102,7 @@ tms570_eth_rx_pbuf_refill(struct tms570_netif_state *nf_state, int single_fl)<br>
         tms570_eth_hw_set_RX_HDP(nf_state, rxch->active_head);<br>
       } else {<br>
         rxch->active_tail->next = curr_head;<br>
-        sys_arch_data_sync_barier();<br>
+        tms570_data_sync_barier();<br>
         if ((rxch->active_tail->flags_pktlen & EMAC_DSC_FLAG_EOQ) != 0)<br>
           tms570_eth_hw_set_RX_HDP(nf_state, rxch->active_head);<br>
         rxch->active_tail = curr_bd;<br>
diff --git a/uLan/ports/os/rtems/arch/sys_arch.h b/uLan/ports/os/rtems/arch/sys_arch.h<br>
index 6ec578b..eb85e3b 100644<br>
--- a/uLan/ports/os/rtems/arch/sys_arch.h<br>
+++ b/uLan/ports/os/rtems/arch/sys_arch.h<br>
@@ -124,11 +124,6 @@ sys_arch_unprotect(sys_prot_t pval)<br>
 {<br>
   rtems_interrupt_enable(pval);<br>
 }<br>
-<br>
-static inline void<br>
-sys_arch_data_sync_barier(void){<br>
-  _ARM_Data_synchronization_barrier();<br>
-}<br>
 #else<br>
 sys_prot_t sys_arch_protect();<br>
<br>
-- <br>
2.35.3<br>
<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div>