-/* $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 $ */
/*
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;
-/* $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>
#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
-/* $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 $ */
/*-
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 *);
-/* $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>
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 {
-/* $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>
*
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
-/* $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>
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 {
-/* $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>
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;
-/* $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>
*
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;
-/* $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>
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;
-/* $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
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;
-/* $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 $ */
/*-
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;
-/* $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>
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
-/* $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>
*
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 = {
-/* $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>
*
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 = {
-/* $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 $ */
/*
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 */
-/* $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.
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
-/* $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>
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);
-/* $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 $ */
/*
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,
};
/*
-/* $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 $ */
/*
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,
};
/*
-/* $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>
*
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
-/* $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>
*
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 {
-/* $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>
#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
-/* $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>
#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;
};
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 = {
-/* $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>
};
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
-/* $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>
}
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,
};
/*