diff options
author | Michael Neuling <mikey@neuling.org> | 2013-01-24 15:02:58 +0000 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-01-29 11:35:07 +1100 |
commit | 05d694ea0daa2e442191a2128aaec78635823f08 (patch) | |
tree | 4df2a2ce2ebb3ac79decb66b15e50305bbc0318a /arch/powerpc/kernel/process.c | |
parent | f53d168c025f27d64417a56bf129dbb39d2e1189 (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/powerpc/kernel/process.c')
-rw-r--r-- | arch/powerpc/kernel/process.c | 10 |
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) static inline int set_dawr(struct arch_hw_breakpoint *brk) { - unsigned long dawr, dawrx; + unsigned long dawr, dawrx, mrd; dawr = brk->address; @@ -419,6 +419,14 @@ static inline int set_dawr(struct arch_hw_breakpoint *brk) << (63 - 59); //* translate */ dawrx |= (brk->type & (HW_BRK_TYPE_PRIV_ALL)) \ >> 3; //* PRIM bits */ + /* dawr length is stored in field MDR bits 48:53. Matches range in + doublewords (64 bits) baised by -1 eg. 0b000000=1DW and + 0b111111=64DW. + brk->len is in bytes. + This aligns up to double word size, shifts and does the bias. + */ + mrd = ((brk->len + 7) >> 3) - 1; + dawrx |= (mrd & 0x3f) << (63 - 53); if (ppc_md.set_dawr) return ppc_md.set_dawr(dawr, dawrx); |