hw-breakpoints: Handle breakpoint weight in allocation constraints
authorFrederic Weisbecker <fweisbec@gmail.com>
Mon, 12 Apr 2010 22:32:30 +0000 (00:32 +0200)
committerFrederic Weisbecker <fweisbec@gmail.com>
Sat, 1 May 2010 02:32:12 +0000 (04:32 +0200)
commitf93a20541134fa767e8dc4eb32e956d30b9f6b92
treeda262316510683286dcaf1dbc2e4dddc5ac44ba3
parent0102752e4c9e0655b39734550d4c35327954f7f9
hw-breakpoints: Handle breakpoint weight in allocation constraints

Depending on their nature and on what an arch supports, breakpoints
may consume more than one address register. For example a simple
absolute address match usually only requires one address register.
But an address range match may consume two registers.

Currently our slot allocation constraints, that tend to reflect the
limited arch's resources, always consider that a breakpoint consumes
one slot.

Then provide a way for archs to tell us the weight of a breakpoint
through a new hw_breakpoint_weight() helper. This weight will be
computed against the generic allocation constraints instead of
a constant value.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Cc: K. Prasad <prasad@linux.vnet.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
kernel/hw_breakpoint.c