aboutsummaryrefslogtreecommitdiff
path: root/arch/ppc64/kernel/pmc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-08-29 17:11:29 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-29 17:11:29 -0700
commit40193713df2cdb9c233b3fc2029ecdccb40cb1e4 (patch)
treedb2ce73665b250672f5f5c0cf7544ec370c122f9 /arch/ppc64/kernel/pmc.c
parent8f3d17fb7bcb7c255197d11469fb5e9695c9d2f4 (diff)
parentc594adad5653491813959277fb87a2fef54c4e05 (diff)
Merge HEAD from master.kernel.org:/pub/scm/linux/kernel/git/paulus/ppc64-2.6
Diffstat (limited to 'arch/ppc64/kernel/pmc.c')
-rw-r--r--arch/ppc64/kernel/pmc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/pmc.c b/arch/ppc64/kernel/pmc.c
index 67be773f9c0..cdfec7438d0 100644
--- a/arch/ppc64/kernel/pmc.c
+++ b/arch/ppc64/kernel/pmc.c
@@ -65,3 +65,24 @@ void release_pmc_hardware(void)
spin_unlock(&pmc_owner_lock);
}
EXPORT_SYMBOL_GPL(release_pmc_hardware);
+
+void power4_enable_pmcs(void)
+{
+ unsigned long hid0;
+
+ hid0 = mfspr(HID0);
+ hid0 |= 1UL << (63 - 20);
+
+ /* POWER4 requires the following sequence */
+ asm volatile(
+ "sync\n"
+ "mtspr %1, %0\n"
+ "mfspr %0, %1\n"
+ "mfspr %0, %1\n"
+ "mfspr %0, %1\n"
+ "mfspr %0, %1\n"
+ "mfspr %0, %1\n"
+ "mfspr %0, %1\n"
+ "isync" : "=&r" (hid0) : "i" (HID0), "0" (hid0):
+ "memory");
+}