diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2016-07-27 11:27:52 +0000 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-12 07:04:11 +0200 |
commit | 6d3c12549f3b6394e841b98f663532b039c8289f (patch) | |
tree | c7ad481e0d5850683eddb75a566a1700aad6cbb9 /cpukit | |
parent | timecounter: Merge FreeBSD change r303382 (diff) | |
download | rtems-6d3c12549f3b6394e841b98f663532b039c8289f.tar.bz2 |
timecounter: Merge FreeBSD change r303383
Reduce number of timehands to just two. This is useful because consumers can now be only one tc_windup() call late.
Use C99 initialization.
Tested by: pho (as part of the whole patch)
Reviewed by: jhb (same)
Discussed with: bde
Sponsored by: The FreeBSD Foundation
MFC after: 1 month
X-Differential revision: https://reviews.freebsd.org/D7302
Update #3175.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/score/src/kern_tc.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/cpukit/score/src/kern_tc.c b/cpukit/score/src/kern_tc.c index c157584190..20a3fb49b2 100644 --- a/cpukit/score/src/kern_tc.c +++ b/cpukit/score/src/kern_tc.c @@ -164,34 +164,23 @@ struct timehands { #if defined(RTEMS_SMP) static struct timehands th0; -static struct timehands th9 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th0}; -static struct timehands th8 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th9}; -static struct timehands th7 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th8}; -static struct timehands th6 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th7}; -static struct timehands th5 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th6}; -static struct timehands th4 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th5}; -static struct timehands th3 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th4}; -static struct timehands th2 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th3}; -static struct timehands th1 = { NULL, 0, 0, 0, {0, 0}, {0, 0}, {0, 0}, 0, &th2}; +static struct timehands th1 = { + .th_next = &th0 +}; #endif static struct timehands th0 = { - &dummy_timecounter, - 0, - (uint64_t)-1 / 1000000, - 0, - {1, 0}, -#ifndef __rtems__ - {0, 0}, - {0, 0}, -#else /* __rtems__ */ - {TOD_SECONDS_1970_THROUGH_1988, 0}, - {TOD_SECONDS_1970_THROUGH_1988, 0}, + .th_counter = &dummy_timecounter, + .th_scale = (uint64_t)-1 / 1000000, + .th_offset = { .sec = 1 }, + .th_generation = 1, +#ifdef __rtems__ + .th_microtime = { TOD_SECONDS_1970_THROUGH_1988, 0 }, + .th_nanotime = { TOD_SECONDS_1970_THROUGH_1988, 0 }, #endif /* __rtems__ */ - 1, #if defined(RTEMS_SMP) - &th1 + .th_next = &th1 #else - &th0 + .th_next = &th0 #endif }; |