summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2012-08-16 18:42:05 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2012-08-16 18:42:05 +0000
commit6abd5d8bff69241fcfc49372af3a0a4ac2960f1b (patch)
treec27412007fb60f0a00e042ff3cc615a7b65a2fb6 /sys
parentb6314326114bec33f9e727e1692ad9ea3ef3369e (diff)
we are past the point where timecounters may disappear
ok miod
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/pci/geodesc.c10
-rw-r--r--sys/arch/i386/pci/gscpm.c10
-rw-r--r--sys/arch/i386/pci/ichpcib.c10
-rw-r--r--sys/dev/acpi/acpihpet.c10
-rw-r--r--sys/dev/acpi/acpitimer.c10
-rw-r--r--sys/dev/pci/amdpm.c10
-rw-r--r--sys/dev/pci/viapm.c10
7 files changed, 7 insertions, 63 deletions
diff --git a/sys/arch/i386/pci/geodesc.c b/sys/arch/i386/pci/geodesc.c
index 128c5caa0fc..b9e74f84564 100644
--- a/sys/arch/i386/pci/geodesc.c
+++ b/sys/arch/i386/pci/geodesc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: geodesc.c,v 1.9 2006/12/11 20:57:40 deraadt Exp $ */
+/* $OpenBSD: geodesc.c,v 1.10 2012/08/16 18:42:04 tedu Exp $ */
/*
* Copyright (c) 2003 Markus Friedl <markus@openbsd.org>
@@ -25,9 +25,7 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
-#ifdef __HAVE_TIMECOUNTER
#include <sys/timetc.h>
-#endif
#include <machine/bus.h>
@@ -58,7 +56,6 @@ struct cfdriver geodesc_cd = {
NULL, "geodesc", DV_DULL
};
-#ifdef __HAVE_TIMECOUNTER
u_int geodesc_get_timecount(struct timecounter *tc);
struct timecounter geodesc_timecounter = {
@@ -69,7 +66,6 @@ struct timecounter geodesc_timecounter = {
"GEOTSC", /* name */
2000 /* quality */
};
-#endif /* __HAVE_TIMECOUNTER */
int
geodesc_match(struct device *parent, void *match, void *aux)
@@ -127,12 +123,10 @@ geodesc_attach(struct device *parent, struct device *self, void *aux)
wdog_register(sc, geodesc_wdogctl_cb);
#endif /* SMALL_KERNEL */
-#ifdef __HAVE_TIMECOUNTER
bus_space_write_4(sc->sc_iot, sc->sc_ioh, GCB_TSCNFG, TSC_ENABLE);
/* Hook into the kern_tc */
geodesc_timecounter.tc_priv = sc;
tc_init(&geodesc_timecounter);
-#endif /* __HAVE_TIMECOUNTER */
/* We have a special way to reset the CPU on the SC1100 */
cpuresetfn = sc1100_sysreset;
@@ -151,7 +145,6 @@ geodesc_wdogctl_cb(void *self, int period)
}
#endif /* SMALL_KERNEL */
-#ifdef __HAVE_TIMECOUNTER
u_int
geodesc_get_timecount(struct timecounter *tc)
{
@@ -159,7 +152,6 @@ geodesc_get_timecount(struct timecounter *tc)
return (bus_space_read_4(sc->sc_iot, sc->sc_ioh, GCB_TSC));
}
-#endif /* __HAVE_TIMECOUNTER */
void
sc1100_sysreset(void)
diff --git a/sys/arch/i386/pci/gscpm.c b/sys/arch/i386/pci/gscpm.c
index abcbfa040ad..8b8aa4ac430 100644
--- a/sys/arch/i386/pci/gscpm.c
+++ b/sys/arch/i386/pci/gscpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gscpm.c,v 1.8 2010/08/02 04:37:42 deraadt Exp $ */
+/* $OpenBSD: gscpm.c,v 1.9 2012/08/16 18:42:04 tedu Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -23,9 +23,7 @@
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/kernel.h>
-#ifdef __HAVE_TIMECOUNTER
#include <sys/timetc.h>
-#endif
#include <machine/bus.h>
@@ -49,7 +47,6 @@ void gscpm_attach(struct device *, struct device *, void *);
void gscpm_setperf(int);
-#ifdef __HAVE_TIMECOUNTER
u_int gscpm_get_timecount(struct timecounter *tc);
struct timecounter gscpm_timecounter = {
@@ -60,7 +57,6 @@ struct timecounter gscpm_timecounter = {
"GSCPM", /* name */
1000 /* quality */
};
-#endif /* __HAVE_TIMECOUNTER */
struct cfattach gscpm_ca = {
sizeof (struct gscpm_softc),
@@ -115,11 +111,9 @@ gscpm_attach(struct device *parent, struct device *self, void *aux)
printf("\n");
-#ifdef __HAVE_TIMECOUNTER
/* Hook into the kern_tc */
gscpm_timecounter.tc_priv = sc;
tc_init(&gscpm_timecounter);
-#endif /* __HAVE_TIMECOUNTER */
/* XXX: disabled due to unresolved yet hardware errata */
#if 0
@@ -130,7 +124,6 @@ gscpm_attach(struct device *parent, struct device *self, void *aux)
}
-#ifdef __HAVE_TIMECOUNTER
u_int
gscpm_get_timecount(struct timecounter *tc)
{
@@ -138,7 +131,6 @@ gscpm_get_timecount(struct timecounter *tc)
return (bus_space_read_4(sc->sc_iot, sc->sc_acpi_ioh, GSCPM_PM_TMR));
}
-#endif /* __HAVE_TIMECOUNTER */
#if 0
void
diff --git a/sys/arch/i386/pci/ichpcib.c b/sys/arch/i386/pci/ichpcib.c
index 3ae1ea50d04..c35e2259130 100644
--- a/sys/arch/i386/pci/ichpcib.c
+++ b/sys/arch/i386/pci/ichpcib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ichpcib.c,v 1.25 2010/07/08 20:17:54 deraadt Exp $ */
+/* $OpenBSD: ichpcib.c,v 1.26 2012/08/16 18:42:04 tedu Exp $ */
/*
* Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org>
*
@@ -27,9 +27,7 @@
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/sysctl.h>
-#ifdef __HAVE_TIMECOUNTER
#include <sys/timetc.h>
-#endif
#include <machine/bus.h>
@@ -58,7 +56,6 @@ void ichss_setperf(int);
/* arch/i386/pci/pcib.c */
void pcibattach(struct device *, struct device *, void *);
-#ifdef __HAVE_TIMECOUNTER
u_int ichpcib_get_timecount(struct timecounter *tc);
struct timecounter ichpcib_timecounter = {
@@ -69,7 +66,6 @@ struct timecounter ichpcib_timecounter = {
"ICHPM", /* name */
1000 /* quality */
};
-#endif /* __HAVE_TIMECOUNTER */
struct cfattach ichpcib_ca = {
sizeof(struct ichpcib_softc),
@@ -146,7 +142,6 @@ ichpcib_attach(struct device *parent, struct device *self, void *aux)
ICH_PMSIZE, 0, &sc->sc_pm_ioh) != 0)
goto corepcib;
-#ifdef __HAVE_TIMECOUNTER
/* Register new timecounter */
ichpcib_timecounter.tc_priv = sc;
tc_init(&ichpcib_timecounter);
@@ -154,7 +149,6 @@ ichpcib_attach(struct device *parent, struct device *self, void *aux)
printf(": %s-bit timer at %lluHz",
(ichpcib_timecounter.tc_counter_mask == 0xffffffff ? "32" : "24"),
(unsigned long long)ichpcib_timecounter.tc_frequency);
-#endif /* __HAVE_TIMECOUNTER */
#ifndef SMALL_KERNEL
/* Check for SpeedStep */
@@ -304,7 +298,6 @@ ichss_setperf(int level)
}
#endif /* !SMALL_KERNEL */
-#ifdef __HAVE_TIMECOUNTER
u_int
ichpcib_get_timecount(struct timecounter *tc)
{
@@ -322,4 +315,3 @@ ichpcib_get_timecount(struct timecounter *tc)
return (u2);
}
-#endif /* __HAVE_TIMECOUNTER */
diff --git a/sys/dev/acpi/acpihpet.c b/sys/dev/acpi/acpihpet.c
index 6df201382a5..697a5e704f3 100644
--- a/sys/dev/acpi/acpihpet.c
+++ b/sys/dev/acpi/acpihpet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpihpet.c,v 1.13 2011/01/10 13:36:57 mikeb Exp $ */
+/* $OpenBSD: acpihpet.c,v 1.14 2012/08/16 18:41:17 tedu Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -19,9 +19,7 @@
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
-#ifdef __HAVE_TIMECOUNTER
#include <sys/timetc.h>
-#endif
#include <machine/bus.h>
@@ -35,7 +33,6 @@ int acpihpet_match(struct device *, void *, void *);
void acpihpet_attach(struct device *, struct device *, void *);
int acpihpet_activate(struct device *, int);
-#ifdef __HAVE_TIMECOUNTER
u_int acpihpet_gettime(struct timecounter *tc);
static struct timecounter hpet_timecounter = {
@@ -46,7 +43,6 @@ static struct timecounter hpet_timecounter = {
0, /* name */
1000 /* quality */
};
-#endif
struct acpihpet_softc {
struct device sc_dev;
@@ -166,16 +162,13 @@ acpihpet_attach(struct device *parent, struct device *self, void *aux)
freq = 1000000000000000ull / period;
printf(": %lld Hz\n", freq);
-#ifdef __HAVE_TIMECOUNTER
hpet_timecounter.tc_frequency = (u_int32_t)freq;
hpet_timecounter.tc_priv = sc;
hpet_timecounter.tc_name = sc->sc_dev.dv_xname;
tc_init(&hpet_timecounter);
-#endif
acpihpet_attached++;
}
-#ifdef __HAVE_TIMECOUNTER
u_int
acpihpet_gettime(struct timecounter *tc)
{
@@ -183,4 +176,3 @@ acpihpet_gettime(struct timecounter *tc)
return (bus_space_read_4(sc->sc_iot, sc->sc_ioh, HPET_MAIN_COUNTER));
}
-#endif
diff --git a/sys/dev/acpi/acpitimer.c b/sys/dev/acpi/acpitimer.c
index a9a4b13d08e..11285b54ab3 100644
--- a/sys/dev/acpi/acpitimer.c
+++ b/sys/dev/acpi/acpitimer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpitimer.c,v 1.9 2011/04/22 18:22:01 jordan Exp $ */
+/* $OpenBSD: acpitimer.c,v 1.10 2012/08/16 18:41:17 tedu Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -19,9 +19,7 @@
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
-#ifdef __HAVE_TIMECOUNTER
#include <sys/timetc.h>
-#endif
#include <machine/bus.h>
@@ -31,7 +29,6 @@
int acpitimermatch(struct device *, void *, void *);
void acpitimerattach(struct device *, struct device *, void *);
-#ifdef __HAVE_TIMECOUNTER
u_int acpi_get_timecount(struct timecounter *tc);
static struct timecounter acpi_timecounter = {
@@ -42,7 +39,6 @@ static struct timecounter acpi_timecounter = {
0, /* name */
1000 /* quality */
};
-#endif
struct acpitimer_softc {
struct device sc_dev;
@@ -96,17 +92,14 @@ acpitimerattach(struct device *parent, struct device *self, void *aux)
printf(": %d Hz, %d bits\n", ACPI_FREQUENCY,
psc->sc_fadt->flags & FADT_TMR_VAL_EXT ? 32 : 24);
-#ifdef __HAVE_TIMECOUNTER
if (psc->sc_fadt->flags & FADT_TMR_VAL_EXT)
acpi_timecounter.tc_counter_mask = 0xffffffffU;
acpi_timecounter.tc_priv = sc;
acpi_timecounter.tc_name = sc->sc_dev.dv_xname;
tc_init(&acpi_timecounter);
-#endif
}
-#ifdef __HAVE_TIMECOUNTER
u_int
acpi_get_timecount(struct timecounter *tc)
{
@@ -123,4 +116,3 @@ acpi_get_timecount(struct timecounter *tc)
return (u2);
}
-#endif
diff --git a/sys/dev/pci/amdpm.c b/sys/dev/pci/amdpm.c
index 85cf4b9d04b..ae7baae9e43 100644
--- a/sys/dev/pci/amdpm.c
+++ b/sys/dev/pci/amdpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: amdpm.c,v 1.26 2011/04/09 04:33:40 deraadt Exp $ */
+/* $OpenBSD: amdpm.c,v 1.27 2012/08/16 18:41:17 tedu Exp $ */
/*
* Copyright (c) 2006 Alexander Yurchenko <grange@openbsd.org>
@@ -51,9 +51,7 @@
#include <sys/kernel.h>
#include <sys/rwlock.h>
#include <sys/timeout.h>
-#ifdef __HAVE_TIMECOUNTER
#include <sys/timetc.h>
-#endif
#include <machine/bus.h>
@@ -73,7 +71,6 @@
#define AMDPM_SMBUS_DELAY 100
#define AMDPM_SMBUS_TIMEOUT 1
-#ifdef __HAVE_TIMECOUNTER
u_int amdpm_get_timecount(struct timecounter *tc);
#ifndef AMDPM_FREQUENCY
@@ -88,7 +85,6 @@ static struct timecounter amdpm_timecounter = {
"AMDPM", /* name */
1000 /* quality */
};
-#endif
#define AMDPM_CONFREG 0x40
@@ -247,7 +243,6 @@ amdpm_attach(struct device *parent, struct device *self, void *aux)
return;
}
-#ifdef __HAVE_TIMECOUNTER
if ((cfg_reg & AMDPM_TMRRST) == 0 &&
(cfg_reg & AMDPM_STOPTMR) == 0 &&
(PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_PBC768_PMC ||
@@ -261,7 +256,6 @@ amdpm_attach(struct device *parent, struct device *self, void *aux)
amdpm_timecounter.tc_counter_mask = 0xffffffffu;
tc_init(&amdpm_timecounter);
}
-#endif
if (PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_PBC768_PMC ||
PCI_PRODUCT(pa->pa_id) == PCI_PRODUCT_AMD_8111_PMC) {
if ((cfg_reg & AMDPM_RNGEN) ==0) {
@@ -350,7 +344,6 @@ amdpm_rnd_callout(void *v)
timeout_add(&sc->sc_rnd_ch, 1);
}
-#ifdef __HAVE_TIMECOUNTER
u_int
amdpm_get_timecount(struct timecounter *tc)
{
@@ -371,7 +364,6 @@ amdpm_get_timecount(struct timecounter *tc)
#endif
return (u2);
}
-#endif
int
amdpm_i2c_acquire_bus(void *cookie, int flags)
diff --git a/sys/dev/pci/viapm.c b/sys/dev/pci/viapm.c
index 4ba22e9835c..cbf20ffd588 100644
--- a/sys/dev/pci/viapm.c
+++ b/sys/dev/pci/viapm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: viapm.c,v 1.14 2011/04/10 20:27:02 shadchin Exp $ */
+/* $OpenBSD: viapm.c,v 1.15 2012/08/16 18:41:17 tedu Exp $ */
/*
* Copyright (c) 2005 Mark Kettenis <kettenis@openbsd.org>
@@ -64,9 +64,7 @@
#include <sys/rwlock.h>
#include <sys/sensors.h>
#include <sys/timeout.h>
-#ifdef __HAVE_TIMECOUNTER
#include <sys/timetc.h>
-#endif
#include <machine/bus.h>
@@ -167,7 +165,6 @@
#define VIAPM_NUM_SENSORS 10 /* three temp, two fan, five voltage */
-#ifdef __HAVE_TIMECOUNTER
u_int viapm_get_timecount(struct timecounter *tc);
#ifndef VIAPM_FREQUENCY
@@ -182,7 +179,6 @@ static struct timecounter viapm_timecounter = {
"VIAPM", /* name */
1000 /* quality */
};
-#endif /* __HAVE_TIMECOUNTER */
struct timeout viapm_timeout;
@@ -391,7 +387,6 @@ viapm_attach(struct device *parent, struct device *self, void *aux)
nosmb:
-#ifdef __HAVE_TIMECOUNTER
/* Power management */
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_VIATECH_VT82C596:
@@ -436,7 +431,6 @@ nosmb:
(unsigned long long)viapm_timecounter.tc_frequency);
nopm:
-#endif /* __HAVE_TIMECOUNTER */
/* HWMon */
switch (PCI_PRODUCT(pa->pa_id)) {
@@ -764,7 +758,6 @@ viapm_refresh(void *arg)
timeout_add_msec(&viapm_timeout, 1500);
}
-#ifdef __HAVE_TIMECOUNTER
u_int
viapm_get_timecount(struct timecounter *tc)
{
@@ -781,4 +774,3 @@ viapm_get_timecount(struct timecounter *tc)
return (u2);
}
-#endif /* __HAVE_TIMECOUNTER */