summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2021-02-23 04:44:32 +0000
committercheloha <cheloha@cvs.openbsd.org>2021-02-23 04:44:32 +0000
commit3a7b91837ea37fe0a67697b9e86aa5d7b4c59e46 (patch)
tree4b77aa3e50ca4aef39f9ebc139c7eff8e9b889ca /sys/arch/sparc64
parentfc8936f7e4477d854a50d90188b2f90cd0b9e87f (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/sparc64')
-rw-r--r--sys/arch/sparc64/dev/psycho.c11
-rw-r--r--sys/arch/sparc64/sparc64/clock.c22
2 files changed, 26 insertions, 7 deletions
diff --git a/sys/arch/sparc64/dev/psycho.c b/sys/arch/sparc64/dev/psycho.c
index ce8d9a7bb9f..0de8e00cc2e 100644
--- a/sys/arch/sparc64/dev/psycho.c
+++ b/sys/arch/sparc64/dev/psycho.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: psycho.c,v 1.77 2020/07/06 13:33:08 pirofti Exp $ */
+/* $OpenBSD: psycho.c,v 1.78 2021/02/23 04:44:31 cheloha Exp $ */
/* $NetBSD: psycho.c,v 1.39 2001/10/07 20:30:41 eeh Exp $ */
/*
@@ -127,7 +127,14 @@ extern struct sparc_pci_chipset _sparc_pci_chipset;
u_int stick_get_timecount(struct timecounter *);
struct timecounter stick_timecounter = {
- stick_get_timecount, NULL, ~0u, 0, "stick", 1000, NULL, 0
+ .tc_get_timecount = stick_get_timecount,
+ .tc_poll_pps = NULL,
+ .tc_counter_mask = ~0u,
+ .tc_frequency = 0,
+ .tc_name = "stick",
+ .tc_quality = 1000,
+ .tc_priv = NULL,
+ .tc_user = 0,
};
/*
diff --git a/sys/arch/sparc64/sparc64/clock.c b/sys/arch/sparc64/sparc64/clock.c
index 9264f076bb9..f58a1ab49e2 100644
--- a/sys/arch/sparc64/sparc64/clock.c
+++ b/sys/arch/sparc64/sparc64/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.67 2020/10/20 15:59:17 cheloha Exp $ */
+/* $OpenBSD: clock.c,v 1.68 2021/02/23 04:44:31 cheloha Exp $ */
/* $NetBSD: clock.c,v 1.41 2001/07/24 19:29:25 eeh Exp $ */
/*
@@ -109,15 +109,27 @@ struct cfdriver clock_cd = {
u_int tick_get_timecount(struct timecounter *);
struct timecounter tick_timecounter = {
- tick_get_timecount, NULL, ~0u, 0, "tick", 0,
- NULL, TC_TICK
+ .tc_get_timecount = tick_get_timecount,
+ .tc_poll_pps = NULL,
+ .tc_counter_mask = ~0u,
+ .tc_frequency = 0,
+ .tc_name = "tick",
+ .tc_quality = 0,
+ .tc_priv = NULL,
+ .tc_user = TC_TICK,
};
u_int sys_tick_get_timecount(struct timecounter *);
struct timecounter sys_tick_timecounter = {
- sys_tick_get_timecount, NULL, ~0u, 0, "sys_tick", 1000,
- NULL, TC_SYS_TICK
+ .tc_get_timecount = sys_tick_get_timecount,
+ .tc_poll_pps = NULL,
+ .tc_counter_mask = ~0u,
+ .tc_frequency = 0,
+ .tc_name = "sys_tick",
+ .tc_quality = 1000,
+ .tc_priv = NULL,
+ .tc_user = TC_SYS_TICK,
};
/*