[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090827055507.GA7756@in.ibm.com>
Date: Thu, 27 Aug 2009 11:25:08 +0530
From: Ananth N Mavinakayanahalli <ananth@...ibm.com>
To: "K.Prasad" <prasad@...ux.vnet.ibm.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...e.hu>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Lai Jiangshan <laijs@...fujitsu.com>,
Steven Rostedt <rostedt@...dmis.org>,
Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
Alan Stern <stern@...land.harvard.edu>
Subject: Re: [Patch 3/3] HW-BKPT: Enable/disable the breakpoints when still
registered
On Thu, Aug 27, 2009 at 01:45:06AM +0530, K.Prasad wrote:
...
> struct hw_breakpoint {
> + /*
> + * Denotes if a breakpoint is currently enabled in physical debug
> + * registers. Not to be set directly by the end-user. Must be
> + * operated through enable_hw_breakpoint() API only.
> + */
> + unsigned int enabled;
bool?
...
> +void enable_hw_breakpoint(struct hw_breakpoint *bp, struct task_struct *tsk,
> + unsigned int enabled)
> +{
> + int i;
> + struct thread_struct *thread = &(tsk->thread);
> +
> + spin_lock_bh(&hw_breakpoint_lock);
> +
> + bp->enabled = enabled;
> + /* Enable/Disable the kernel-space breakpoint */
> + if (!tsk) {
> + if (cpumask_test_cpu(smp_processor_id(), bp->cpumask))
> + arch_update_kernel_hw_breakpoint(NULL);
> + smp_call_function_many(bp->cpumask,
> + arch_update_kernel_hw_breakpoint, NULL, 1);
> + goto out;
> + }
> +
> + /* Enable/disable the user-space breakpoint */
> + for (i = 0; i < hbp_kernel_pos; i++) {
> + if (thread->hbp[i] != bp)
> + continue;
> + arch_update_user_hw_breakpoint(i, tsk);
> + if (tsk == current)
> + arch_install_thread_hw_breakpoint(tsk);
> + break;
> + }
> +out:
> + spin_unlock_bh(&hw_breakpoint_lock);
> +}
> +EXPORT_SYMBOL_GPL(enable_hw_breakpoint);
Not sure if its cleaner to have enable_hw_breakpoint() and
disable_hw_breakpoint() rather than one overloaded call.
Ananth
--
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