[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1274787559_8162@mail4.comsite.net>
Date: Tue, 25 May 2010 06:39:19 -0500
From: Millton Miller <miltonm@....com>
To: "K.Prasad" <prasad@...ux.vnet.ibm.com>
Cc: Michael Neuling <mikey@...ling.org>,
Benjamin Herrenschmidt <benh@....ibm.com>,
shaggy@...ux.vnet.ibm.com,
Frederic Weisbecker <fweisbec@...il.com>,
David Gibson <dwg@....ibm.com>,
Alan Stern <stern@...land.harvard.edu>,
"K.Prasad" <prasad@...ux.vnet.ibm.com>,
Roland McGrath <roland@...hat.com>,
"linuxppc-dev@...abs.org" <linuxppc-dev@...abs.org>,
Paul Mackerras <paulus@...ba.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [Patch 1/4] Allow arch-specific cleanup before breakpoint
unregistration
On Tue, 25 May 2010 at 14:43:56 +0530, K.Prasad wrote:
> Certain architectures (such as PowerPC Book III S) have a need to cleanup
> data-structures before the breakpoint is unregistered. This patch introduces
> an arch-specific hook in release_bp_slot() along with a weak definition in
> the form of a stub funciton.
>
> Signed-off-by: K.Prasad <prasad@...ux.vnet.ibm.com>
> ---
> kernel/hw_breakpoint.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
My understanding is weak function definitions must appear in a different C
file than their call sites to work on some toolchains.
Andrew, can you confirm the above statement?
> Index: linux-2.6.ppc64_test/kernel/hw_breakpoint.c
> ===================================================================
> --- linux-2.6.ppc64_test.orig/kernel/hw_breakpoint.c
> +++ linux-2.6.ppc64_test/kernel/hw_breakpoint.c
> @@ -242,6 +242,17 @@ toggle_bp_slot(struct perf_event *bp, bo
> }
>
> /*
> + * Function to perform processor-specific cleanup during unregistration
> + */
> +__weak void arch_unregister_hw_breakpoint(struct perf_event *bp)
> +{
> + /*
> + * A weak stub function here for those archs that don't define
> + * it inside arch/.../kernel/hw_breakpoint.c
> + */
> +}
> +
> +/*
> * Contraints to check before allowing this new breakpoint counter:
> *
> * == Non-pinned counter == (Considered as pinned for now)
> @@ -339,6 +350,7 @@ void release_bp_slot(struct perf_event *
> {
> mutex_lock(&nr_bp_mutex);
>
> + arch_unregister_hw_breakpoint(bp);
> __release_bp_slot(bp);
>
> mutex_unlock(&nr_bp_mutex);
>
Since the weak version is empty, should it just be delcared (in
a header, put the comment there) and not defined?
milton
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists