aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Neuling <mikey@neuling.org>2013-01-24 10:02:58 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-01-28 19:35:07 -0500
commit05d694ea0daa2e442191a2128aaec78635823f08 (patch)
tree4df2a2ce2ebb3ac79decb66b15e50305bbc0318a /arch
parentf53d168c025f27d64417a56bf129dbb39d2e1189 (diff)
powerpc: Add length setting to set_dawr
Currently we set the length field in the DAWR to 0 which defaults it to one double word (64bits) which is the same as the DABR. Change this so that we can set it to longer values as supported by the DAWR. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/process.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 99550d3615c4..96e31de89b43 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -409,7 +409,7 @@ static inline int set_dabr(struct arch_hw_breakpoint *brk)
409 409
410static inline int set_dawr(struct arch_hw_breakpoint *brk) 410static inline int set_dawr(struct arch_hw_breakpoint *brk)
411{ 411{
412 unsigned long dawr, dawrx; 412 unsigned long dawr, dawrx, mrd;
413 413
414 dawr = brk->address; 414 dawr = brk->address;
415 415
@@ -419,6 +419,14 @@ static inline int set_dawr(struct arch_hw_breakpoint *brk)
419 << (63 - 59); //* translate */ 419 << (63 - 59); //* translate */
420 dawrx |= (brk->type & (HW_BRK_TYPE_PRIV_ALL)) \ 420 dawrx |= (brk->type & (HW_BRK_TYPE_PRIV_ALL)) \
421 >> 3; //* PRIM bits */ 421 >> 3; //* PRIM bits */
422 /* dawr length is stored in field MDR bits 48:53. Matches range in
423 doublewords (64 bits) baised by -1 eg. 0b000000=1DW and
424 0b111111=64DW.
425 brk->len is in bytes.
426 This aligns up to double word size, shifts and does the bias.
427 */
428 mrd = ((brk->len + 7) >> 3) - 1;
429 dawrx |= (mrd & 0x3f) << (63 - 53);
422 430
423 if (ppc_md.set_dawr) 431 if (ppc_md.set_dawr)
424 return ppc_md.set_dawr(dawr, dawrx); 432 return ppc_md.set_dawr(dawr, dawrx);