From ffb8833dd28418cb7e427f0a0469bfc49e18ecf2 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 28 Oct 2021 11:14:57 +0200 Subject: score: Add _Timecounter_Set_NTP_update_second() Allow the installation of an NTP update second handler which may be used by an NTP service. Update #2348. --- cpukit/include/rtems/score/timecounter.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'cpukit/include/rtems/score/timecounter.h') diff --git a/cpukit/include/rtems/score/timecounter.h b/cpukit/include/rtems/score/timecounter.h index 8185140f9b..39f0dc353e 100644 --- a/cpukit/include/rtems/score/timecounter.h +++ b/cpukit/include/rtems/score/timecounter.h @@ -8,7 +8,7 @@ */ /* - * Copyright (c) 2015 embedded brains GmbH. All rights reserved. + * Copyright (c) 2015, 2021 embedded brains GmbH. All rights reserved. * * embedded brains GmbH * Dornierstr. 4 @@ -248,6 +248,28 @@ extern volatile int32_t _Timecounter_Time_uptime; */ extern struct timecounter *_Timecounter; +/** + * @brief Handler doing the NTP update second processing shall have this type. + * + * @param[in, out] adjustment is the NTP time adjustment. + * + * @param[in, out] newsec is the number of seconds since Unix epoch. + */ +typedef void ( *Timecounter_NTP_update_second )( + int64_t *adjustment, + time_t *newsec +); + +/** + * @brief Sets the NTP update second handler. + * + * @param handler is the new NTP update second handler used to carry out the + * NTP update second processing. + */ +void _Timecounter_Set_NTP_update_second( + Timecounter_NTP_update_second handler +); + /** @} */ #ifdef __cplusplus -- cgit v1.2.3