Commit Graph

66 Commits

Author SHA1 Message Date
David Brownell a0edb8a328 ARM11: basic watchpoint support
Use the DPM watchpoint support; remove old incomplete stubs.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-04 18:57:31 -08:00
David Brownell ea7a49cb9b ARM DPM: share debug reason logic
No point in both ARM11 and Cortex-A8 having private copies
of the logic sorting out e.g. DBG_REASON_WATCHPOINT.

Add and use a shared routine for this ... there's actually
a bunch more debug entry logic that could be shared, this
is just a start on that.  Note that this routine fixes a
bug observed in the ARM11 code, where some abort mode quirks
were displayed as being an unknown debug reason; and also
silences needless ARM11 chatter.

Likewise with private copies of DSCR ... add one to the DPM
struct.  Save it as part of setting DBG_REASON_* so later
patches can switch over to using that copy.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-03 16:08:04 -08:00
David Brownell 6eee0729d7 ARM11: use shared DSCR bit names
For the bits now defined in "arm_dpm.h", switch to the
shared DSCR_* symbol and remove the ARM11_DSCR_* version.

Define DSCR_INT_DIS and use it instead of the ARM11_DSCR_*
sibling symbol.  (Note:  for both ARM11 and Cortex-A8, this
should arguably be enabled by default when single stepping.)

Remove some other unused declarations in "arm11.h".

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-12-03 16:08:04 -08:00
Zachary T Welch ddea033043 change #include "armv4_5.h" to <target/armv4_5.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "armv4_5.h"

the following form should be used.

	#include <target/armv4_5.h>

The exception is from .c files in the same directory.
2009-12-03 04:24:41 -08:00
Zachary T Welch 98eea5680b change #include "arm_dpm.h" to <target/arm_dpm.h>
Changes from the flat namespace to heirarchical one.  Instead of writing:

	#include "arm_dpm.h"

the following form should be used.

	#include <target/arm_dpm.h>

The exception is from .c files in the same directory.
2009-12-03 04:24:40 -08:00
David Brownell d5e4e23f9a ARM11: don't expose DSCR
Remove the remaining extra copy of DSCR, and the register cache
of which it was a part.  That cache wasn't a very safe, or even
necessary, idea; it was essentialy letting debugger-private state
be manipulated by Tcl code that couldn't know how to do it right.

This makes the "reg" output of an ARM11 resemble what most other
ARM cores produce ... forward motion in the "make ARM11 work like
the rest of the ARM cores" Jihad!
2009-12-02 23:08:43 -08:00
David Brownell f0c3e7011f ARM11: store a clean copy of DSCR
Just store a clean copy of DSCR in the per-CPU struct, so we
trivially pass a pointer to a recent copy.  This replaces the
previous "last_dscr" and cleans up most of the related calling
conventions ... but it doesn't remove the other DSCR copy.
2009-12-02 23:08:43 -08:00
David Brownell 62dd15d78f ARM11: don't expose WDTR
Don't expose the WDTR register through the register cache any
more.  If anyone wants Tcl scripts to be able to use DCC based
communication with app code in the target, this wouldn't do it.

Bugfix:  don't trust the Tcl-accessible version of DSCR to
flag whether WDTR needs to be restored when resuming.
2009-12-02 23:08:42 -08:00
David Brownell 7e18d96d03 ARM11: don't expose RDTR
Don't expose the RDTR register through the register cache any
more.  If anyone wants Tcl scripts to be able to use DCC based
communication with app code in the target, this wouldn't do it.

