[rtems-libbsd commit] Callout: Redefine callout_reset_on for rtems

Chris Johns chrisj at rtems.org
Wed Sep 16 05:53:33 UTC 2020


Module:    rtems-libbsd
Branch:    master
Commit:    5cfbb629b6b63d420d741016ff8df21b1666be1d
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=5cfbb629b6b63d420d741016ff8df21b1666be1d

Author:    Jan Sommer <jan.sommer at dlr.de>
Date:      Fri Aug 14 21:57:51 2020 +0200

Callout: Redefine callout_reset_on for rtems

- callout_reset_on takes a cpu which is ignored by the subsequent call
to callout_reset_sbt_on in RTEMS.
- The macro is redefined to discard the cpu argument directly which
enables uses of it with cpu-dependent variables (disabled in
RETMS) without further changes, e.g. in iflib.c.

---

 freebsd/sys/sys/callout.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/freebsd/sys/sys/callout.h b/freebsd/sys/sys/callout.h
index e5e5df8..d7b9965 100644
--- a/freebsd/sys/sys/callout.h
+++ b/freebsd/sys/sys/callout.h
@@ -112,9 +112,15 @@ int	callout_reset_sbt_on(struct callout *, sbintime_t, sbintime_t,
 #define	callout_reset_sbt_curcpu(c, sbt, pr, fn, arg, flags)		\
     callout_reset_sbt_on((c), (sbt), (pr), (fn), (arg), PCPU_GET(cpuid),\
         (flags))
+#ifndef __rtems__
 #define	callout_reset_on(c, to_ticks, fn, arg, cpu)			\
     callout_reset_sbt_on((c), tick_sbt * (to_ticks), 0, (fn), (arg),	\
         (cpu), C_HARDCLOCK)
+#else /* __rtems__ */
+#define	callout_reset_on(c, to_ticks, fn, arg, cpu)			\
+    callout_reset_sbt_on((c), tick_sbt * (to_ticks), 0, (fn), (arg),	\
+        -1, C_HARDCLOCK)
+#endif /* __rtems__ */
 #define	callout_reset(c, on_tick, fn, arg)				\
     callout_reset_on((c), (on_tick), (fn), (arg), -1)
 #define	callout_reset_curcpu(c, on_tick, fn, arg)			\



More information about the vc mailing list