AW: [PATCH v2 3/3] i386: Port to RTEMS

Jan.Sommer at dlr.de Jan.Sommer at dlr.de
Tue Mar 10 08:12:57 UTC 2020


> -----Ursprüngliche Nachricht-----
> Von: Sommer, Jan
> Gesendet: Montag, 9. März 2020 16:11
> An: devel at rtems.org
> Cc: Sommer, Jan
> Betreff: [PATCH v2 3/3] i386: Port to RTEMS
> 
> - Update imported files to compile rtems-libbsd for i386 based BSPs
> ---
>  freebsd/sbin/sysctl/sysctl.c                 |    8 +
>  freebsd/sys/dev/pci/pci_pci.c                |    2 +
>  freebsd/sys/i386/i386/legacy.c               |  381 -------
>  freebsd/sys/i386/include/machine/cpufunc.h   |    2 +
>  freebsd/sys/i386/include/machine/legacyvar.h |   63 -
>  freebsd/sys/net/iflib.c                      |   26 +
>  rtemsbsd/i386/include/machine/clock.h        |    2 +
>  rtemsbsd/include/rtems/bsd/local/opt_acpi.h  |    0
>  rtemsbsd/include/x86/legacyvar.h             |    1 +
>  rtemsbsd/include/x86/specialreg.h            | 1074 ++++++++++++++++++
>  rtemsbsd/include/x86/x86_var.h               |  156 +++
>  11 files changed, 1271 insertions(+), 444 deletions(-)
>  delete mode 100644 freebsd/sys/i386/i386/legacy.c
>  delete mode 100644 freebsd/sys/i386/include/machine/legacyvar.h
>  create mode 100644 rtemsbsd/i386/include/machine/clock.h
>  create mode 100644 rtemsbsd/include/rtems/bsd/local/opt_acpi.h
>  create mode 100644 rtemsbsd/include/x86/legacyvar.h
>  create mode 100644 rtemsbsd/include/x86/specialreg.h
>  create mode 100644 rtemsbsd/include/x86/x86_var.h
> 
[...]

> diff --git a/freebsd/sys/net/iflib.c b/freebsd/sys/net/iflib.c
> index 89bc5e79..09282ac7 100644
> --- a/freebsd/sys/net/iflib.c
> +++ b/freebsd/sys/net/iflib.c
> @@ -1031,8 +1031,13 @@ iflib_netmap_txsync(struct netmap_kring *kring, int
> flags)
>  	}
>  	if (!(ctx->ifc_flags & IFC_NETMAP_TX_IRQ))
>  		if (kring->nr_hwtail != nm_prev(kring->nr_hwcur, lim)) {
> +#ifndef __rtems__
>  			callout_reset_on(&txq->ift_timer, hz < 2000 ? 1 : hz /
> 1000,
>  			    iflib_timer, txq, txq->ift_timer.c_cpu);
> +#else /* __rtems__ */
> +			callout_reset_curcpu(&txq->ift_timer, hz < 2000 ? 1 : hz
> / 1000,
> +			    iflib_timer, txq);

I am not completely sure about all the side effects of replacing callout_reset_on with callout_reset_curcpu, but the struct callout has no "c_cpu" member in RTEMS.
If someone has a better idea, please tell me.

> +#endif /* __rtems__ */
>  	}
>  	return (0);
>  }

[...]



More information about the devel mailing list