Scott Cheloha <[email protected]> writes:
> Hi,
>
> If the timecounter struct changes again in the future it will be
> easier to make the change if we are using C99-style initialization
> everywhere. In general I think C99-style initialization is easier to
> read for larger structs. The timecounter struct definitely qualifies
> as "larger". We probably should already be doing this but nobody has
> bothered yet.
>
> So I will bother. This patch changes every timecounter struct to use
> C99-style initialization. Some are already using it but most are not.
>
> Yes, I am aware that this is tedious to review. I'm sorry. I think
> suffering this now will pay off in the future.
Nah, not bad at all. Could you check if you get identical object files
by chance? It would be a nice double check.
>
> Speaking of the future: in a subsequent patch I would like to remove
> several of the the zero and NULL members, as C99 guarantees that
> omission of a member at initialization causes it to be implicitly
> zeroed. For instance, there is no reason to set .tc_user if the
> timecounter has no corresponding driver in libc. There are also no
> drivers setting the .tc_poll_pps function pointer, so we can just let
> it implicitly be NULL. And if the timecounter needs no private cookie
> we don't need to explicitly set .tc_priv to NULL. Et cetera.
>
> I suppose if people prefer it we _could_ do such changes in this
> patch. I'm leaning toward not doing that. Switching to the C99 style
> *and* dropping members will make review more difficult and increase
> the likelihood of a mistake, i.e. I will accidentally break the build
> on some platform and people will yell at me, which I want to avoid.
>
> Thoughts? Preferences? ok?
If others don't mind on some grounds, I'm fairly convinced of this being
a functional no-op and so: OK gnezdo@
>
> Index: ./arch/alpha/alpha/clock.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/alpha/alpha/clock.c,v
> retrieving revision 1.24
> diff -u -p -r1.24 clock.c
> --- ./arch/alpha/alpha/clock.c 6 Jul 2020 13:33:06 -0000 1.24
> +++ ./arch/alpha/alpha/clock.c 19 Feb 2021 02:57:55 -0000
> @@ -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: ./arch/amd64/amd64/tsc.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/amd64/amd64/tsc.c,v
> retrieving revision 1.22
> diff -u -p -r1.22 tsc.c
> --- ./arch/amd64/amd64/tsc.c 24 Dec 2020 04:20:48 -0000 1.22
> +++ ./arch/amd64/amd64/tsc.c 19 Feb 2021 02:57:55 -0000
> @@ -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: ./arch/amd64/isa/clock.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/amd64/isa/clock.c,v
> retrieving revision 1.34
> diff -u -p -r1.34 clock.c
> --- ./arch/amd64/isa/clock.c 6 Jul 2020 13:33:06 -0000 1.34
> +++ ./arch/amd64/isa/clock.c 19 Feb 2021 02:57:55 -0000
> @@ -116,7 +116,14 @@ u_int i8254_get_timecount(struct timecou
> 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: ./arch/armv7/omap/dmtimer.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/armv7/omap/dmtimer.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 dmtimer.c
> --- ./arch/armv7/omap/dmtimer.c 19 Jan 2021 18:04:43 -0000 1.9
> +++ ./arch/armv7/omap/dmtimer.c 19 Feb 2021 02:57:55 -0000
> @@ -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: ./arch/armv7/omap/gptimer.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/armv7/omap/gptimer.c,v
> retrieving revision 1.11
> diff -u -p -r1.11 gptimer.c
> --- ./arch/armv7/omap/gptimer.c 19 Jan 2021 18:04:43 -0000 1.11
> +++ ./arch/armv7/omap/gptimer.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./arch/armv7/sunxi/sxitimer.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/armv7/sunxi/sxitimer.c,v
> retrieving revision 1.15
> diff -u -p -r1.15 sxitimer.c
> --- ./arch/armv7/sunxi/sxitimer.c 19 Jan 2021 18:04:43 -0000 1.15
> +++ ./arch/armv7/sunxi/sxitimer.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./arch/arm/cortex/amptimer.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/arm/cortex/amptimer.c,v
> retrieving revision 1.10
> diff -u -p -r1.10 amptimer.c
> --- ./arch/arm/cortex/amptimer.c 19 Jan 2021 18:04:43 -0000 1.10
> +++ ./arch/arm/cortex/amptimer.c 19 Feb 2021 02:57:56 -0000
> @@ -67,7 +67,14 @@ int32_t amptimer_frequency = TIMER_FREQU
> 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: ./arch/arm/cortex/agtimer.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/arm/cortex/agtimer.c,v
> retrieving revision 1.11
> diff -u -p -r1.11 agtimer.c
> --- ./arch/arm/cortex/agtimer.c 19 Jan 2021 18:04:43 -0000 1.11
> +++ ./arch/arm/cortex/agtimer.c 19 Feb 2021 02:57:56 -0000
> @@ -46,7 +46,13 @@ int32_t agtimer_frequency = TIMER_FREQUE
> 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: ./arch/arm64/dev/agtimer.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/arm64/dev/agtimer.c,v
> retrieving revision 1.16
> diff -u -p -r1.16 agtimer.c
> --- ./arch/arm64/dev/agtimer.c 19 Jan 2021 18:07:15 -0000 1.16
> +++ ./arch/arm64/dev/agtimer.c 19 Feb 2021 02:57:56 -0000
> @@ -43,8 +43,14 @@ int32_t agtimer_frequency = TIMER_FREQUE
> 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: ./arch/hppa/dev/clock.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/hppa/dev/clock.c,v
> retrieving revision 1.31
> diff -u -p -r1.31 clock.c
> --- ./arch/hppa/dev/clock.c 6 Jul 2020 13:33:07 -0000 1.31
> +++ ./arch/hppa/dev/clock.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./arch/i386/isa/clock.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/i386/isa/clock.c,v
> retrieving revision 1.59
> diff -u -p -r1.59 clock.c
> --- ./arch/i386/isa/clock.c 6 Jul 2020 13:33:07 -0000 1.59
> +++ ./arch/i386/isa/clock.c 19 Feb 2021 02:57:56 -0000
> @@ -129,7 +129,14 @@ u_int i8254_get_timecount(struct timecou
> 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: ./arch/i386/pci/gscpm.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/i386/pci/gscpm.c,v
> retrieving revision 1.10
> diff -u -p -r1.10 gscpm.c
> --- ./arch/i386/pci/gscpm.c 6 Jul 2020 13:33:07 -0000 1.10
> +++ ./arch/i386/pci/gscpm.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./arch/i386/pci/ichpcib.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/i386/pci/ichpcib.c,v
> retrieving revision 1.29
> diff -u -p -r1.29 ichpcib.c
> --- ./arch/i386/pci/ichpcib.c 6 Jul 2020 13:33:07 -0000 1.29
> +++ ./arch/i386/pci/ichpcib.c 19 Feb 2021 02:57:56 -0000
> @@ -58,14 +58,14 @@ void pcibattach(struct device *, stru
> 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: ./arch/i386/pci/geodesc.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/i386/pci/geodesc.c,v
> retrieving revision 1.15
> diff -u -p -r1.15 geodesc.c
> --- ./arch/i386/pci/geodesc.c 6 Jul 2020 13:33:07 -0000 1.15
> +++ ./arch/i386/pci/geodesc.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./arch/macppc/macppc/clock.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/macppc/macppc/clock.c,v
> retrieving revision 1.47
> diff -u -p -r1.47 clock.c
> --- ./arch/macppc/macppc/clock.c 26 Aug 2020 03:29:06 -0000 1.47
> +++ ./arch/macppc/macppc/clock.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./arch/mips64/mips64/mips64_machdep.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/mips64/mips64/mips64_machdep.c,v
> retrieving revision 1.34
> diff -u -p -r1.34 mips64_machdep.c
> --- ./arch/mips64/mips64/mips64_machdep.c 13 Jan 2021 16:28:49 -0000
> 1.34
> +++ ./arch/mips64/mips64/mips64_machdep.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./arch/sparc64/dev/psycho.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/sparc64/dev/psycho.c,v
> retrieving revision 1.77
> diff -u -p -r1.77 psycho.c
> --- ./arch/sparc64/dev/psycho.c 6 Jul 2020 13:33:08 -0000 1.77
> +++ ./arch/sparc64/dev/psycho.c 19 Feb 2021 02:57:56 -0000
> @@ -127,7 +127,14 @@ extern struct sparc_pci_chipset _sparc_p
> 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: ./arch/sparc64/sparc64/clock.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/sparc64/sparc64/clock.c,v
> retrieving revision 1.67
> diff -u -p -r1.67 clock.c
> --- ./arch/sparc64/sparc64/clock.c 20 Oct 2020 15:59:17 -0000 1.67
> +++ ./arch/sparc64/sparc64/clock.c 19 Feb 2021 02:57:56 -0000
> @@ -109,8 +109,14 @@ 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 *);
> Index: ./arch/powerpc64/powerpc64/clock.c
> ===================================================================
> RCS file: /cvs/src/sys/arch/powerpc64/powerpc64/clock.c,v
> retrieving revision 1.2
> diff -u -p -r1.2 clock.c
> --- ./arch/powerpc64/powerpc64/clock.c 12 Jul 2020 20:32:20 -0000
> 1.2
> +++ ./arch/powerpc64/powerpc64/clock.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./dev/pv/hyperv.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pv/hyperv.c,v
> retrieving revision 1.47
> diff -u -p -r1.47 hyperv.c
> --- ./dev/pv/hyperv.c 4 Dec 2020 03:22:46 -0000 1.47
> +++ ./dev/pv/hyperv.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./dev/pv/pvclock.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pv/pvclock.c,v
> retrieving revision 1.6
> diff -u -p -r1.6 pvclock.c
> --- ./dev/pv/pvclock.c 6 Jul 2020 13:33:09 -0000 1.6
> +++ ./dev/pv/pvclock.c 19 Feb 2021 02:57:56 -0000
> @@ -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: ./dev/acpi/acpihpet.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/acpi/acpihpet.c,v
> retrieving revision 1.24
> diff -u -p -r1.24 acpihpet.c
> --- ./dev/acpi/acpihpet.c 6 Jul 2020 13:33:08 -0000 1.24
> +++ ./dev/acpi/acpihpet.c 19 Feb 2021 02:57:56 -0000
> @@ -40,14 +40,14 @@ void acpihpet_w(bus_space_tag_t _iot, b
> 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: ./dev/acpi/acpitimer.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/acpi/acpitimer.c,v
> retrieving revision 1.13
> diff -u -p -r1.13 acpitimer.c
> --- ./dev/acpi/acpitimer.c 6 Jul 2020 13:33:08 -0000 1.13
> +++ ./dev/acpi/acpitimer.c 19 Feb 2021 02:57:56 -0000
> @@ -31,14 +31,14 @@ void acpitimerattach(struct device *, st
> 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: ./dev/pci/amdpm.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/amdpm.c,v
> retrieving revision 1.36
> diff -u -p -r1.36 amdpm.c
> --- ./dev/pci/amdpm.c 6 Jul 2020 13:33:09 -0000 1.36
> +++ ./dev/pci/amdpm.c 19 Feb 2021 02:57:56 -0000
> @@ -77,14 +77,14 @@ u_int amdpm_get_timecount(struct timecou
> #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: ./dev/pci/viapm.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/viapm.c,v
> retrieving revision 1.19
> diff -u -p -r1.19 viapm.c
> --- ./dev/pci/viapm.c 6 Jul 2020 13:33:09 -0000 1.19
> +++ ./dev/pci/viapm.c 19 Feb 2021 02:57:56 -0000
> @@ -172,14 +172,14 @@ u_int viapm_get_timecount(struct timecou
> #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: ./kern/kern_tc.c
> ===================================================================
> RCS file: /cvs/src/sys/kern/kern_tc.c,v
> retrieving revision 1.70
> diff -u -p -r1.70 kern_tc.c
> --- ./kern/kern_tc.c 5 Dec 2020 04:46:34 -0000 1.70
> +++ ./kern/kern_tc.c 19 Feb 2021 02:57:56 -0000
> @@ -55,7 +55,14 @@ dummy_get_timecount(struct timecounter *
> }
>
> 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,
> };
>
> /*