From 828a71e075cae3d769770c031a6ba43c597f4a40 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 19 Jul 1994 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1994-07-19 --- pc/clock.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pc/clock.c b/pc/clock.c index 499774240109df99041d29ec822ae4a6b32b047e..40d2161fa341252df961ccb2bd93298e0f35c13c 100644 --- a/pc/clock.c +++ b/pc/clock.c @@ -96,7 +96,7 @@ delay(int l) void printcpufreq(void) { - print("CPU is a %ud Hz %d\n", cpufreq, cputype); + print("CPU is a %ud MHz %d\n", cpufreq, cputype); } void @@ -150,7 +150,7 @@ clockinit(void) */ switch(cputype = x86()){ case 386: - cycles = 30; + cycles = 32; break; case 486: cycles = 22; @@ -161,4 +161,7 @@ clockinit(void) } cpufreq = loops*((cycles*Freq)/x); loopconst = (cpufreq/1000)/cycles; /* AAM+LOOP's for 1 ms */ + + /* convert to MHz */ + cpufreq = cpufreq/1000000; }