xscale: add support for length arg to wp command
authorMike Dunn <mikedunn@newsguy.com>
Wed, 21 Apr 2010 17:40:51 +0000 (13:40 -0400)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Sat, 24 Apr 2010 14:54:36 +0000 (16:54 +0200)
commit4f1296d1510715b5504f39909dadae79698aa27a
tree47b48eee1ba99799f8e06eb71bb0d85a2999714f
parentc6cd253ae105a9542f051d4af3fda7e9a1c7140b
xscale: add support for length arg to wp command

This patch adds support for the length argument to the xscale implementation of
the wp command.  Per discussion with David, the length argument specifies the
range of addresses over which a memory access should generate a debug exception.
This patch utilizes the "mask" feature of the xscale debug hardware to implement
the correct functionality of the length argument.  Some limitations imposed by
the hardware are:

   - The length must be a power of two, with a minumum of 4.
   - Two data breakpoint registers are available, allowing for two watchpoints.
     However, if the length of a watchpoint is greater than four, both registers
     are used (the second for a mask value), limiting the number of watchpoints
     to one.

This patch also removes a useless call to xscale_get_reg(dbcon) in
xscale_set_watchpoint() (value had already been read from the register cache,
and the same previously read value is then modified and written back).

I have been using and testing this patch for a couple days.

Questions, corrections, criticisms of course gratefully received.
src/target/xscale.c

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)