svn commit: r199639 - in projects/ppc64/sys: powerpc/cpufreq
powerpc64/conf
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Sat Nov 21 17:01:39 UTC 2009
Author: nwhitehorn
Date: Sat Nov 21 17:01:38 2009
New Revision: 199639
URL: http://svn.freebsd.org/changeset/base/199639
Log:
Make cpufreq work on powerpc64.
Modified:
projects/ppc64/sys/powerpc/cpufreq/pcr.c
projects/ppc64/sys/powerpc64/conf/GENERIC
Modified: projects/ppc64/sys/powerpc/cpufreq/pcr.c
==============================================================================
--- projects/ppc64/sys/powerpc/cpufreq/pcr.c Sat Nov 21 16:45:55 2009 (r199638)
+++ projects/ppc64/sys/powerpc/cpufreq/pcr.c Sat Nov 21 17:01:38 2009 (r199639)
@@ -108,15 +108,20 @@ static void
write_scom(register_t address, uint64_t value)
{
register_t msr;
+ #ifndef __powerpc64__
register_t hi, lo, scratch;
-
- hi = (value >> 32) & 0xffffffff;
- lo = value & 0xffffffff;
+ #endif
msr = mfmsr();
mtmsr(msr & ~PSL_EE); isync();
+ #ifdef __powerpc64__
+ mtspr(SPR_SCOMD, value);
+ #else
+ hi = (value >> 32) & 0xffffffff;
+ lo = value & 0xffffffff;
mtspr64(SPR_SCOMD, hi, lo, scratch);
+ #endif
isync();
mtspr(SPR_SCOMC, address | SCOMC_WRITE);
isync();
Modified: projects/ppc64/sys/powerpc64/conf/GENERIC
==============================================================================
--- projects/ppc64/sys/powerpc64/conf/GENERIC Sat Nov 21 16:45:55 2009 (r199638)
+++ projects/ppc64/sys/powerpc64/conf/GENERIC Sat Nov 21 17:01:38 2009 (r199639)
@@ -81,7 +81,7 @@ options WITNESS_SKIPSPIN #Don't run wit
#options SMP # Symmetric MultiProcessor Kernel
# CPU frequency control
-#device cpufreq
+device cpufreq
# Standard busses
device pci
More information about the svn-src-projects
mailing list