[lwip 2/2] Move and rename sys_arch_data_sync_barier()

Kinsey Moore kinsey.moore at oarcorp.com
Thu Mar 9 13:46:28 UTC 2023


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.

On Thu, Mar 9, 2023 at 6:13 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> This function is not present in the lwIP mainline.  Move it to the only
> user and rename it to tms570__data_sync_barier().
> ---
>  uLan/ports/driver/tms570_emac/tms570_netif.c | 16 ++++++++++++----
>  uLan/ports/os/rtems/arch/sys_arch.h          |  5 -----
>  2 files changed, 12 insertions(+), 9 deletions(-)
>
> diff --git a/uLan/ports/driver/tms570_emac/tms570_netif.c
> b/uLan/ports/driver/tms570_emac/tms570_netif.c
> index 8d14687..e166869 100644
> --- a/uLan/ports/driver/tms570_emac/tms570_netif.c
> +++ b/uLan/ports/driver/tms570_emac/tms570_netif.c
> @@ -151,6 +151,14 @@ static void tms570_eth_init_netif_fill(struct netif
> *netif);
>  static void tms570_eth_init_buffer_descriptors(struct tms570_netif_state
> *nf_state);
>  static void tms570_eth_init_set_pinmux();
>
> +static inline void
> +tms570_data_sync_barier(void)
> +{
> +#ifdef __arm__
> +  _ARM_Data_synchronization_barrier();
> +#endif
> +}
> +
>  /***** initializing functions
> **********************************************/
>
>
> @@ -685,7 +693,7 @@ tms570_eth_send_raw(struct netif *netif, struct pbuf
> *pbuf)
>    if (curr_bd == NULL)
>      txch->inactive_tail = curr_bd;
>
> -  sys_arch_data_sync_barier();
> +  tms570_data_sync_barier();
>
>    if (txch->active_tail == NULL) {
>      txch->active_head = packet_head;
> @@ -767,7 +775,7 @@ tms570_eth_process_irq_rx(void *arg)
>      unsigned int processed_rx_len = 0;
>      int corrupt_fl = 0;
>
> -    sys_arch_data_sync_barier();
> +    tms570_data_sync_barier();
>
>      pbuf = curr_bd->pbuf;
>      total_rx_len = curr_bd->flags_pktlen & 0xFFFF;
> @@ -1086,7 +1094,7 @@ tms570_eth_rx_pbuf_refill(struct tms570_netif_state
> *nf_state, int single_fl)
>        rxch->inactive_head = curr_bd->next;
>
>        curr_bd->next = NULL;
> -      sys_arch_data_sync_barier();
> +      tms570_data_sync_barier();
>
>        if (rxch->active_head == NULL) {
>          rxch->active_head = curr_head;
> @@ -1094,7 +1102,7 @@ tms570_eth_rx_pbuf_refill(struct tms570_netif_state
> *nf_state, int single_fl)
>          tms570_eth_hw_set_RX_HDP(nf_state, rxch->active_head);
>        } else {
>          rxch->active_tail->next = curr_head;
> -        sys_arch_data_sync_barier();
> +        tms570_data_sync_barier();
>          if ((rxch->active_tail->flags_pktlen & EMAC_DSC_FLAG_EOQ) != 0)
>            tms570_eth_hw_set_RX_HDP(nf_state, rxch->active_head);
>          rxch->active_tail = curr_bd;
> diff --git a/uLan/ports/os/rtems/arch/sys_arch.h
> b/uLan/ports/os/rtems/arch/sys_arch.h
> index 6ec578b..eb85e3b 100644
> --- a/uLan/ports/os/rtems/arch/sys_arch.h
> +++ b/uLan/ports/os/rtems/arch/sys_arch.h
> @@ -124,11 +124,6 @@ sys_arch_unprotect(sys_prot_t pval)
>  {
>    rtems_interrupt_enable(pval);
>  }
> -
> -static inline void
> -sys_arch_data_sync_barier(void){
> -  _ARM_Data_synchronization_barrier();
> -}
>  #else
>  sys_prot_t sys_arch_protect();
>
> --
> 2.35.3
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20230309/903df2a1/attachment-0001.htm>


More information about the devel mailing list