diff options
author | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2006-06-13 00:36:40 +0000 |
---|---|---|
committer | Gordon Willem Klok <gwk@cvs.openbsd.org> | 2006-06-13 00:36:40 +0000 |
commit | 9b34a6bc79bc65c35ee5f61a68160004d3ee5156 (patch) | |
tree | 9ef5402b53af340952924bfa45718e98762e43f3 | |
parent | 5ba3b5d5112c923baddb3cac038b88e5f4dd74c7 (diff) |
When adjusting the performance of the processor using p4tcc, the CPUs
frequency remains unaltered. Remove the unecessary call to update_cpuspeed(),
and add check the sucess of the operation, returing EIO in the event of
failure.
ok tedu@
-rw-r--r-- | sys/arch/i386/i386/p4tcc.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/p4tcc.c b/sys/arch/i386/i386/p4tcc.c index 5e3aff1adab..bb97531642f 100644 --- a/sys/arch/i386/i386/p4tcc.c +++ b/sys/arch/i386/i386/p4tcc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p4tcc.c,v 1.5 2004/06/06 17:34:37 grange Exp $ */ +/* $OpenBSD: p4tcc.c,v 1.6 2006/06/13 00:36:39 gwk Exp $ */ /* * Copyright (c) 2003 Ted Unangst * All rights reserved. @@ -96,7 +96,7 @@ int p4tcc_setperf(int level) { int i; - uint64_t msreg; + uint64_t msreg, vet; for (i = 0; i < TCC_LEVELS; i++) { if (level >= tcc[i].level) @@ -108,9 +108,12 @@ p4tcc_setperf(int level) if (tcc[i].reg != 0) /* enable it */ msreg |= tcc[i].reg << 1 | 1 << 4; wrmsr(MSR_THERM_CONTROL, msreg); + vet = rdmsr(MSR_THERM_CONTROL); + vet &= ~0x1e; - if (update_cpuspeed != NULL) - update_cpuspeed(); - + if (vet != msreg) { + printf("p4_tcc: cpu did not honor request\n"); + return (EIO); + } return (0); } |