From: Stephen Rothwell <sfr@canb.auug.org.au>
To: paulus@samba.org
Cc: ppc64-dev <linuxppc64-dev@ozlabs.org>, ppc-dev <linuxppc-dev@ozlabs.org>
Subject: [PATCH 6/6] powerpc: reduce oprofile/common.c differences
Date: Mon, 19 Sep 2005 23:28:21 +1000 [thread overview]
Message-ID: <20050919232821.7709b9f5.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20050919231051.28fcdf30.sfr@canb.auug.org.au>
Rename and slightly modify {request,free}_perfmon_irq in the ppc code.
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
arch/powerpc/oprofile/common.c | 13 -------------
arch/ppc/kernel/perfmon.c | 10 +++++-----
include/asm-ppc/perfmon.h | 4 ++--
3 files changed, 7 insertions(+), 20 deletions(-)
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
b3a2095ea11906c79fd1c43819e9b9c8d4f0ab51
diff --git a/arch/powerpc/oprofile/common.c b/arch/powerpc/oprofile/common.c
--- a/arch/powerpc/oprofile/common.c
+++ b/arch/powerpc/oprofile/common.c
@@ -46,19 +46,12 @@ static void op_handle_interrupt(struct p
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);
@@ -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)
diff --git a/arch/ppc/kernel/perfmon.c b/arch/ppc/kernel/perfmon.c
--- a/arch/ppc/kernel/perfmon.c
+++ b/arch/ppc/kernel/perfmon.c
@@ -61,7 +61,7 @@ void (*perf_irq)(struct pt_regs *) = dum
/* 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;
@@ -71,7 +71,7 @@ int request_perfmon_irq(void (*handler)(
perf_irq = handler;
else {
pr_info("perfmon irq already handled by %p\n", perf_irq);
- err = -1;
+ err = -EBUSY;
}
spin_unlock(&perfmon_lock);
@@ -79,7 +79,7 @@ int request_perfmon_irq(void (*handler)(
return err;
}
-void free_perfmon_irq(void)
+void release_pmc_hardware(void)
{
spin_lock(&perfmon_lock);
@@ -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);
diff --git a/include/asm-ppc/perfmon.h b/include/asm-ppc/perfmon.h
--- a/include/asm-ppc/perfmon.h
+++ b/include/asm-ppc/perfmon.h
@@ -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);
prev parent reply other threads:[~2005-09-19 13:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-19 13:10 [PATCH 0/6] powerpc: merge arch/ppc*/oprofile directories Stephen Rothwell
2005-09-19 13:13 ` [PATCH 1/6] powerpc: Move arch/ppc*/oprofile/Kconfig to arch/powerpc Stephen Rothwell
2005-09-19 13:15 ` [PATCH 2/6] Merge arch/ppc*/oprofile/Makefile into arch/powerpc/oprofile Stephen Rothwell
2005-09-19 13:18 ` [PATCH 3/6] powerpc: rename op_ppc{32, 64}_model to op_powerpc_model Stephen Rothwell
2005-09-19 13:21 ` [PATCH 4/6] powerpc: merge oprofile headers Stephen Rothwell
2005-09-19 13:24 ` [PATCH 5/6] powerpc: merge the rest of arch/ppc*/oprofile Stephen Rothwell
2005-09-19 13:28 ` Stephen Rothwell [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050919232821.7709b9f5.sfr@canb.auug.org.au \
--to=sfr@canb.auug.org.au \
--cc=linuxppc-dev@ozlabs.org \
--cc=linuxppc64-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox