[rtems commit] score: Rename tc_getfrequency()
Sebastian Huber
sebh at rtems.org
Mon May 23 07:04:27 UTC 2022
Module: rtems
Branch: master
Commit: ac4ea5366482dad9150c5aaa652b71c00960741f
Changeset: http://git.rtems.org/rtems/commit/?id=ac4ea5366482dad9150c5aaa652b71c00960741f
Author: Gabriel Moyano <gabriel.moyano at dlr.de>
Date: Fri May 20 11:29:57 2022 +0200
score: Rename tc_getfrequency()
Rename tc_getfrequency() to _Timecounter_Get_frequency().
Update #2349.
---
cpukit/include/rtems/score/timecounter.h | 8 ++++++++
cpukit/include/sys/timetc.h | 10 ++++++++++
cpukit/score/src/kern_tc.c | 2 +-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/cpukit/include/rtems/score/timecounter.h b/cpukit/include/rtems/score/timecounter.h
index 1ecfc02085..ae1e2612f8 100644
--- a/cpukit/include/rtems/score/timecounter.h
+++ b/cpukit/include/rtems/score/timecounter.h
@@ -292,6 +292,14 @@ void _Timecounter_Set_NTP_update_second(
*/
void _Timecounter_NTP_update_second(int64_t *adjustment, time_t *newsec);
+/**
+ * @brief Gets the frequency in Hz of the current timecounter at some time
+ * point during the call.
+ *
+ * @return Returns the frequency in Hz.
+ */
+uint64_t _Timecounter_Get_frequency(void);
+
/** @} */
#ifdef __cplusplus
diff --git a/cpukit/include/sys/timetc.h b/cpukit/include/sys/timetc.h
index 5cdfdfe9b3..1ef58b378d 100644
--- a/cpukit/include/sys/timetc.h
+++ b/cpukit/include/sys/timetc.h
@@ -16,6 +16,10 @@
#ifndef _KERNEL
#error "no user-serviceable parts inside"
#endif
+#else /* __rtems__ */
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
#endif /* __rtems__ */
/*-
@@ -36,6 +40,7 @@ struct vdso_timehands32;
typedef u_int timecounter_get_t(struct timecounter *);
#else /* __rtems__ */
typedef uint32_t timecounter_get_t(struct timecounter *);
+#define tc_getfrequency _Timecounter_Get_frequency
#endif /* __rtems__ */
typedef void timecounter_pps_t(struct timecounter *);
typedef uint32_t timecounter_fill_vdso_timehands_t(struct vdso_timehands *,
@@ -104,4 +109,9 @@ void cpu_tick_calibration(void);
SYSCTL_DECL(_kern_timecounter);
#endif
+#ifdef __rtems__
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __rtems__ */
#endif /* !_SYS_TIMETC_H_ */
diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c
index c22ce121a4..2e2ffd8ef1 100644
--- a/cpukit/score/src/kern_tc.c
+++ b/cpukit/score/src/kern_tc.c
@@ -1513,7 +1513,6 @@ unlock:
#endif /* __rtems__ */
}
-#ifndef __rtems__
/* Report the frequency of the current timecounter. */
uint64_t
tc_getfrequency(void)
@@ -1522,6 +1521,7 @@ tc_getfrequency(void)
return (timehands->th_counter->tc_frequency);
}
+#ifndef __rtems__
static bool
sleeping_on_old_rtc(struct thread *td)
{
More information about the vc
mailing list