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.
This commit is contained in:
Sebastian Huber
2019-10-01 13:04:29 +02:00
parent 2763f530d3
commit 47e5c1d7cd
2 changed files with 8 additions and 8 deletions

View File

@@ -1399,9 +1399,9 @@ tc_init(struct timecounter *tc)
if (tc->tc_quality == timecounter->tc_quality &&
tc->tc_frequency < timecounter->tc_frequency)
return;
(void)tc->tc_get_timecount(tc);
(void)tc->tc_get_timecount(tc);
#endif /* __rtems__ */
(void)tc->tc_get_timecount(tc);
(void)tc->tc_get_timecount(tc);
timecounter = tc;
#ifdef __rtems__
tc_windup(NULL);

View File

@@ -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);