Bugfix:  don't trust the Tcl-accessible version of DSCR to
flag whether RDTR needs to be restored when resuming.
2009-12-02 23:08:42 -08:00
David Brownell 1d29440a9c ARM11: remove arm11->target
Don't need/want arm11->target; we have arm11->arm.target instead.
Also remove some unused watchpoint stuff.
2009-12-02 23:08:42 -08:00
David Brownell 3efc99b34a ARM11: remove old R0..R15/CPSR code
This finishes the basic switchover to the new register code,
for everything except the debug registers.  (And maybe we
shouldn't have a cache for *those* which works this way...)

The context save/restore code now uses the new code, but
it's in a slightly different sequence.  That should be fine
since the R0/PC/CPSR stuff is all that really matters (and
if we can update those, we can update the rest).

Now there's no longer a way any code can be confused about
which copy of "r1" (etc) to use.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-24 01:27:29 -08:00
David Brownell 6ff33a4ee8 ARM11: remove register "history" debug stuff
This was a private mechanism to snapshot registers before leaving
debug state, and then on reentry to optionally display what changed.
It was coupled to the private register cache, which won't be sticking
around in that form for much longer.  Remove (instead of teaching
it how to handle *all* the registers).

(The idea is interesting, but we ought to be able to implement
this in a generic way.  Ideally through Tcl scripts that can
automatically be invoked following debug entry...)

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-24 00:14:15 -08:00
David Brownell caf827ee81 ARM11: implement provider for new DPM interface
This is a very thin layer over some of the current ARM11
debug TAP utilities.  The layer isn't yet hooked up.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-24 00:14:06 -08:00
David Brownell b8b1353dd7 ARM11: remove unused state and exports
For now there's no point in saving this stuff after examine()
checks it out as OK.  Ditto exporting symbols that aren't
used outside of the module which defines them.  In fact, those
two things needlessly complicate the code...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-22 15:51:16 -08:00
David Brownell fa9b0e2167 ARM11: macro cleanup
Make this code look more like the rest of the OpenOCD code.

 - Use calloc() directly, not NEW() ... and fix some potential
   memory leaks while we're at it.

 - Remove FNC_INFO ... it's a NOP that just clutters things,
   and it's trivial for developers to add tracing as needed.

 - Replace FNC_INFO_NOTIMPLEMENTED with LOG_WARNING calls;
   ditto.  And stop having those call sites wrongly succeed!

 - Waste less space with the CHECK_RETVAL() macro.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-22 15:50:24 -08:00
David Brownell fa618cc74d ARM11: remove needless string format #ifdeffery
We don't need to use size_t in these places; so it's easy
to be rid of the need for this #ifdef and its MS-derived
portability problems.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-22 10:27:29 -08:00
David Brownell 60a2d85af1 ARM11: remove disabled register hooks
Minor cleanup of ARM11 register handling:  remove disabled
register hooks.  This should all be handled by shared code,
and this stuff is just clutter.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-22 03:36:24 -08:00
Zachary T Welch dc1685ca25 move ARRAY_SIZE macro to types.h
The ARRAY_SIZE macro was defined in several target files, so move it
to types.h.

This patch also removes two other identical macros: DIM (from jtag.h)
and asizeof (from arm11.h).
2009-11-16 09:58:11 -08:00
David Brownell 2280ddeea5 ARM11: fixup method table
Three changes:  remove ARM11_HANDLER() in favor of normal structure
initialization syntax; fix goofy indentation in that structure; and
don't needlessly export arm11_register_commands(), it's only called
through that method table.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-15 10:35:41 -08:00
David Brownell 817bf74302 ARM11: revert etmr/etmw commands
These aren't desirable, given "standard" ETM support.
Also remove the now-unused arm11_find_target().

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 16:56:11 -08:00
David Brownell a7f5cdf999 ARM11: switch to new "arm" base type
This will enable reusing many common ARM utilities, in
particular the ETM and ETB support.  The ARM11 support
can still be much simplified after this patch, though.

Note:  none of those common utilities kick in yet...

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
2009-11-13 16:22:36 -08:00
Zachary T Welch 98723c4ecd command_context_t -> struct command_context
Remove misleading typedef and redundant suffix from struct command_context.
2009-11-13 13:25:47 -08:00
Zachary T Welch 0f1163e823 target_t -> struct target
Remove misleading typedef and redundant suffix from struct target.
2009-11-13 11:58:14 -08:00
Zachary T Welch d0dee7ccaf reg_t -> struct reg
Remove misleading typedef and redundant suffix from struct reg.
2009-11-13 11:58:13 -08:00
Zachary T Welch 74d09617b9 reg_cache_t -> struct reg_cache
Remove misleading typedef and redundant suffix from struct reg_cache.
2009-11-13 11:58:12 -08:00
Zachary T Welch 3bcd9ad9d0 arm11_reg_state_t -> struct arm11_reg_state
Remove misleading typedef and redundant suffix from struct arm11_reg_state.
2009-11-13 11:58:09 -08:00
Zachary T Welch 55926f576f arm11_common_t -> struct arm11_common
Remove misleading typedef and redundant suffix from struct arm11_common.
2009-11-13 11:58:09 -08:00
Zachary T Welch 52bc6cad87 arm11_register_history_t -> struct arm11_register_history
Remove misleading typedef and redundant suffix from struct arm11_register_history.
2009-11-13 11:58:08 -08:00
Michael Bruck 627bd19768 arm11: add etmr/etmw registers to access ETM via DBGTAP scan chain
First cut of these commands. Øyvind tinkered a bit with
the number parsing to bring it up to speed + rebased it.
Ready for testing.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-10 14:00:24 +01:00
Zachary T Welch da3196bf5e Add private header for ARM11 internals.
Reduces confusion about location of associated routines and
reduces clutter in the arm11 header.

Removes extra whitespace around the lines touched by these changes.
2009-11-08 15:47:04 -08:00
Zachary T Welch e41147bf75 ARM11: remove exports and forward decls
Unneeded exports cause confusion about the module interfaces.
Make almost everything static in the arm11.c module.
2009-11-08 15:47:04 -08:00
Øyvind Harboe af66678c9a target: remove unused interface fn that clutters code
The quit entry point was not being invoked. Just a source
of confusion at this point. XScale ran 100x reset upon
quit, but that code made no sense, wasn't commented
and never invoke.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
2009-11-05 09:07:56 +01:00
Redirect 'Slash' NIL 73349dc5ac More MinGW C99 printf compliance
Passing "--std=gun99" is unfortunately not sufficient to make current
MinGW compilers conform with respect to checking printf format strings.
(The C runtime seems not to have problems.)

Fix by using a "gnu_printf" format specifier not "printf".
2009-10-17 17:47:52 -07:00
Øyvind Harboe 1f917bdc0c Delete commented out code. Add a bit of error checking. 2009-10-13 12:10:23 +02:00
Øyvind Harboe 8f09c5df85 ARM11 error checking 2009-10-09 10:00:05 +02:00
oharboe ed8fd94d7c added arm11 timeout error messages
git-svn-id: svn://svn.berlios.de/openocd/trunk@2647 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-08-28 13:43:26 +00:00
zwelch db7e77237c Transform 'u32' to 'uint32_t' in src/target/arm*
- Replace '\([^_]\)u32' with '\1uint32_t'.
- Replace '^u32' with 'uint32_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2278 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:08:52 +00:00
zwelch 86173cdbdd Transform 'u8' to 'uint8_t' in src/target
- Replace '\([^_]\)u8' with '\1uint8_t'.
- Replace '^u8' with 'uint8_t'.


git-svn-id: svn://svn.berlios.de/openocd/trunk@2274 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-18 07:04:08 +00:00
oharboe 01801e3f45 unbreak arm11. TAP_INVALID is used to communicate inband that a special state should be used to lower level fn's in ARM11 code.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2052 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 20:05:32 +00:00
oharboe f133158175 Introduce jtag_get_end_state() fn to clarify code a bit.
git-svn-id: svn://svn.berlios.de/openocd/trunk@2049 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 13:14:07 +00:00
oharboe 6468859389 remove TAP_INVALID as argument to jtag_add_xxx() fn's
git-svn-id: svn://svn.berlios.de/openocd/trunk@2042 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-06-04 11:33:36 +00:00
oharboe 350f608256 Michael Bruck <mbruck@digenius.de> ARM11 cleanup stale dependencies with generic arm code; added comments and whitespace fixes
git-svn-id: svn://svn.berlios.de/openocd/trunk@1807 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-18 07:02:12 +00:00
zwelch 68b05c5575 Audit and eliminate redundant #include directives in arm target files.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1714 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-11 04:46:21 +00:00
oharboe 0c9a2e99ca Michael Bruck <mbruck@digenius.de> ARM11 C99 updates
git-svn-id: svn://svn.berlios.de/openocd/trunk@1685 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-05-09 07:36:19 +00:00
oharboe 0d327e9e40 comments and debug code
git-svn-id: svn://svn.berlios.de/openocd/trunk@1567 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-29 11:37:33 +00:00
oharboe 9ba80f08f4 Michael Bruck <mbruck@digenius.de> macros for error handling
git-svn-id: svn://svn.berlios.de/openocd/trunk@1551 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-28 07:29:18 +00:00
oharboe bd7d019b56 more error handling
git-svn-id: svn://svn.berlios.de/openocd/trunk@1543 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-27 12:02:07 +00:00
oharboe 4866c8ed25 a little bit more error handling in ARM11
git-svn-id: svn://svn.berlios.de/openocd/trunk@1542 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-27 11:24:01 +00:00
oharboe 2fb843773b Michael Bruck <mbruck@digenius.de> include file fix
git-svn-id: svn://svn.berlios.de/openocd/trunk@1517 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-23 18:55:13 +00:00
oharboe 23de60e6bd Michael Bruck <mbruck@digenius.de> ARM11 various updates + fix formatting.
git-svn-id: svn://svn.berlios.de/openocd/trunk@1512 b42882b7-edfa-0310-969c-e2dbd0fdcd60
2009-04-22 18:39:59 +00:00