summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-10-11 10:06:27 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-10-12 13:54:23 +0200
commit23332a91379c280b7ab8b2943415df5bf0812cbc (patch)
tree4c0217965a21576947bd92205b6820d84d7c7a87
parentec9a35387fdeeacc0ddeb615b686bee0e65e566c (diff)
score: Disable NTP adjustements
Since the ntp_update_second() does nothing nobody can change the th_adjustment to a non-zero value. Remove this member and disable the related code blocks. Update #2348.
-rw-r--r--cpukit/score/src/kern_tc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c
index f475c9fd46..77071803b3 100644
--- a/cpukit/score/src/kern_tc.c
+++ b/cpukit/score/src/kern_tc.c
@@ -166,7 +166,9 @@ static struct timecounter dummy_timecounter = {
struct timehands {
/* These fields must be initialized by the driver. */
struct timecounter *th_counter;
+#ifndef __rtems__
int64_t th_adjustment;
+#endif /* __rtems__ */
uint64_t th_scale;
u_int th_large_delta;
uint32_t th_offset_count;
@@ -1536,8 +1538,10 @@ _Timecounter_Windup(struct bintime *new_boottimebin,
struct timehands *th, *tho;
uint64_t scale;
uint32_t delta, ncount, ogen;
+#ifndef __rtems__
int i;
time_t t;
+#endif /* __rtems__ */
/*
* Make the next timehands a copy of the current one, but do
@@ -1614,6 +1618,7 @@ _Timecounter_Windup(struct bintime *new_boottimebin,
*/
bt = th->th_offset;
bintime_add(&bt, &th->th_boottime);
+#ifndef __rtems__
i = bt.sec - tho->th_microtime.tv_sec;
if (i > LARGE_STEP)
i = 2;
@@ -1623,6 +1628,7 @@ _Timecounter_Windup(struct bintime *new_boottimebin,
if (bt.sec != t)
th->th_boottime.sec += bt.sec - t;
}
+#endif /* __rtems__ */
/* Update the UTC timestamps used by the get*() functions. */
th->th_bintime = bt;
bintime2timeval(&bt, &th->th_microtime);
@@ -1673,7 +1679,9 @@ _Timecounter_Windup(struct bintime *new_boottimebin,
*
*/
scale = (uint64_t)1 << 63;
+#ifndef __rtems__
scale += (th->th_adjustment / 1024) * 2199;
+#endif /* __rtems__ */
scale /= th->th_counter->tc_frequency;
th->th_scale = scale * 2;
th->th_large_delta = MIN(((uint64_t)1 << 63) / scale, UINT_MAX);