diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-10-01 13:04:29 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2019-10-02 07:01:36 +0200 |
commit | 47e5c1d7cde10e0daa9c43fd183ed19b7140425d (patch) | |
tree | 87b1d87c9734f7598277e653a3547124efa98c0b | |
parent | score: Remove superfluous timecounter members (diff) | |
download | rtems-47e5c1d7cde10e0daa9c43fd183ed19b7140425d.tar.bz2 |
score: Remove strange timecounter init step
The double call of the timecounter get method was added to FreeBSD in
2002 without a comment. It is not clear why this is needed.
-rw-r--r-- | cpukit/score/src/kern_tc.c | 2 | ||||
-rw-r--r-- | testsuites/sptests/sptimecounter01/init.c | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c index 082cb9f7d7..e550b22580 100644 --- a/cpukit/score/src/kern_tc.c +++ b/cpukit/score/src/kern_tc.c @@ -1399,9 +1399,9 @@ tc_init(struct timecounter *tc) if (tc->tc_quality == timecounter->tc_quality && tc->tc_frequency < timecounter->tc_frequency) return; -#endif /* __rtems__ */ (void)tc->tc_get_timecount(tc); (void)tc->tc_get_timecount(tc); +#endif /* __rtems__ */ timecounter = tc; #ifdef __rtems__ tc_windup(NULL); diff --git a/testsuites/sptests/sptimecounter01/init.c b/testsuites/sptests/sptimecounter01/init.c index 9fc36583c4..8928c5e051 100644 --- a/testsuites/sptests/sptimecounter01/init.c +++ b/testsuites/sptests/sptimecounter01/init.c @@ -126,25 +126,25 @@ void boot_card(const char *cmdline) tc_soft->tc_frequency = soft_freq; tc_soft->tc_quality = 1234; _Timecounter_Install(tc_soft); - assert(ctx->tc_soft_counter == 3); + assert(ctx->tc_soft_counter == 1); rtems_bsd_binuptime(&bt); - assert(ctx->tc_soft_counter == 4); + assert(ctx->tc_soft_counter == 2); assert(bt.sec == 1); assert(bt.frac == 18446744073708); - ctx->tc_soft_counter = 0xf0000000 | 3; + ctx->tc_soft_counter = 0xf0000000 | 1; rtems_bsd_binuptime(&bt); - assert(ctx->tc_soft_counter == (0xf0000000 | 4)); + assert(ctx->tc_soft_counter == (0xf0000000 | 2)); assert(bt.sec == 1); assert(bt.frac == 18446744073708); /* Ensure that the fraction overflows and the second remains constant */ - ctx->tc_soft_counter = (0xf0000000 | 3) + soft_freq; + ctx->tc_soft_counter = (0xf0000000 | 1) + soft_freq; rtems_bsd_binuptime(&bt); - assert(ctx->tc_soft_counter == (0xf0000000 | 4) + soft_freq); + assert(ctx->tc_soft_counter == (0xf0000000 | 2) + soft_freq); assert(bt.sec == 1); assert(bt.frac == 18446742522092); |