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/armv7 | |
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/armv7')
-rw-r--r-- | sys/arch/armv7/omap/dmtimer.c | 10 | ||||
-rw-r--r-- | sys/arch/armv7/omap/gptimer.c | 11 | ||||
-rw-r--r-- | sys/arch/armv7/sunxi/sxitimer.c | 11 |
3 files changed, 26 insertions, 6 deletions
diff --git a/sys/arch/armv7/omap/dmtimer.c b/sys/arch/armv7/omap/dmtimer.c index ddb4c859d65..5f04432d502 100644 --- a/sys/arch/armv7/omap/dmtimer.c +++ b/sys/arch/armv7/omap/dmtimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dmtimer.c,v 1.9 2021/01/19 18:04:43 kettenis Exp $ */ +/* $OpenBSD: dmtimer.c,v 1.10 2021/02/23 04:44:30 cheloha Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2013 Raphael Graf <r@undefined.ch> @@ -111,7 +111,13 @@ void dmtimer_setstatclockrate(int newhz); u_int dmtimer_get_timecount(struct timecounter *); static struct timecounter dmtimer_timecounter = { - dmtimer_get_timecount, NULL, 0xffffffff, 0, "dmtimer", 0, NULL + .tc_get_timecount = dmtimer_get_timecount, + .tc_poll_pps = NULL, + .tc_counter_mask = 0xffffffff, + .tc_frequency = 0, + .tc_name = "dmtimer", + .tc_quality = 0, + .tc_priv = NULL, }; bus_space_handle_t dmtimer_ioh0; diff --git a/sys/arch/armv7/omap/gptimer.c b/sys/arch/armv7/omap/gptimer.c index 5dc8c185a58..bc1b7b199d0 100644 --- a/sys/arch/armv7/omap/gptimer.c +++ b/sys/arch/armv7/omap/gptimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gptimer.c,v 1.11 2021/01/19 18:04:43 kettenis Exp $ */ +/* $OpenBSD: gptimer.c,v 1.12 2021/02/23 04:44:30 cheloha Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * @@ -113,7 +113,14 @@ int gptimer_irq = 0; u_int gptimer_get_timecount(struct timecounter *); static struct timecounter gptimer_timecounter = { - gptimer_get_timecount, NULL, 0xffffffff, 0, "gptimer", 0, NULL, 0 + .tc_get_timecount = gptimer_get_timecount, + .tc_poll_pps = NULL, + .tc_counter_mask = 0xffffffff, + .tc_frequency = 0, + .tc_name = "gptimer", + .tc_quality = 0, + .tc_priv = NULL, + .tc_user = 0, }; volatile u_int32_t nexttickevent; diff --git a/sys/arch/armv7/sunxi/sxitimer.c b/sys/arch/armv7/sunxi/sxitimer.c index a1172f6043d..4ed2ee5701d 100644 --- a/sys/arch/armv7/sunxi/sxitimer.c +++ b/sys/arch/armv7/sunxi/sxitimer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sxitimer.c,v 1.15 2021/01/19 18:04:43 kettenis Exp $ */ +/* $OpenBSD: sxitimer.c,v 1.16 2021/02/23 04:44:30 cheloha Exp $ */ /* * Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org> * Copyright (c) 2013 Raphael Graf <r@undefined.ch> @@ -89,7 +89,14 @@ void sxitimer_delay(u_int); u_int sxitimer_get_timecount(struct timecounter *); static struct timecounter sxitimer_timecounter = { - sxitimer_get_timecount, NULL, 0xffffffff, 0, "sxitimer", 0, NULL, 0 + .tc_get_timecount = sxitimer_get_timecount, + .tc_poll_pps = NULL, + .tc_counter_mask = 0xffffffff, + .tc_frequency = 0, + .tc_name = "sxitimer", + .tc_quality = 0, + .tc_priv = NULL, + .tc_user = 0, }; bus_space_tag_t sxitimer_iot; |