Changeset 5382f617 in rtems
- Timestamp:
- 10/28/21 09:14:57 (2 years ago)
- Branches:
- 5
- Children:
- 18bbfc7
- Parents:
- 780b468
- git-author:
- Sebastian Huber <sebastian.huber@…> (10/28/21 09:14:57)
- git-committer:
- Moyano, Gabriel <gabriel.moyano@…> (11/16/21 09:13:03)
- Location:
- cpukit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/include/rtems/score/timecounter.h
r780b468 r5382f617 8 8 9 9 /* 10 * Copyright (c) 2015 embedded brains GmbH. All rights reserved.10 * Copyright (c) 2015, 2021 embedded brains GmbH. All rights reserved. 11 11 * 12 12 * embedded brains GmbH … … 248 248 extern struct timecounter *_Timecounter; 249 249 250 /** 251 * @brief Handler doing the NTP update second processing shall have this type. 252 * 253 * @param[in, out] adjustment is the NTP time adjustment. 254 * 255 * @param[in, out] newsec is the number of seconds since Unix epoch. 256 */ 257 typedef void ( *Timecounter_NTP_update_second )( 258 int64_t *adjustment, 259 time_t *newsec 260 ); 261 262 /** 263 * @brief Sets the NTP update second handler. 264 * 265 * @param handler is the new NTP update second handler used to carry out the 266 * NTP update second processing. 267 */ 268 void _Timecounter_Set_NTP_update_second( 269 Timecounter_NTP_update_second handler 270 ); 271 250 272 /** @} */ 251 273 -
cpukit/score/src/kern_tc.c
r780b468 r5382f617 81 81 #define printf(...) 82 82 #define log(...) 83 /* FIXME: https://devel.rtems.org/ticket/2348 */84 #define ntp_update_second(a, b) do { (void) a; (void) b; } while (0)85 83 86 84 static inline void … … 118 116 return ((void *)_Atomic_Load_uintptr(ptr, ATOMIC_ORDER_RELAXED)); 119 117 } 118 119 static Timecounter_NTP_update_second _Timecounter_NTP_update_second; 120 121 void 122 _Timecounter_Set_NTP_update_second(Timecounter_NTP_update_second handler) 123 { 124 125 _Timecounter_NTP_update_second = handler; 126 } 127 128 #define ntp_update_second(a, b) (*ntp_update_second_handler)(a, b) 120 129 #endif /* __rtems__ */ 121 130 … … 1606 1615 int i; 1607 1616 time_t t; 1617 #ifdef __rtems__ 1618 Timecounter_NTP_update_second ntp_update_second_handler; 1619 #endif 1608 1620 1609 1621 /* … … 1681 1693 bt = th->th_offset; 1682 1694 bintime_add(&bt, &th->th_boottime); 1695 #ifdef __rtems__ 1696 ntp_update_second_handler = _Timecounter_NTP_update_second; 1697 if (ntp_update_second_handler != NULL) { 1698 #endif /* __rtems__ */ 1683 1699 i = bt.sec - tho->th_microtime.tv_sec; 1684 1700 if (i > 0) { … … 1696 1712 recalculate_scaling_factor_and_large_delta(th); 1697 1713 } 1714 #ifdef __rtems__ 1715 } 1716 #endif /* __rtems__ */ 1698 1717 1699 1718 /* Update the UTC timestamps used by the get*() functions. */
Note: See TracChangeset
for help on using the changeset viewer.