Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11607
b: refs/heads/master
c: f7f6f4f
h: refs/heads/master
i:
  11605: f7ed520
  11603: d3185e2
  11599: da1f59e
v: v3
  • Loading branch information
David Gibson authored and Paul Mackerras committed Oct 20, 2005
1 parent a979c01 commit 99c532d
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 136 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3d904eef54fd145e2ae5fadb52d2c39bc49339ae
refs/heads/master: f7f6f4fea68d9981d65f99a589ad85f510924d99
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CFLAGS_btext.o += -fPIC
endif

obj-y := semaphore.o cputable.o ptrace.o syscalls.o \
signal_32.o
signal_32.o pmc.o
obj-$(CONFIG_PPC64) += binfmt_elf32.o sys_ppc32.o ptrace32.o
obj-$(CONFIG_ALTIVEC) += vecemu.o vector.o
obj-$(CONFIG_POWER4) += idle_power4.o
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
/*
* linux/arch/ppc64/kernel/pmc.c
* arch/powerpc/kernel/pmc.c
*
* Copyright (C) 2004 David Gibson, IBM Corporation.
* Includes code formerly from arch/ppc/kernel/perfmon.c:
* Author: Andy Fleming
* Copyright (c) 2004 Freescale Semiconductor, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
Expand All @@ -17,6 +20,20 @@
#include <asm/processor.h>
#include <asm/pmc.h>

#if defined(CONFIG_FSL_BOOKE) && !defined(CONFIG_E200)
static void dummy_perf(struct pt_regs *regs)
{
unsigned int pmgc0 = mfpmr(PMRN_PMGC0);

pmgc0 &= ~PMGC0_PMIE;
mtpmr(PMRN_PMGC0, pmgc0);
}
#elif defined(CONFIG_PPC64) || defined(CONFIG_6xx)

#ifndef MMCR0_PMAO
#define MMCR0_PMAO 0
#endif

/* Ensure exceptions are disabled */
static void dummy_perf(struct pt_regs *regs)
{
Expand All @@ -25,6 +42,11 @@ static void dummy_perf(struct pt_regs *regs)
mmcr0 &= ~(MMCR0_PMXE|MMCR0_PMAO);
mtspr(SPRN_MMCR0, mmcr0);
}
#else
static void dummy_perf(struct pt_regs *regs)
{
}
#endif

static DEFINE_SPINLOCK(pmc_owner_lock);
static void *pmc_owner_caller; /* mostly for debugging */
Expand Down Expand Up @@ -66,6 +88,7 @@ void release_pmc_hardware(void)
}
EXPORT_SYMBOL_GPL(release_pmc_hardware);

#ifdef CONFIG_PPC64
void power4_enable_pmcs(void)
{
unsigned long hid0;
Expand All @@ -86,3 +109,4 @@ void power4_enable_pmcs(void)
"isync" : "=&r" (hid0) : "i" (SPRN_HID0), "0" (hid0):
"memory");
}
#endif /* CONFIG_PPC64 */
3 changes: 1 addition & 2 deletions trunk/arch/powerpc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@
#include <asm/machdep.h>
#include <asm/rtas.h>
#include <asm/xmon.h>
#include <asm/pmc.h>
#ifdef CONFIG_PPC32
#include <asm/reg.h>
#include <asm/perfmon.h>
#endif
#ifdef CONFIG_PMAC_BACKLIGHT
#include <asm/backlight.h>
Expand All @@ -51,7 +51,6 @@
#include <asm/firmware.h>
#include <asm/processor.h>
#include <asm/systemcfg.h>
#include <asm/pmc.h>
#endif

#ifdef CONFIG_PPC64 /* XXX */
Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/powerpc/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
#include <linux/errno.h>
#include <asm/ptrace.h>
#include <asm/system.h>
#ifdef __powerpc64__
#include <asm/pmc.h>
#else /* __powerpc64__ */
#include <asm/perfmon.h>
#endif /* __powerpc64__ */
#include <asm/cputable.h>
#include <asm/oprofile_impl.h>

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/oprofile/op_model_fsl_booke.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <asm/cputable.h>
#include <asm/reg_booke.h>
#include <asm/page.h>
#include <asm/perfmon.h>
#include <asm/pmc.h>
#include <asm/oprofile_impl.h>

static unsigned long reset_value[OP_MAX_COUNTER];
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/ppc/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extra-y += vmlinux.lds
obj-y := entry.o traps.o irq.o idle.o time.o misc.o \
process.o align.o \
setup.o \
ppc_htab.o perfmon.o
ppc_htab.o
obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
obj-$(CONFIG_POWER4) += cpu_setup_power4.o
Expand All @@ -38,7 +38,7 @@ endif

else
obj-y := irq.o idle.o \
align.o perfmon.o
align.o
obj-$(CONFIG_6xx) += l2cr.o cpu_setup_6xx.o
obj-$(CONFIG_SOFTWARE_SUSPEND) += swsusp.o
obj-$(CONFIG_MODULES) += module.o
Expand Down
96 changes: 0 additions & 96 deletions trunk/arch/ppc/kernel/perfmon.c

This file was deleted.

2 changes: 1 addition & 1 deletion trunk/arch/ppc/kernel/perfmon_fsl_booke.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <asm/io.h>
#include <asm/reg.h>
#include <asm/xmon.h>
#include <asm/perfmon.h>
#include <asm/pmc.h>

static inline u32 get_pmlca(int ctr);
static inline void set_pmlca(int ctr, u32 pmlca);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ppc/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#ifdef CONFIG_PMAC_BACKLIGHT
#include <asm/backlight.h>
#endif
#include <asm/perfmon.h>
#include <asm/pmc.h>

#ifdef CONFIG_XMON
extern int xmon_bpt(struct pt_regs *regs);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ppc64/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ obj-y += irq.o idle.o dma.o \
udbg.o ioctl32.o \
rtc.o \
cpu_setup_power4.o \
iommu.o sysfs.o vdso.o pmc.o firmware.o
iommu.o sysfs.o vdso.o firmware.o
obj-y += vdso32/ vdso64/

pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o
Expand Down
21 changes: 18 additions & 3 deletions trunk/include/asm-ppc64/pmc.h → trunk/include/asm-powerpc/pmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _PPC64_PMC_H
#define _PPC64_PMC_H
#ifndef _POWERPC_PMC_H
#define _POWERPC_PMC_H

#include <asm/ptrace.h>

Expand All @@ -26,6 +26,21 @@ typedef void (*perf_irq_t)(struct pt_regs *);
int reserve_pmc_hardware(perf_irq_t new_perf_irq);
void release_pmc_hardware(void);

#ifdef CONFIG_PPC64
void power4_enable_pmcs(void);
#endif

#endif /* _PPC64_PMC_H */
#ifdef CONFIG_FSL_BOOKE
void init_pmc_stop(int ctr);
void set_pmc_event(int ctr, int event);
void set_pmc_user_kernel(int ctr, int user, int kernel);
void set_pmc_marked(int ctr, int mark0, int mark1);
void pmc_start_ctr(int ctr, int enable);
void pmc_start_ctrs(int enable);
void pmc_stop_ctrs(void);
void dump_pmcs(void);

extern struct op_powerpc_model op_model_fsl_booke;
#endif

#endif /* _POWERPC_PMC_H */
22 changes: 0 additions & 22 deletions trunk/include/asm-ppc/perfmon.h

This file was deleted.

0 comments on commit 99c532d

Please sign in to comment.