aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/pmc.c')
-rw-r--r--arch/powerpc/kernel/pmc.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/arch/powerpc/kernel/pmc.c b/arch/powerpc/kernel/pmc.c
index 3d8f6f44641e..24d7b7c99bb9 100644
--- a/arch/powerpc/kernel/pmc.c
+++ b/arch/powerpc/kernel/pmc.c
@@ -17,40 +17,25 @@
17#include <linux/module.h> 17#include <linux/module.h>
18 18
19#include <asm/processor.h> 19#include <asm/processor.h>
20#include <asm/cputable.h>
20#include <asm/pmc.h> 21#include <asm/pmc.h>
21 22
22#if defined(CONFIG_FSL_BOOKE) && !defined(CONFIG_E200) 23#ifndef MMCR0_PMA0
23static void dummy_perf(struct pt_regs *regs) 24#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 25#endif
35 26
36/* Ensure exceptions are disabled */
37static void dummy_perf(struct pt_regs *regs) 27static void dummy_perf(struct pt_regs *regs)
38{ 28{
39 unsigned int mmcr0 = mfspr(SPRN_MMCR0); 29#if defined(CONFIG_FSL_BOOKE) && !defined(CONFIG_E200)
40 30 mtpmr(PMRN_PMGC0, mfpmr(PMRN_PMGC0) & ~PMGC0_PMIE);
41 mmcr0 &= ~(MMCR0_PMXE|MMCR0_PMAO); 31#elif defined(CONFIG_PPC64) || defined(CONFIG_6xx)
42 mtspr(SPRN_MMCR0, mmcr0); 32 if (cur_cpu_spec->pmc_type == PPC_PMC_IBM)
43} 33 mtspr(SPRN_MMCR0, mfspr(SPRN_MMCR0) & ~(MMCR0_PMXE|MMCR0_PMA0));
44#else 34#else
45/* Ensure exceptions are disabled */ 35 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 36#endif
37}
38
54 39
55static DEFINE_SPINLOCK(pmc_owner_lock); 40static DEFINE_SPINLOCK(pmc_owner_lock);
56static void *pmc_owner_caller; /* mostly for debugging */ 41static void *pmc_owner_caller; /* mostly for debugging */