timecounters are here to stay, at least for those archs where
timecounters have arrived. remove some now useless guards.
Index: arch/i386/pci/geodesc.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/pci/geodesc.c,v
retrieving revision 1.9
diff -u -p -r1.9 geodesc.c
--- arch/i386/pci/geodesc.c 11 Dec 2006 20:57:40 -0000 1.9
+++ arch/i386/pci/geodesc.c 15 Aug 2012 15:11:10 -0000
@@ -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, st
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 perio
}
#endif /* SMALL_KERNEL */
-#ifdef __HAVE_TIMECOUNTER
u_int
geodesc_get_timecount(struct timecounter *tc)
{
@@ -159,7 +152,6 @@ geodesc_get_timecount(struct timecounter
return (bus_space_read_4(sc->sc_iot, sc->sc_ioh, GCB_TSC));
}
-#endif /* __HAVE_TIMECOUNTER */
void
sc1100_sysreset(void)
Index: arch/i386/pci/gscpm.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/pci/gscpm.c,v
retrieving revision 1.8
diff -u -p -r1.8 gscpm.c
--- arch/i386/pci/gscpm.c 2 Aug 2010 04:37:42 -0000 1.8
+++ arch/i386/pci/gscpm.c 15 Aug 2012 15:11:29 -0000
@@ -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 *, struc
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, stru
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, stru
}
-#ifdef __HAVE_TIMECOUNTER
u_int
gscpm_get_timecount(struct timecounter *tc)
{
@@ -138,7 +131,6 @@ gscpm_get_timecount(struct timecounter *
return (bus_space_read_4(sc->sc_iot, sc->sc_acpi_ioh, GSCPM_PM_TMR));
}
-#endif /* __HAVE_TIMECOUNTER */
#if 0
void
Index: arch/i386/pci/ichpcib.c
===================================================================
RCS file: /cvs/src/sys/arch/i386/pci/ichpcib.c,v
retrieving revision 1.25
diff -u -p -r1.25 ichpcib.c
--- arch/i386/pci/ichpcib.c 8 Jul 2010 20:17:54 -0000 1.25
+++ arch/i386/pci/ichpcib.c 15 Aug 2012 15:11:47 -0000
@@ -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, st
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, st
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
return (u2);
}
-#endif /* __HAVE_TIMECOUNTER */
Index: dev/pci/amdpm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/amdpm.c,v
retrieving revision 1.26
diff -u -p -r1.26 amdpm.c
--- dev/pci/amdpm.c 9 Apr 2011 04:33:40 -0000 1.26
+++ dev/pci/amdpm.c 15 Aug 2012 15:17:24 -0000
@@ -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_timecoun
"AMDPM", /* name */
1000 /* quality */
};
-#endif
#define AMDPM_CONFREG 0x40
@@ -247,7 +243,6 @@ amdpm_attach(struct device *parent, stru
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, stru
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 *
#endif
return (u2);
}
-#endif
int
amdpm_i2c_acquire_bus(void *cookie, int flags)
Index: dev/pci/viapm.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/viapm.c,v
retrieving revision 1.14
diff -u -p -r1.14 viapm.c
--- dev/pci/viapm.c 10 Apr 2011 20:27:02 -0000 1.14
+++ dev/pci/viapm.c 15 Aug 2012 15:17:48 -0000
@@ -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_timecoun
"VIAPM", /* name */
1000 /* quality */
};
-#endif /* __HAVE_TIMECOUNTER */
struct timeout viapm_timeout;
@@ -391,7 +387,6 @@ viapm_attach(struct device *parent, stru
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 *
return (u2);
}
-#endif /* __HAVE_TIMECOUNTER */
Index: dev/acpi/acpihpet.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpihpet.c,v
retrieving revision 1.13
diff -u -p -r1.13 acpihpet.c
--- dev/acpi/acpihpet.c 10 Jan 2011 13:36:57 -0000 1.13
+++ dev/acpi/acpihpet.c 15 Aug 2012 15:16:30 -0000
@@ -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 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 = {
@@ -44,9 +41,8 @@ static struct timecounter hpet_timecount
0xffffffff, /* counter_mask (24 bits) */
0, /* frequency */
0, /* name */
- 1000 /* quality */
+ 2000 /* quality */
};
-#endif
struct acpihpet_softc {
struct device sc_dev;
@@ -166,16 +162,13 @@ acpihpet_attach(struct device *parent, s
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
Index: dev/acpi/acpitimer.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpitimer.c,v
retrieving revision 1.9
diff -u -p -r1.9 acpitimer.c
--- dev/acpi/acpitimer.c 22 Apr 2011 18:22:01 -0000 1.9
+++ dev/acpi/acpitimer.c 15 Aug 2012 15:16:53 -0000
@@ -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_timecount
0, /* name */
1000 /* quality */
};
-#endif
struct acpitimer_softc {
struct device sc_dev;
@@ -96,17 +92,14 @@ acpitimerattach(struct device *parent, s
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 *t
return (u2);
}
-#endif