aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pmc.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2007-01-28 22:23:54 -0500
committerPaul Mackerras <paulus@samba.org>2007-02-06 22:03:19 -0500
commit1bd2e5ae18a8f93333707d81d3dbd9209a255137 (patch)
tree72feb6bae2a8dea311e2d9f2e412cfbc69a952fb /arch/powerpc/kernel/pmc.c
parentc69b767a2c871bb80cb9e346d6ebce248f711dfb (diff)
[POWERPC] Add PMC type to cputable
Add cputable entries for which type of PMC implementation the processor has. I've only filled in the current 64-bit processors, the unfilled default value will have same behaviour as before so it can be done over time as needed. Also tidy up the dummy_perf implementation a bit, aggregating it into one function with ifdefs instead of several. Signed-off-by: Olof Johansson <olof@lixom.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/pmc.c')
-rw-r--r--arch/powerpc/kernel/pmc.c35
1 files changed, 9 insertions, 26 deletions
diff --git a/arch/powerpc/kernel/pmc.c b/arch/powerpc/kernel/pmc.c
index 3d8f6f44641e..e40f6ddd98a4 100644
--- a/arch/powerpc/kernel/pmc.c
+++ b/arch/powerpc/kernel/pmc.c
@@ -19,38 +19,21 @@
19#include <asm/processor.h> 19#include <asm/processor.h>
20#include <asm/pmc.h> 20#include <asm/pmc.h>
21 21
22#if defined(CONFIG_FSL_BOOKE) && !defined(CONFIG_E200) 22#ifndef MMCR0_PMA0
23static void dummy_perf(struct pt_regs *regs) 23#define MMCR0_PMA0 0
24{
25 unsigned int pmgc0 = mfpmr(PMRN_PMGC0);
26
27 pmgc0 &= ~PMGC0_PMIE;
28 mtpmr(PMRN_PMGC0, pmgc0);
29}
30#elif defined(CONFIG_PPC64) || defined(CONFIG_6xx)
31
32#ifndef MMCR0_PMAO
33#define MMCR0_PMAO 0
34#endif 24#endif
35 25
36/* Ensure exceptions are disabled */
37static void dummy_perf(struct pt_regs *regs) 26static void dummy_perf(struct pt_regs *regs)
38{ 27{
39 unsigned int mmcr0 = mfspr(SPRN_MMCR0); 28#if defined(CONFIG_FSL_BOOKE) && !defined(CONFIG_E200)
40 29 mtpmr(PMRN_PMGC0, mfpmr(PMRN_PMGC0) & ~PMGC0_PMIE);
41 mmcr0 &= ~(MMCR0_PMXE|MMCR0_PMAO); 30#elif defined(CONFIG_PPC64) || defined(CONFIG_6xx)
42 mtspr(SPRN_MMCR0, mmcr0); 31 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~(MMCR0_PMXE|MMCR0_PMA0));
43}
44#else 32#else
45/* Ensure exceptions are disabled */ 33 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~MMCR0_PMXE);
46static void dummy_perf(struct pt_regs *regs)
47{
48 unsigned int mmcr0 = mfspr(SPRN_MMCR0);
49
50 mmcr0 &= ~(MMCR0_PMXE);
51 mtspr(SPRN_MMCR0, mmcr0);
52}
53#endif 34#endif
35}
36
54 37
55static DEFINE_SPINLOCK(pmc_owner_lock); 38static DEFINE_SPINLOCK(pmc_owner_lock);
56static void *pmc_owner_caller; /* mostly for debugging */ 39static void *pmc_owner_caller; /* mostly for debugging */