summaryrefslogtreecommitdiffstats
path: root/sys/amd64/isa
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-01-29 11:36:39 +0000
committerphk <phk@FreeBSD.org>2003-01-29 11:36:39 +0000
commit36fe9fb493ad9b28c42a7b1610c704856e07467c (patch)
treeb613402a73ac4da505804ca5121a5149306cffd3 /sys/amd64/isa
parent13e0104093cd42571839d9306eaa407ea60dbe4e (diff)
downloadFreeBSD-src-36fe9fb493ad9b28c42a7b1610c704856e07467c.zip
FreeBSD-src-36fe9fb493ad9b28c42a7b1610c704856e07467c.tar.gz
Make tsc_freq a 64bit quantity.
Inspired by: http://www.theinquirer.net/?article=7481
Diffstat (limited to 'sys/amd64/isa')
-rw-r--r--sys/amd64/isa/clock.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/amd64/isa/clock.c b/sys/amd64/isa/clock.c
index 140f6bc..98ef6f78 100644
--- a/sys/amd64/isa/clock.c
+++ b/sys/amd64/isa/clock.c
@@ -53,6 +53,7 @@
#include "opt_mca.h"
#include <sys/param.h>
+#include <sys/stdint.h>
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/lock.h>
@@ -135,7 +136,7 @@ int statclock_disable;
#endif
u_int timer_freq = TIMER_FREQ;
int timer0_max_count;
-u_int tsc_freq;
+uint64_t tsc_freq;
int tsc_is_broken;
u_int tsc_present;
int wall_cmos_clock; /* wall CMOS clock assumed if != 0 */
@@ -663,7 +664,7 @@ calibrate_clocks(void)
if (bootverbose) {
if (tsc_present)
- printf("TSC clock: %u Hz, ", tsc_freq);
+ printf("TSC clock: %ju Hz, ", (intmax_t)tsc_freq);
printf("i8254 clock: %u Hz\n", tot_count);
}
return (tot_count);
@@ -803,7 +804,8 @@ startrtclock()
tsc_freq = rdtsc() - old_tsc;
#ifdef CLK_USE_TSC_CALIBRATION
if (bootverbose)
- printf("TSC clock: %u Hz (Method B)\n", tsc_freq);
+ printf("TSC clock: %ju Hz (Method B)\n",
+ (intmax_t)tsc_freq);
#endif
}
@@ -1204,7 +1206,7 @@ static int
sysctl_machdep_tsc_freq(SYSCTL_HANDLER_ARGS)
{
int error;
- u_int freq;
+ uint64_t freq;
if (tsc_timecounter.tc_frequency == 0)
return (EOPNOTSUPP);
@@ -1217,7 +1219,7 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_ARGS)
return (error);
}
-SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_INT | CTLFLAG_RW,
+SYSCTL_PROC(_machdep, OID_AUTO, tsc_freq, CTLTYPE_QUAD | CTLFLAG_RW,
0, sizeof(u_int), sysctl_machdep_tsc_freq, "IU", "");
static unsigned
OpenPOWER on IntegriCloud