Commit f994607a authored by Graf Yang's avatar Graf Yang Committed by Bryan Wu
Browse files

Blackfin arch: get oprofile work for user space



Signed-off-by: default avatarGraf Yang <graf.yang@analog.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent 6f985294
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -60,10 +60,6 @@ config GENERIC_CALIBRATE_DELAY
	bool
	default y

config HARDWARE_PM
	def_bool y
	depends on OPROFILE

source "init/Kconfig"

source "kernel/Kconfig.preempt"
@@ -1019,6 +1015,12 @@ config EBIU_FCTLVAL
	hex "Flash Memory Bank Control Register"
	depends on BF54x
	default 6

config HARDWARE_PM
	bool "OProfile use hardware porformance monitor"
	depends on OPROFILE
	default n

endmenu

#############################################################################
+7 −5
Original line number Diff line number Diff line
@@ -152,6 +152,12 @@ ENTRY(_evt_ivhw)
1:
#endif

	# We are going to dump something out, so make sure we print IPEND properly
	p2.l = lo(IPEND);
	p2.h = hi(IPEND);
	r0 = [p2];
	[sp + PT_IPEND] = r0;

#ifdef CONFIG_HARDWARE_PM
	r7 = [sp + PT_SEQSTAT];
	r7 = r7 >>> 0xe;
@@ -161,11 +167,6 @@ ENTRY(_evt_ivhw)
	cc = r7 == r5;
	if cc jump .Lcall_do_ovf; /* deal with performance counter overflow */
#endif
	# We are going to dump something out, so make sure we print IPEND properly
	p2.l = lo(IPEND);
	p2.h = hi(IPEND);
	r0 = [p2];
	[sp + PT_IPEND] = r0;

	/* set the EXCAUSE to HWERR for trap_c */
	r0 = [sp + PT_SEQSTAT];
@@ -196,6 +197,7 @@ ENTRY(_evt_ivhw)
#ifdef CONFIG_HARDWARE_PM
.Lcall_do_ovf:

	R0 = SP;
	SP += -12;
	call _pm_overflow;
	SP += 12;
+2 −2
Original line number Diff line number Diff line
@@ -139,8 +139,8 @@ asmlinkage void irq_panic(int reason, struct pt_regs *regs)
/*
 * call the handler of Performance overflow
 */
asmlinkage void pm_overflow(int irq, struct pt_regs *regs)
asmlinkage void pm_overflow(struct pt_regs *regs)
{
	pm_overflow_handler(irq, regs);
	pm_overflow_handler(regs);
}
#endif
+3 −11
Original line number Diff line number Diff line
@@ -126,20 +126,12 @@ static int op_bfin_create_files(struct super_block *sb, struct dentry *root)
int __init oprofile_arch_init(struct oprofile_operations *ops)
{
#ifdef CONFIG_HARDWARE_PM
	unsigned int dspid;

	mutex_init(&pfmon_lock);

	dspid = bfin_dspid();

	printk(KERN_INFO "Oprofile got the cpu id is 0x%x. \n", dspid);

	switch (dspid) {
	case BFIN_533_ID:
		model = &op_model_bfin533;
		model->num_counters = 2;
		break;
	case BFIN_537_ID:
	switch (bfin_read_CHIPID() & CHIPID_MANUFACTURE) {
	case 0xca:
		printk(KERN_INFO "Oprofile: cpu vendor is Analog Devices.\n");
		model = &op_model_bfin533;
		model->num_counters = 2;
		break;
+1 −1
Original line number Diff line number Diff line
@@ -93,6 +93,6 @@ static inline void count_write(unsigned int *count)
	CSYNC();
}

extern int pm_overflow_handler(int irq, struct pt_regs *regs);
extern int pm_overflow_handler(struct pt_regs *regs);

#endif
Loading