timecounting: use C99-style initialization for all timecounter structs
authorcheloha <cheloha@openbsd.org>
Tue, 23 Feb 2021 04:44:30 +0000 (04:44 +0000)
committercheloha <cheloha@openbsd.org>
Tue, 23 Feb 2021 04:44:30 +0000 (04:44 +0000)
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@

26 files changed:
sys/arch/alpha/alpha/clock.c
sys/arch/amd64/amd64/tsc.c
sys/arch/amd64/isa/clock.c
sys/arch/arm/cortex/agtimer.c
sys/arch/arm/cortex/amptimer.c
sys/arch/arm64/dev/agtimer.c
sys/arch/armv7/omap/dmtimer.c
sys/arch/armv7/omap/gptimer.c
sys/arch/armv7/sunxi/sxitimer.c
sys/arch/hppa/dev/clock.c
sys/arch/i386/isa/clock.c
sys/arch/i386/pci/geodesc.c
sys/arch/i386/pci/gscpm.c
sys/arch/i386/pci/ichpcib.c
sys/arch/macppc/macppc/clock.c
sys/arch/mips64/mips64/mips64_machdep.c
sys/arch/powerpc64/powerpc64/clock.c
sys/arch/sparc64/dev/psycho.c
sys/arch/sparc64/sparc64/clock.c
sys/dev/acpi/acpihpet.c
sys/dev/acpi/acpitimer.c
sys/dev/pci/amdpm.c
sys/dev/pci/viapm.c
sys/dev/pv/hyperv.c
sys/dev/pv/pvclock.c
sys/kern/kern_tc.c

index 78caeef..0ccf551 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clock.c,v 1.24 2020/07/06 13:33:06 pirofti Exp $      */
+/*     $OpenBSD: clock.c,v 1.25 2021/02/23 04:44:30 cheloha Exp $      */
 /*     $NetBSD: clock.c,v 1.29 2000/06/05 21:47:10 thorpej Exp $       */
 
 /*
@@ -64,7 +64,14 @@ int clk_irq = 0;
 
 u_int rpcc_get_timecount(struct timecounter *);
 struct timecounter rpcc_timecounter = {
-       rpcc_get_timecount, NULL, ~0u, 0, "rpcc", 0, NULL, 0
+       .tc_get_timecount = rpcc_get_timecount,
+       .tc_poll_pps = NULL,
+       .tc_counter_mask = ~0u,
+       .tc_frequency = 0,
+       .tc_name = "rpcc",
+       .tc_quality = 0,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 extern todr_chip_handle_t todr_handle;
index 93c9138..c9b5e55 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: tsc.c,v 1.22 2020/12/24 04:20:48 jsg Exp $    */
+/*     $OpenBSD: tsc.c,v 1.23 2021/02/23 04:44:30 cheloha Exp $        */
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * Copyright (c) 2016,2017 Reyk Floeter <reyk@openbsd.org>
@@ -52,7 +52,14 @@ extern u_int32_t lapic_per_second;
 #endif
 
 struct timecounter tsc_timecounter = {
-       tsc_get_timecount, NULL, ~0u, 0, "tsc", -1000, NULL, TC_TSC
+       .tc_get_timecount = tsc_get_timecount,
+       .tc_poll_pps = NULL,
+       .tc_counter_mask = ~0u,
+       .tc_frequency = 0,
+       .tc_name = "tsc",
+       .tc_quality = -1000,
+       .tc_priv = NULL,
+       .tc_user = TC_TSC,
 };
 
 uint64_t
