diff options
author | cheloha <cheloha@cvs.openbsd.org> | 2021-02-23 04:44:32 +0000 |
---|---|---|
committer | cheloha <cheloha@cvs.openbsd.org> | 2021-02-23 04:44:32 +0000 |
commit | 3a7b91837ea37fe0a67697b9e86aa5d7b4c59e46 (patch) | |
tree | 4b77aa3e50ca4aef39f9ebc139c7eff8e9b889ca /sys/arch/arm | |
parent | fc8936f7e4477d854a50d90188b2f90cd0b9e87f (diff) |
timecounting: use C99-style initialization for all timecounter structs
The timecounter struct is large and I think it may change in the
future. Changing it later will be easier if we use C99-style
initialization for all timecounter structs. It also makes reading the
code a bit easier.
For reasons I cannot explain, switching to C99-style initialization
sometimes changes the hash of the resulting object file, even though
the resulting struct should be the same. So there is a binary change
here, but only sometimes. No behavior should change in either case.
I can't compile-test this everywhere but I have been staring at the
diff for days now and I'm relatively confident this will not break
compilation. Fingers crossed.
ok gnezdo@
Diffstat (limited to 'sys/arch/arm')
-rw-r--r-- | sys/arch/arm/cortex/agtimer.c | 10 | ||||
-rw-r--r-- | sys/arch/arm/cortex/amptimer.c | 11 |
2 files changed, 17 insertions, 4 deletions
diff --git a/sys/arch/arm/cortex/agtimer.c b/sys/arch/arm/cortex/agtimer.c index a2bb0be956d..8d742f8d03c 100644 --- a/sys/arch/arm/cortex/agtimer.c +++ b/sys/arch/arm/cortex/agtimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agtimer.c,v 1.11 2021/01/19 18:04:43 kettenis Exp $ */ +/* $OpenBSD: agtimer.c,v 1.12 2021/02/23 04:44:30 cheloha Exp $ */ /* * Copyright (c) 2011 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2013 Patrick Wildt <patrick@blueri.se> @@ -46,7 +46,13 @@ int32_t agtimer_frequency = TIMER_FREQUENCY; u_int agtimer_get_timecount(struct timecounter *); static struct timecounter agtimer_timecounter = { - agtimer_get_timecount, NULL, 0xffffffff, 0, "agtimer", 0, NULL + .tc_get_timecount = agtimer_get_timecount, + .tc_poll_pps = NULL, + .tc_counter_mask = 0xffffffff, + .tc_frequency = 0, + .tc_name = "agtimer", + .tc_quality = 0, + .tc_priv = NULL, }; struct agtimer_pcpu_softc { diff --git a/sys/arch/arm/cortex/amptimer.c b/sys/arch/arm/cortex/amptimer.c index 7f85f00b312..1a83f0b30ad 100644 --- a/sys/arch/arm/cortex/amptimer.c +++ b/sys/arch/arm/cortex/amptimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: amptimer.c,v 1.10 2021/01/19 18:04:43 kettenis Exp $ */ +/* $OpenBSD: amptimer.c,v 1.11 2021/02/23 04:44:30 cheloha Exp $ */ /* * Copyright (c) 2011 Dale Rahn <drahn@openbsd.org> * @@ -67,7 +67,14 @@ int32_t amptimer_frequency = TIMER_FREQUENCY; u_int amptimer_get_timecount(struct timecounter *); static struct timecounter amptimer_timecounter = { - amptimer_get_timecount, NULL, 0xffffffff, 0, "amptimer", 0, NULL, 0 + .tc_get_timecount = amptimer_get_timecount, + .tc_poll_pps = NULL, + .tc_counter_mask = 0xffffffff, + .tc_frequency = 0, + .tc_name = "amptimer", + .tc_quality = 0, + .tc_priv = NULL, + .tc_user = 0, }; #define MAX_ARM_CPUS 8 |