summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-02-20 13:08:59 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2021-02-20 13:08:59 +0100
commit8b817fd6c01c9e6cfd32d18253ea8fecee78c6ab (patch)
tree5bfae581f47294a9f2d5bd059e471065028d45b2
parent48e795005d6145ab3a09159fbaa992802b657cee (diff)
downloadplan9front-8b817fd6c01c9e6cfd32d18253ea8fecee78c6ab.tar.xz
pc/devarch: use m->cpumhz instead of recalculatin it
-rw-r--r--sys/src/9/pc/devarch.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/src/9/pc/devarch.c b/sys/src/9/pc/devarch.c
index 3276a7a97..928837848 100644
--- a/sys/src/9/pc/devarch.c
+++ b/sys/src/9/pc/devarch.c
@@ -691,11 +691,8 @@ static long
cputyperead(Chan*, void *a, long n, vlong offset)
{
char str[32];
- ulong mhz;
- mhz = (m->cpuhz+999999)/1000000;
-
- snprint(str, sizeof(str), "%s %lud\n", m->cpuidtype, mhz);
+ snprint(str, sizeof(str), "%s %d\n", m->cpuidtype, m->cpumhz);
return readstr(offset, a, n, str);
}
@@ -707,9 +704,8 @@ archctlread(Chan*, void *a, long nn, vlong offset)
p = buf = smalloc(READSTR);
ep = p + READSTR;
- p = seprint(p, ep, "cpu %s %lud%s\n",
- m->cpuidtype, (ulong)(m->cpuhz+999999)/1000000,
- m->havepge ? " pge" : "");
+ p = seprint(p, ep, "cpu %s %d%s\n",
+ m->cpuidtype, m->cpumhz, m->havepge ? " pge" : "");
p = seprint(p, ep, "pge %s\n", getcr4()&0x80 ? "on" : "off");
p = seprint(p, ep, "coherence ");
if(coherence == mb386)