summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/altq/altq_subr.c4
-rw-r--r--sys/arch/i386/i386/est.c4
-rw-r--r--sys/arch/i386/i386/lapic.c4
-rw-r--r--sys/arch/i386/i386/longrun.c4
-rw-r--r--sys/arch/i386/i386/machdep.c18
-rw-r--r--sys/arch/i386/i386/microtime.s4
-rw-r--r--sys/arch/i386/i386/p4tcc.c4
-rw-r--r--sys/arch/i386/i386/powernow-k7.c8
-rw-r--r--sys/arch/i386/i386/powernow-k8.c6
-rw-r--r--sys/arch/i386/i386/procfs_machdep.c6
-rw-r--r--sys/arch/i386/include/cpu.h6
-rw-r--r--sys/arch/i386/isa/clock.c6
-rw-r--r--sys/dev/acpi/acpicpu.c7
13 files changed, 39 insertions, 42 deletions
diff --git a/sys/altq/altq_subr.c b/sys/altq/altq_subr.c
index 098d8851af7..203e00557b7 100644
--- a/sys/altq/altq_subr.c
+++ b/sys/altq/altq_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: altq_subr.c,v 1.20 2006/03/04 22:40:15 brad Exp $ */
+/* $OpenBSD: altq_subr.c,v 1.21 2006/12/20 17:50:40 gwk Exp $ */
/* $KAME: altq_subr.c,v 1.11 2002/01/11 08:11:49 kjc Exp $ */
/*
@@ -776,7 +776,7 @@ init_machclk(void)
*/
#if defined(__i386__) && (defined(I586_CPU) || defined(I686_CPU))
/* XXX - this will break down with variable cpu frequency. */
- machclk_freq = pentium_mhz * 1000000;
+ machclk_freq = cpuspeed * 1000000;
#endif
#if defined(__alpha__)
machclk_freq = (u_int32_t)(cycles_per_usec * 1000000);
diff --git a/sys/arch/i386/i386/est.c b/sys/arch/i386/i386/est.c
index 46c40d5fc6d..81daf530875 100644
--- a/sys/arch/i386/i386/est.c
+++ b/sys/arch/i386/i386/est.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: est.c,v 1.24 2006/12/12 23:14:27 dim Exp $ */
+/* $OpenBSD: est.c,v 1.25 2006/12/20 17:50:40 gwk Exp $ */
/*
* Copyright (c) 2003 Michael Eriksson.
* All rights reserved.
@@ -1083,5 +1083,5 @@ est_setperf(int level)
msr &= ~0xffffULL;
msr |= est_fqlist->table[i];
wrmsr(MSR_PERF_CTL, msr);
- pentium_mhz = MSR2MHZ(est_fqlist->table[i], bus_clock);
+ cpuspeed = MSR2MHZ(est_fqlist->table[i], bus_clock);
}
diff --git a/sys/arch/i386/i386/lapic.c b/sys/arch/i386/i386/lapic.c
index af0c928e53b..877dbfe0dbb 100644
--- a/sys/arch/i386/i386/lapic.c
+++ b/sys/arch/i386/i386/lapic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lapic.c,v 1.9 2006/05/29 09:54:16 mickey Exp $ */
+/* $OpenBSD: lapic.c,v 1.10 2006/12/20 17:50:40 gwk Exp $ */
/* $NetBSD: lapic.c,v 1.1.2.8 2000/02/23 06:10:50 sommerfeld Exp $ */
/*-
@@ -359,7 +359,7 @@ lapic_calibrate_timer(ci)
lapic_frac_cycle_per_usec = tmp;
- scaled_pentium_mhz = (1ULL << 32) / pentium_mhz;
+ scaled_pentium_mhz = (1ULL << 32) / cpuspeed;
/*
* Compute delay in cycles for likely short delays in usec.
diff --git a/sys/arch/i386/i386/longrun.c b/sys/arch/i386/i386/longrun.c
index 357b8c84ca8..89adb585ca8 100644
--- a/sys/arch/i386/i386/longrun.c
+++ b/sys/arch/i386/i386/longrun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: longrun.c,v 1.11 2006/12/12 23:14:27 dim Exp $ */
+/* $OpenBSD: longrun.c,v 1.12 2006/12/20 17:50:40 gwk Exp $ */
/*
* Copyright (c) 2003 Ted Unangst
* Copyright (c) 2001 Tamotsu Hattori
@@ -82,7 +82,7 @@ longrun_update(void *arg)
enable_intr();
write_eflags(eflags);
- pentium_mhz = regs[0];
+ cpuspeed = regs[0];
timeout_add(&longrun_timo, hz);
}
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index 0a2081e9231..2513499c867 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.371 2006/11/29 20:03:19 dim Exp $ */
+/* $OpenBSD: machdep.c,v 1.372 2006/12/20 17:50:40 gwk Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -1800,11 +1800,11 @@ identifycpu(struct cpu_info *ci)
if (ci->ci_feature_flags && (ci->ci_feature_flags & CPUID_TSC)) {
/* Has TSC */
calibrate_cyclecounter();
- if (pentium_mhz > 994) {
+ if (cpuspeed > 994) {
int ghz, fr;
- ghz = (pentium_mhz + 9) / 1000;
- fr = ((pentium_mhz + 9) / 10 ) % 100;
+ ghz = (cpuspeed + 9) / 1000;
+ fr = ((cpuspeed + 9) / 10 ) % 100;
if ((ci->ci_flags & CPUF_PRIMARY) == 0) {
if (fr)
printf(" %d.%02d GHz", ghz, fr);
@@ -1813,7 +1813,7 @@ identifycpu(struct cpu_info *ci)
}
} else {
if ((ci->ci_flags & CPUF_PRIMARY) == 0) {
- printf(" %d MHz", pentium_mhz);
+ printf(" %d MHz", cpuspeed);
}
}
}
@@ -1857,7 +1857,7 @@ identifycpu(struct cpu_info *ci)
#ifndef SMALL_KERNEL
#if defined(I586_CPU) || defined(I686_CPU)
- if (pentium_mhz != 0 && cpu_cpuspeed == NULL)
+ if (cpuspeed != 0 && cpu_cpuspeed == NULL)
cpu_cpuspeed = pentium_cpuspeed;
#endif
#endif
@@ -2152,7 +2152,7 @@ p4_update_cpuspeed(void)
msr = rdmsr(MSR_EBC_FREQUENCY_ID);
mult = ((msr >> 24) & 0xff);
- pentium_mhz = (bus_clock * mult) / 100;
+ cpuspeed = (bus_clock * mult) / 100;
}
void
@@ -2174,7 +2174,7 @@ p3_update_cpuspeed(void)
if (!p3_early)
mult += ((msr >> 27) & 0x1) * 40;
- pentium_mhz = (bus_clock * mult) / 1000;
+ cpuspeed = (bus_clock * mult) / 1000;
}
#endif /* I686_CPU */
@@ -2182,7 +2182,7 @@ p3_update_cpuspeed(void)
int
pentium_cpuspeed(int *freq)
{
- *freq = pentium_mhz;
+ *freq = cpuspeed;
return (0);
}
#endif
diff --git a/sys/arch/i386/i386/microtime.s b/sys/arch/i386/i386/microtime.s
index ac1b1742cb4..356ed272315 100644
--- a/sys/arch/i386/i386/microtime.s
+++ b/sys/arch/i386/i386/microtime.s
@@ -1,4 +1,4 @@
-/* $OpenBSD: microtime.s,v 1.20 2004/06/13 21:49:15 niklas Exp $ */
+/* $OpenBSD: microtime.s,v 1.21 2006/12/20 17:50:40 gwk Exp $ */
/* $NetBSD: microtime.s,v 1.16 1995/04/17 12:06:47 cgd Exp $ */
/*-
@@ -45,7 +45,7 @@
ENTRY(i8254_microtime)
#if defined(I586_CPU) || defined(I686_CPU)
- movl _C_LABEL(pentium_mhz), %ecx
+ movl _C_LABEL(cpuspeed), %ecx
testl %ecx, %ecx
jne pentium_microtime
#else
diff --git a/sys/arch/i386/i386/p4tcc.c b/sys/arch/i386/i386/p4tcc.c
index 4bd7d55930f..d40733c1063 100644
--- a/sys/arch/i386/i386/p4tcc.c
+++ b/sys/arch/i386/i386/p4tcc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: p4tcc.c,v 1.12 2006/12/12 23:14:27 dim Exp $ */
+/* $OpenBSD: p4tcc.c,v 1.13 2006/12/20 17:50:40 gwk Exp $ */
/*
* Copyright (c) 2003 Ted Unangst
* All rights reserved.
@@ -102,7 +102,7 @@ p4tcc_init(int family, int step)
int
p4tcc_cpuspeed(int *speed)
{
- *speed = pentium_mhz / 100 * (p4tcc_level + 12);
+ *speed = cpuspeed / 100 * (p4tcc_level + 12);
return 0;
}
diff --git a/sys/arch/i386/i386/powernow-k7.c b/sys/arch/i386/i386/powernow-k7.c
index aae5da30910..2c8f7102a86 100644
--- a/sys/arch/i386/i386/powernow-k7.c
+++ b/sys/arch/i386/i386/powernow-k7.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: powernow-k7.c,v 1.29 2006/12/12 23:14:27 dim Exp $ */
+/* $OpenBSD: powernow-k7.c,v 1.30 2006/12/20 17:50:40 gwk Exp $ */
/*
* Copyright (c) 2004 Martin Végiard.
@@ -196,7 +196,7 @@ k7_powernow_setperf(int level)
cfid = PN7_STA_CFID(status);
cvid = PN7_STA_CVID(status);
if (cfid == fid || cvid == vid)
- pentium_mhz = cstate->state_table[i].freq;
+ cpuspeed = cstate->state_table[i].freq;
}
/*
@@ -326,7 +326,7 @@ k7_powernow_init(void)
startvid = PN7_STA_SVID(status);
currentfid = PN7_STA_CFID(status);
- cstate->fsb = pentium_mhz / (k7pnow_fid_to_mult[currentfid]/10);
+ cstate->fsb = cpuspeed / (k7pnow_fid_to_mult[currentfid]/10);
/* if the base CPUID signature fails to match try, the extended one */
if (!k7pnow_states(cstate, ci->ci_signature, maxfid, startvid))
@@ -337,7 +337,7 @@ k7_powernow_init(void)
else
techname = "PowerNow! K7";
printf("%s: %s %d MHz: speeds:",
- ci->ci_dev.dv_xname, techname, pentium_mhz);
+ ci->ci_dev.dv_xname, techname, cpuspeed);
for (i = cstate->n_states; i > 0; i--) {
state = &cstate->state_table[i-1];
printf(" %d", state->freq);
diff --git a/sys/arch/i386/i386/powernow-k8.c b/sys/arch/i386/i386/powernow-k8.c
index 738e1eb96b8..a37ce8705bc 100644
--- a/sys/arch/i386/i386/powernow-k8.c
+++ b/sys/arch/i386/i386/powernow-k8.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: powernow-k8.c,v 1.20 2006/12/12 23:14:27 dim Exp $ */
+/* $OpenBSD: powernow-k8.c,v 1.21 2006/12/20 17:50:40 gwk Exp $ */
/*
* Copyright (c) 2004 Martin Végiard.
@@ -259,7 +259,7 @@ k8_powernow_setperf(int level)
}
if (cfid == fid || cvid == vid)
- pentium_mhz = cstate->state_table[i].freq;
+ cpuspeed = cstate->state_table[i].freq;
}
/*
@@ -391,7 +391,7 @@ k8_powernow_init(void)
k8pnow_states(cstate, regs[0], maxfid, maxvid);
if (cstate->n_states) {
printf("%s: %s %d MHz: speeds:",
- ci->ci_dev.dv_xname, techname, pentium_mhz);
+ ci->ci_dev.dv_xname, techname, cpuspeed);
for (i = cstate->n_states; i > 0; i--) {
state = &cstate->state_table[i-1];
printf(" %d", state->freq);
diff --git a/sys/arch/i386/i386/procfs_machdep.c b/sys/arch/i386/i386/procfs_machdep.c
index 3316e6a0ae9..3a3fd5f4448 100644
--- a/sys/arch/i386/i386/procfs_machdep.c
+++ b/sys/arch/i386/i386/procfs_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: procfs_machdep.c,v 1.5 2006/11/29 20:03:20 dim Exp $ */
+/* $OpenBSD: procfs_machdep.c,v 1.6 2006/12/20 17:50:40 gwk Exp $ */
/* $NetBSD: procfs_machdep.c,v 1.6 2001/02/21 21:39:59 jdolecek Exp $ */
/*
@@ -124,9 +124,9 @@ procfs_getcpuinfstr(char *buf, int *len)
return 0;
#if defined(I586_CPU) || defined(I686_CPU)
- if (pentium_mhz != 0)
+ if (cpuspeed != 0)
l = snprintf(p, left, "cpu MHz\t\t: %d\n",
- pentium_mhz);
+ cpuspeed);
else
#endif
l = snprintf(p, left, "cpu MHz\t\t: unknown\n");
diff --git a/sys/arch/i386/include/cpu.h b/sys/arch/i386/include/cpu.h
index d6b43259c55..9cd4923d30f 100644
--- a/sys/arch/i386/include/cpu.h
+++ b/sys/arch/i386/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.84 2006/12/12 23:14:27 dim Exp $ */
+/* $OpenBSD: cpu.h,v 1.85 2006/12/20 17:50:40 gwk Exp $ */
/* $NetBSD: cpu.h,v 1.35 1996/05/05 19:29:26 christos Exp $ */
/*-
@@ -247,7 +247,7 @@ void calibrate_cyclecounter(void);
extern u_quad_t pentium_base_tsc;
#define CPU_CLOCKUPDATE() \
do { \
- if (pentium_mhz) { \
+ if (cpuspeed) { \
__asm __volatile("cli\n" \
"rdtsc\n" \
: "=A" (pentium_base_tsc) \
@@ -311,7 +311,7 @@ extern const struct cpu_cpuid_nameclass i386_cpuid_cpus[];
extern int cpu_apmwarn;
#if defined(I586_CPU) || defined(I686_CPU)
-extern int pentium_mhz;
+extern int cpuspeed;
extern int bus_clock;
#endif
diff --git a/sys/arch/i386/isa/clock.c b/sys/arch/i386/isa/clock.c
index 4c8a4073c8c..0fd1090e682 100644
--- a/sys/arch/i386/isa/clock.c
+++ b/sys/arch/i386/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.37 2006/09/19 11:06:33 jsg Exp $ */
+/* $OpenBSD: clock.c,v 1.38 2006/12/20 17:50:40 gwk Exp $ */
/* $NetBSD: clock.c,v 1.39 1996/05/12 23:11:54 mycroft Exp $ */
/*-
@@ -119,7 +119,7 @@ u_int mc146818_read(void *, u_int);
void mc146818_write(void *, u_int, u_int);
#if defined(I586_CPU) || defined(I686_CPU)
-int pentium_mhz;
+int cpuspeed;
#endif
#if defined(I486_CPU) || defined(I586_CPU) || defined(I686_CPU)
int clock_broken_latch;
@@ -384,7 +384,7 @@ calibrate_cyclecounter(void)
__asm __volatile("rdtsc" : "=A" (last_count));
delay(1000000);
__asm __volatile("rdtsc" : "=A" (count));
- pentium_mhz = ((count - last_count) + 999999) / 1000000;
+ cpuspeed = ((count - last_count) + 999999) / 1000000;
}
#endif
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index 0562f3b215f..3398c148c6d 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.13 2006/12/19 20:28:11 gwk Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.14 2006/12/20 17:50:40 gwk Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -313,10 +313,7 @@ acpicpu_setperf(int level) {
/* Did the transition succeed? */
if (status == pss->pss_status)
-#ifdef __i386__
- pentium_mhz = pss->pss_core_freq;
-#elif __amd64__
cpuspeed = pss->pss_core_freq;
-#endif
+
return;
}