Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11442
b: refs/heads/master
c: 82cd02c
h: refs/heads/master
v: v3
  • Loading branch information
Stephen Rothwell authored and Paul Mackerras committed Sep 21, 2005
1 parent 6a04346 commit 63b3126
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 21 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: 86a5cddbd9676b129cfa2ed7a1a11759d3b2b512
refs/heads/master: 82cd02c16be99cba6a97d38488aee8807580a202
13 changes: 0 additions & 13 deletions trunk/arch/powerpc/oprofile/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,12 @@ static void op_handle_interrupt(struct pt_regs *regs)

static int op_powerpc_setup(void)
{
#ifdef __powerpc64__
int err;

/* Grab the hardware */
err = reserve_pmc_hardware(op_handle_interrupt);
if (err)
return err;
#else /* __powerpc64__ */
/* Install our interrupt handler into the existing hook. */
if (request_perfmon_irq(&op_handle_interrupt))
return -EBUSY;
mb();
#endif /* __powerpc64__ */

/* Pre-compute the values to stuff in the hardware registers. */
model->reg_setup(ctr, &sys, model->num_counters);
Expand All @@ -78,13 +71,7 @@ static int op_powerpc_setup(void)

static void op_powerpc_shutdown(void)
{
#ifdef __powerpc64__
release_pmc_hardware();
#else /* __powerpc64__ */
mb();
/* Remove our interrupt handler. We may be removing this module. */
free_perfmon_irq();
#endif /* __powerpc64__ */
}

static void op_powerpc_cpu_start(void *dummy)
Expand Down
10 changes: 5 additions & 5 deletions trunk/arch/ppc/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void (*perf_irq)(struct pt_regs *) = dummy_perf;

/* Grab the interrupt, if it's free.
* Returns 0 on success, -1 if the interrupt is taken already */
int request_perfmon_irq(void (*handler)(struct pt_regs *))
int reserve_pmc_hardware(void (*handler)(struct pt_regs *))
{
int err = 0;

Expand All @@ -71,15 +71,15 @@ int request_perfmon_irq(void (*handler)(struct pt_regs *))
perf_irq = handler;
else {
pr_info("perfmon irq already handled by %p\n", perf_irq);
err = -1;
err = -EBUSY;
}

spin_unlock(&perfmon_lock);

return err;
}

void free_perfmon_irq(void)
void release_pmc_hardware(void)
{
spin_lock(&perfmon_lock);

Expand All @@ -89,5 +89,5 @@ void free_perfmon_irq(void)
}

EXPORT_SYMBOL(perf_irq);
EXPORT_SYMBOL(request_perfmon_irq);
EXPORT_SYMBOL(free_perfmon_irq);
EXPORT_SYMBOL(reserve_pmc_hardware);
EXPORT_SYMBOL(release_pmc_hardware);
4 changes: 2 additions & 2 deletions trunk/include/asm-ppc/perfmon.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

extern void (*perf_irq)(struct pt_regs *);

int request_perfmon_irq(void (*handler)(struct pt_regs *));
void free_perfmon_irq(void);
int reserve_pmc_hardware(void (*handler)(struct pt_regs *));
void release_pmc_hardware(void);

#ifdef CONFIG_FSL_BOOKE
void init_pmc_stop(int ctr);
Expand Down

0 comments on commit 63b3126

Please sign in to comment.