summaryrefslogtreecommitdiffstats
path: root/cpukit/include/rtems/score/timecounter.h
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-10-28 11:14:57 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-11-15 08:56:54 +0100
commitffb8833dd28418cb7e427f0a0469bfc49e18ecf2 (patch)
treed7e17b6638cfb0fb661a93af6616a57dabac96c7 /cpukit/include/rtems/score/timecounter.h
parentscore: Optimize timehand updates for non-SMP (diff)
downloadrtems-ffb8833dd28418cb7e427f0a0469bfc49e18ecf2.tar.bz2
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.
Diffstat (limited to 'cpukit/include/rtems/score/timecounter.h')
-rw-r--r--cpukit/include/rtems/score/timecounter.h24
1 files changed, 23 insertions, 1 deletions
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