index cc0b38b..3025ad2 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clock.c,v 1.34 2020/07/06 13:33:06 pirofti Exp $      */
+/*     $OpenBSD: clock.c,v 1.35 2021/02/23 04:44:30 cheloha Exp $      */
 /*     $NetBSD: clock.c,v 1.1 2003/04/26 18:39:50 fvdl Exp $   */
 
 /*-
@@ -116,7 +116,14 @@ u_int i8254_get_timecount(struct timecounter *tc);
 u_int i8254_simple_get_timecount(struct timecounter *tc);
 
 static struct timecounter i8254_timecounter = {
-       i8254_get_timecount, NULL, ~0u, TIMER_FREQ, "i8254", 0, NULL, 0
+       .tc_get_timecount = i8254_get_timecount,
+       .tc_poll_pps = NULL,
+       .tc_counter_mask = ~0u,
+       .tc_frequency = TIMER_FREQ,
+       .tc_name = "i8254",
+       .tc_quality = 0,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 int    clockintr(void *);
index a2bb0be..8d742f8 100644 (file)
@@ -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 {
index 7f85f00..1a83f0b 100644 (file)
@@ -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
index 8a98e4c..f121e07 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: agtimer.c,v 1.16 2021/01/19 18:07:15 kettenis Exp $ */
+/* $OpenBSD: agtimer.c,v 1.17 2021/02/23 04:44:30 cheloha Exp $ */
 /*
  * Copyright (c) 2011 Dale Rahn <drahn@openbsd.org>
  * Copyright (c) 2013 Patrick Wildt <patrick@blueri.se>
@@ -43,8 +43,14 @@ 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_AGTIMER
+       .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,
+       .tc_user = TC_AGTIMER,
 };
 
 struct agtimer_pcpu_softc {
index ddb4c85..5f04432 100644 (file)
@@ -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;
index 5dc8c18..bc1b7b1 100644 (file)
@@ -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;
index a1172f6..4ed2ee5 100644 (file)
@@ -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;
index ac99711..b3ed180 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clock.c,v 1.31 2020/07/06 13:33:07 pirofti Exp $      */
+/*     $OpenBSD: clock.c,v 1.32 2021/02/23 04:44:30 cheloha Exp $      */
 
 /*
  * Copyright (c) 1998-2003 Michael Shalayeff
@@ -47,7 +47,14 @@ int  cpu_hardclock(void *);
 u_int  itmr_get_timecount(struct timecounter *);
 
 struct timecounter itmr_timecounter = {
-       itmr_get_timecount, NULL, 0xffffffff, 0, "itmr", 0, NULL, 0
+       .tc_get_timecount = itmr_get_timecount,
+       .tc_poll_pps = NULL,
+       .tc_counter_mask = 0xffffffff,
+       .tc_frequency = 0,
+       .tc_name = "itmr",
+       .tc_quality = 0,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 extern todr_chip_handle_t todr_handle;
index 3ff97aa..566d2fe 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clock.c,v 1.59 2020/07/06 13:33:07 pirofti Exp $      */
+/*     $OpenBSD: clock.c,v 1.60 2021/02/23 04:44:30 cheloha Exp $      */
 /*     $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $       */
 
 /*-
@@ -129,7 +129,14 @@ u_int i8254_get_timecount(struct timecounter *tc);
 u_int i8254_simple_get_timecount(struct timecounter *tc);
 
 static struct timecounter i8254_timecounter = {
-       i8254_get_timecount, NULL, ~0u, TIMER_FREQ, "i8254", 0, NULL, 0
+       .tc_get_timecount = i8254_get_timecount,
+       .tc_poll_pps = NULL,
+       .tc_counter_mask = ~0u,
+       .tc_frequency = TIMER_FREQ,
+       .tc_name = "i8254",
+       .tc_quality = 0,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 struct mutex timer_mutex = MUTEX_INITIALIZER(IPL_HIGH);
 u_long rtclock_tval;
index 3e804e0..960a9d4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: geodesc.c,v 1.15 2020/07/06 13:33:07 pirofti Exp $    */
+/*     $OpenBSD: geodesc.c,v 1.16 2021/02/23 04:44:30 cheloha Exp $    */
 
 /*
  * Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
@@ -60,14 +60,14 @@ struct cfdriver geodesc_cd = {
 u_int   geodesc_get_timecount(struct timecounter *tc);
 
 struct timecounter geodesc_timecounter = {
-       geodesc_get_timecount,  /* get_timecount */
-       0,                      /* no poll_pps */
-       0xffffffff,             /* counter_mask */
-       27000000,               /* frequency */
-       "GEOTSC",               /* name */
-       2000,                   /* quality */
-       NULL,                   /* private bits */
-       0                       /* expose to user */
+       .tc_get_timecount = geodesc_get_timecount,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = 0xffffffff,
+       .tc_frequency = 27000000,
+       .tc_name = "GEOTSC",
+       .tc_quality = 2000,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 int
index 84c67c6..c1bbacc 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: gscpm.c,v 1.10 2020/07/06 13:33:07 pirofti Exp $      */
+/*     $OpenBSD: gscpm.c,v 1.11 2021/02/23 04:44:30 cheloha Exp $      */
 /*
  * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
  *
@@ -50,14 +50,14 @@ void        gscpm_setperf(int);
 u_int  gscpm_get_timecount(struct timecounter *tc);
 
 struct timecounter gscpm_timecounter = {
-       gscpm_get_timecount,    /* get_timecount */
-       0,                      /* no poll_pps */
-       0xffffff,               /* counter_mask */
-       3579545,                /* frequency */
-       "GSCPM",                /* name */
-       1000,                   /* quality */
-       NULL,                   /* private bits */
-       0                       /* expose to user */
+       .tc_get_timecount = gscpm_get_timecount,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = 0xffffff,
+       .tc_frequency = 3579545,
+       .tc_name = "GSCPM",
+       .tc_quality = 1000,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 struct cfattach gscpm_ca = {
index 3ece43e..479fc42 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: ichpcib.c,v 1.29 2020/07/06 13:33:07 pirofti Exp $    */
+/*     $OpenBSD: ichpcib.c,v 1.30 2021/02/23 04:44:30 cheloha Exp $    */
 /*
  * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
  *
@@ -58,14 +58,14 @@ void    pcibattach(struct device *, struct device *, void *);
 u_int  ichpcib_get_timecount(struct timecounter *tc);
 
 struct timecounter ichpcib_timecounter = {
-       ichpcib_get_timecount,  /* get_timecount */
-       0,                      /* no poll_pps */
-       0xffffff,               /* counter_mask */
-       3579545,                /* frequency */
-       "ICHPM",                /* name */
-       1000,                   /* quality */
-       NULL,                   /* private bits */
-       0                       /* expose to user */
+       .tc_get_timecount = ichpcib_get_timecount,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = 0xffffff,
+       .tc_frequency = 3579545,
+       .tc_name = "ICHPM",
+       .tc_quality = 1000,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 struct cfattach ichpcib_ca = {
index 7ff7ba2..a24e7f9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clock.c,v 1.47 2020/08/26 03:29:06 visa Exp $ */
+/*     $OpenBSD: clock.c,v 1.48 2021/02/23 04:44:30 cheloha Exp $      */
 /*     $NetBSD: clock.c,v 1.1 1996/09/30 16:34:40 ws Exp $     */
 
 /*
@@ -57,7 +57,14 @@ u_int32_t ns_per_tick = 320;
 static int32_t ticks_per_intr;
 
 static struct timecounter tb_timecounter = {
-       tb_get_timecount, NULL, 0xffffffff, 0, "tb", 0, NULL, TC_TB
+       .tc_get_timecount = tb_get_timecount,
+       .tc_poll_pps = NULL,
+       .tc_counter_mask = 0xffffffff,
+       .tc_frequency = 0,
+       .tc_name = "tb",
+       .tc_quality = 0,
+       .tc_priv = NULL,
+       .tc_user = TC_TB,
 };
 
 /* calibrate the timecounter frequency for the listed models */
index a847919..9b286c4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: mips64_machdep.c,v 1.34 2021/01/13 16:28:49 cheloha Exp $ */
+/*     $OpenBSD: mips64_machdep.c,v 1.35 2021/02/23 04:44:30 cheloha Exp $ */
 
 /*
  * Copyright (c) 2009, 2010, 2012 Miodrag Vallat.
@@ -267,14 +267,14 @@ delay(int n)
 u_int cp0_get_timecount(struct timecounter *);
 
 struct timecounter cp0_timecounter = {
-       cp0_get_timecount,      /* get_timecount */
-       0,                      /* no poll_pps */
-       0xffffffff,             /* counter_mask */
-       0,                      /* frequency */
-       "CP0",                  /* name */
-       0,                      /* quality */
-       NULL,                   /* private bits */
-       0,                      /* expose to user */
+       .tc_get_timecount = cp0_get_timecount,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = 0xffffffff,
+       .tc_frequency = 0,
+       .tc_name = "CP0",
+       .tc_quality = 0,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 u_int
index a2bb712..204ce0f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: clock.c,v 1.2 2020/07/12 20:32:20 naddy Exp $ */
+/*     $OpenBSD: clock.c,v 1.3 2021/02/23 04:44:31 cheloha Exp $       */
 
 /*
  * Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
@@ -37,7 +37,13 @@ struct evcount stat_count;
 u_int  tb_get_timecount(struct timecounter *);
 
 static struct timecounter tb_timecounter = {
-       tb_get_timecount, NULL, 0xffffffff, 0, "tb", 0, NULL
+       .tc_get_timecount = tb_get_timecount,
+       .tc_poll_pps = NULL,
+       .tc_counter_mask = 0xffffffff,
+       .tc_frequency = 0,
+       .tc_name = "tb",
+       .tc_quality = 0,
+       .tc_priv = NULL,
 };
 
 void   cpu_startclock(void);
index ce8d9a7..0de8e00 100644 (file)
@@ -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,
 };
 
 /*
index 9264f07..f58a1ab 100644 (file)
@@ -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,
 };
 
 /*
index 9dc4908..06de153 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpihpet.c,v 1.24 2020/07/06 13:33:08 pirofti Exp $ */
+/* $OpenBSD: acpihpet.c,v 1.25 2021/02/23 04:44:31 cheloha Exp $ */
 /*
  * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
  *
@@ -40,14 +40,14 @@ void                acpihpet_w(bus_space_tag_t _iot, bus_space_handle_t _ioh,
                    bus_size_t _ioa, uint64_t _val);
 
 static struct timecounter hpet_timecounter = {
-       acpihpet_gettime,       /* get_timecount */
-       0,                      /* no poll_pps */
-       0xffffffff,             /* counter_mask (32 bits) */
-       0,                      /* frequency */
-       0,                      /* name */
-       1000,                   /* quality */
-       NULL,                   /* private bits */
-       0,                      /* expose to user */
+       .tc_get_timecount = acpihpet_gettime,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = 0xffffffff,
+       .tc_frequency = 0,
+       .tc_name = 0,
+       .tc_quality = 1000,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 #define HPET_TIMERS    3
index 8885ab4..3662363 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpitimer.c,v 1.13 2020/07/06 13:33:08 pirofti Exp $ */
+/* $OpenBSD: acpitimer.c,v 1.14 2021/02/23 04:44:31 cheloha Exp $ */
 /*
  * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
  *
@@ -31,14 +31,14 @@ void acpitimerattach(struct device *, struct device *, void *);
 u_int acpi_get_timecount(struct timecounter *tc);
 
 static struct timecounter acpi_timecounter = {
-       acpi_get_timecount,     /* get_timecount */
-       0,                      /* no poll_pps */
-       0x00ffffff,             /* counter_mask (24 bits) */
-       ACPI_FREQUENCY,         /* frequency */
-       0,                      /* name */
-       1000,                   /* quality */
-       NULL,                   /* private bits */
-       0,                      /* expose to user */
+       .tc_get_timecount = acpi_get_timecount,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = 0x00ffffff,          /* 24 bits */
+       .tc_frequency = ACPI_FREQUENCY,
+       .tc_name = 0,
+       .tc_quality = 1000,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 struct acpitimer_softc {
index 73659d4..af4be9f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: amdpm.c,v 1.36 2020/07/06 13:33:09 pirofti Exp $      */
+/*     $OpenBSD: amdpm.c,v 1.37 2021/02/23 04:44:31 cheloha Exp $      */
 
 /*
  * Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -77,14 +77,14 @@ u_int amdpm_get_timecount(struct timecounter *tc);
 #endif
 
 static struct timecounter amdpm_timecounter = {
-       amdpm_get_timecount,    /* get_timecount */
-       0,                      /* no poll_pps */
-       0xffffff,               /* counter_mask */
-       AMDPM_FREQUENCY,        /* frequency */
-       "AMDPM",                /* name */
-       1000,                   /* quality */
-       NULL,                   /* private bits */
-       0,                      /* expose to user */
+       .tc_get_timecount = amdpm_get_timecount,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = 0xffffff,
+       .tc_frequency = AMDPM_FREQUENCY,
+       .tc_name = "AMDPM",
+       .tc_quality = 1000,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 #define        AMDPM_CONFREG   0x40
index ee7e93f..14485ed 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: viapm.c,v 1.19 2020/07/06 13:33:09 pirofti Exp $      */
+/*     $OpenBSD: viapm.c,v 1.20 2021/02/23 04:44:31 cheloha Exp $      */
 
 /*
  * Copyright (c) 2005 Mark Kettenis <kettenis@openbsd.org>
@@ -172,14 +172,14 @@ u_int     viapm_get_timecount(struct timecounter *tc);
 #endif
 
 static struct timecounter viapm_timecounter = {
-       viapm_get_timecount,    /* get_timecount */
-       0,                      /* no poll_pps */
-       0xffffff,               /* counter_mask */
-       VIAPM_FREQUENCY,        /* frequency */
-       "VIAPM",                /* name */
-       1000,                   /* quality */
-       NULL,                   /* private bits */
-       0,                      /* expose to user */
+       .tc_get_timecount = viapm_get_timecount,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = 0xffffff,
+       .tc_frequency = VIAPM_FREQUENCY,
+       .tc_name = "VIAPM",
+       .tc_quality = 1000,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 struct timeout viapm_timeout;
index 4a695cc..de753cc 100644 (file)
@@ -141,7 +141,14 @@ struct {
 };
 
 struct timecounter hv_timecounter = {
-       hv_gettime, 0, 0xffffffff, 10000000, "hyperv", 9001, NULL, 0
+       .tc_get_timecount = hv_gettime,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = 0xffffffff,
+       .tc_frequency = 10000000,
+       .tc_name = "hyperv",
+       .tc_quality = 9001,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 struct cfdriver hyperv_cd = {
index cf72aec..cf727b0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: pvclock.c,v 1.6 2020/07/06 13:33:09 pirofti Exp $     */
+/*     $OpenBSD: pvclock.c,v 1.7 2021/02/23 04:44:31 cheloha Exp $     */
 
 /*
  * Copyright (c) 2018 Reyk Floeter <reyk@openbsd.org>
@@ -74,7 +74,14 @@ struct cfdriver pvclock_cd = {
 };
 
 struct timecounter pvclock_timecounter = {
-       pvclock_get_timecount, NULL, ~0u, 0, NULL, -2000, NULL, 0
+       .tc_get_timecount = pvclock_get_timecount,
+       .tc_poll_pps = NULL,
+       .tc_counter_mask = ~0u,
+       .tc_frequency = 0,
+       .tc_name = NULL,
+       .tc_quality = -2000,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 int
index 3c4cfa1..c0eac3d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kern_tc.c,v 1.70 2020/12/05 04:46:34 gnezdo Exp $ */
+/*     $OpenBSD: kern_tc.c,v 1.71 2021/02/23 04:44:31 cheloha Exp $ */
 
 /*
  * Copyright (c) 2000 Poul-Henning Kamp <phk@FreeBSD.org>
@@ -55,7 +55,14 @@ dummy_get_timecount(struct timecounter *tc)
 }
 
 static struct timecounter dummy_timecounter = {
-       dummy_get_timecount, 0, ~0u, 1000000, "dummy", -1000000, NULL, 0
+       .tc_get_timecount = dummy_get_timecount,
+       .tc_poll_pps = 0,
+       .tc_counter_mask = ~0u,
+       .tc_frequency = 1000000,
+       .tc_name = "dummy",
+       .tc_quality = -1000000,
+       .tc_priv = NULL,
+       .tc_user = 0,
 };
 
 /*