[PATCH v2 06/12] timecounter.h: Rename tc_getfrequency() to _Timecounter_Get_frequency()

Sebastian Huber sebastian.huber at embedded-brains.de
Tue May 3 07:11:45 UTC 2022


On 29/04/2022 09:20, Gabriel Moyano wrote:
> ---
>   cpukit/include/rtems/score/timecounter.h | 7 +++++++
>   cpukit/include/sys/timetc.h              | 3 +++
>   cpukit/score/src/kern_tc.c               | 2 +-
>   3 files changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/cpukit/include/rtems/score/timecounter.h b/cpukit/include/rtems/score/timecounter.h
> index 1ecfc02085..a674d3867a 100644
> --- a/cpukit/include/rtems/score/timecounter.h
> +++ b/cpukit/include/rtems/score/timecounter.h
> @@ -292,6 +292,13 @@ void _Timecounter_Set_NTP_update_second(
>    */
>   void _Timecounter_NTP_update_second(int64_t *adjustment, time_t *newsec);
>   
> +/**
> + * @brief Report the frequency of the current timecounter.

Gets the frequency in Hz of the current timecounter at some time point 
during the call.

> + *
> + * @return time counter frequency.

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..7cc3284b4d 100644
> --- a/cpukit/include/sys/timetc.h
> +++ b/cpukit/include/sys/timetc.h
> @@ -36,6 +36,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 *,
> @@ -94,7 +95,9 @@ extern int tc_min_ticktock_freq; /*
>   				  * required to handle counter wraps.
>   				  */
>   
> +#ifndef __rtems__
>   u_int64_t tc_getfrequency(void);
> +#endif /* __rtems__ */
>   void	tc_init(struct timecounter *tc);
>   void	tc_setclock(struct timespec *ts);
>   void	tc_ticktock(int cnt);
> diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c
> index 76e3e056de..7c2feb5be3 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)
>   {

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list