summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/cputemp.c
diff options
context:
space:
mode:
authoraiju <devnull@localhost>2018-07-11 14:50:22 +0100
committeraiju <devnull@localhost>2018-07-11 14:50:22 +0100
commit3a77c01f43821dcc4f7cae54aff89bb20f2d95a5 (patch)
tree2934609fdeebaddaf8f5d28601b488ba5a3d8d74 /sys/src/9/pc/cputemp.c
parent911df94e5d712d7e2eebb4a3997efce17e2599f2 (diff)
pc kernel: get rid of ugly and partially broken cpuid macros
Diffstat (limited to 'sys/src/9/pc/cputemp.c')
-rw-r--r--sys/src/9/pc/cputemp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/src/9/pc/cputemp.c b/sys/src/9/pc/cputemp.c
index 61b939f3f..a7a1dcf68 100644
--- a/sys/src/9/pc/cputemp.c
+++ b/sys/src/9/pc/cputemp.c
@@ -35,7 +35,7 @@ cputemprd0(Chan*, void *a, long n, vlong offset)
* magic undocumented msr. tj(max) is 100 or 85.
*/
tj = 100;
- d = X86MODEL(m->cpuidax);
+ d = m->cpuidmodel;
d |= (m->cpuidax>>12) & 0xf0;
if((d == 0xf && (m->cpuidax & 0xf)>1) || d == 0xe){
if(rdmsr(0xee, &emsr) == 0){
@@ -109,7 +109,7 @@ amd0ftemprd(Chan*, void *a, long n, vlong offset)
for(j = 0; j < max; j++){
pcicfgw32(p, 0xe4, pcicfgr32(p, 0xe4) & ~4 | j<<2);
i = pcicfgr32(p, 0xe4);
- if(X86STEPPING(m->cpuidax) == 2)
+ if(m->cpuidstepping == 2)
t = i>>16 & 0xff;
else{
t = i>>14 & 0x3ff;
@@ -165,8 +165,8 @@ cputemplink(void)
{
if(intelcputempok())
addarchfile("cputemp", 0444, intelcputemprd, nil);
- if(X86FAMILY(m->cpuidax) == 0x0f && !strcmp(m->cpuidid, "AuthenticAMD"))
+ if(m->cpuidfamily == 0x0f && !strcmp(m->cpuidid, "AuthenticAMD"))
addarchfile("cputemp", 0444, amd0ftemprd, nil);
- if(X86FAMILY(m->cpuidax) == 0x10 && !strcmp(m->cpuidid, "AuthenticAMD"))
+ if(m->cpuidfamily == 0x10 && !strcmp(m->cpuidid, "AuthenticAMD"))
addarchfile("cputemp", 0444, amd10temprd, nil);
}