summaryrefslogtreecommitdiff
path: root/src/target
Commit message (Collapse)AuthorAgeFilesLines
...
* add 'testee' target typeZachary T Welch2009-11-253-1/+52
| | | | | | | Alliteration aside, this should provide the final piece of the puzzle for developers that want to get started writing a new target type. In this way, it also seeks to complement the 'dummy' interface driver and 'faux' NOR flash driver.
* add jim_handler to command_registrationZachary T Welch2009-11-241-23/+45
| | | | | | Adding jim_handler field to command_registration allows removing the register_jim helper. All command registrations now go through the register_command{,s}() functions.
* remove register_commands from etm_capture_driverZachary T Welch2009-11-245-31/+17
| | | | | | Converts callback to an array of command_registration records. Moves oocd_trace driver definition to end of file to eliminate useless forward declaration.
* remove target_type register_command callbackZachary T Welch2009-11-2431-149/+89
| | | | | | Uses chaining of command_registration structures to eliminate all target_type register_callback routines. Exports the command_handler registration arrays for those target types that are used by others.
* xscale: use register_commands()Zachary T Welch2009-11-241-23/+107
|
* trace: use register_commands()Zachary T Welch2009-11-241-10/+29
|
* target_request: use register_commands()Zachary T Welch2009-11-241-8/+21
|
* target: use register_commands()Zachary T Welch2009-11-241-104/+201
|
* oocd_trace: use register_commands()Zachary T Welch2009-11-241-10/+32
|
* etm_dummy: use register_commands()Zachary T Welch2009-11-241-7/+20
|
* etm: use register_commands()Zachary T Welch2009-11-241-37/+89
|
* etb: use register_commands()Zachary T Welch2009-11-241-8/+20
|
* cortex_m3: use register_commands()Zachary T Welch2009-11-241-19/+36
|
* cortex_a8: use register_commands()Zachary T Welch2009-11-241-17/+25
|
* armv7m: use register_commands()Zachary T Welch2009-11-241-28/+48
|
* armv7a: use register_commands()Zachary T Welch2009-11-241-27/+48
|
* armv4_5: use register_commands()Zachary T Welch2009-11-241-18/+34
|
* arm9tdmi: use register_commands()Zachary T Welch2009-11-241-12/+21
|
* arm966e: use register_commands()Zachary T Welch2009-11-241-12/+23
|
* arm926ejs: use register_commands()Zachary T Welch2009-11-241-14/+22
|
* arm920t: use register_commands()Zachary T Welch2009-11-241-27/+47
|
* arm7_9_common: use register_commands()Zachary T Welch2009-11-241-20/+37
|
* arm720t: use register_commands()Zachary T Welch2009-11-241-15/+23
|
* arm11: use register_commands()Zachary T Welch2009-11-241-35/+62
|
* use COMMAND_REGISTER macroZachary T Welch2009-11-2420-114/+114
| | | | | Replaces direct calls to register_command() with a macro, to allow its parameters to be changed and callers updated in phases.
* improve startup tcl scriptsZachary T Welch2009-11-241-15/+3
| | | | | Fix a couple of layering violations missed in the last round. Add missing comment headers.
* Cortex-A8: avoid DSCR readsDavid Brownell2009-11-241-48/+103
| | | | | | | | | | | | | | | | | There was a lot of needless handshaking overhead in the current Cortex-A8 DCC/ITR operations, since the status read by each step was discarded rather than letting the next step know it. This shrinks the handshaking by: (a) passing status along from previous steps, avoiding re-fetching; which enables the big win (b) relying on a useful invariant: that the DSCR_INSTR_COMP bit is set after every call to a DPM method. A "reg sp_usr" call previously took 17 flushes; now it takes just 9. This visibly speeds common operations like entry to debug state and stepping, as well as "arm reg" and so on. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-A8: hook up DPMDavid Brownell2009-11-241-323/+35
| | | | | | | | | This replaces two versions of register access functions. One was commented out, and seemed to have uncertain intent. The other was fairly new, and helped motivate the DPM framework once I observed that the ARM11 was doing the very same ops. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-A8: implement DPMDavid Brownell2009-11-244-9/+176
| | | | | | | | This implements the DPM interface for Cortex-A8 cores. It also adds a synchronization operation to the DPM framework, which is needed by the Cortex-A8 after CPSR writes. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* Cortex-A8: minor cleanupDavid Brownell2009-11-242-26/+35
| | | | | | | | Make various functions static, add some comments, report vector catch as a flavor of DBG_REASON_BREAKPOINT, get rid of needless/undesirable ARMV4_5_CORE_REG_MODE, etc. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM11: remove old R0..R15/CPSR codeDavid Brownell2009-11-242-196/+74
| | | | | | | | | | | | | | | | 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>
* ARM11: use standard run_algorithm()David Brownell2009-11-241-172/+5
| | | | | | | | | | | | | | | | | | | | As with single stepping, the previous stuff was needed because the ARM11 code wasn't using the standard ARM base type and register access ... but now those mechanisms work, so we can switch out that special-purpose glue, in favor of the more thoroughly tested/capable "standard" code. Fixes a bug in the resume() implementation: it wasn't handling two of its arguments correctly, preventing the "flash erase_check" algorithm from working. (This code needs a *subsequent* update for correct register handling, though... removing the confusion about which "r2", for example, to use.) This should resolve some "FIXME" comments too, for Thumb and processor mode support. It also gets rid of a nasty exit() call; servers should only have *clean* shutdown paths. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM11: use standard single step simulationDavid Brownell2009-11-241-97/+31
| | | | | | | | | | | | | | | | | | The previous stuff was needed because the ARM11 code wasn't using the standard ARM base type and register access ... but now those mechanisms work, so we can switch out that special-purpose glue. This should resolve all the "FIXME -- handle Thumb single stepping" comments too, and properly handle the processor's mode. (Modulo the issue that this code doesn't yet handle two-byte breakpoints.) Clarify the comments about the the hardware single stepping. When we eventually share breakpoint code with Cortex-A8, we can just make that be the default on cores which support it. We may still want an override command, not just to facilitate testing but to cope with "instruction address mismatch" not quite being true single-step. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM11: partial support for standard ARM register interfaces.David Brownell2009-11-241-35/+31
| | | | | | | | | | | | | | | | | | | | | | | | | This provides "standard" ARM register support -- with twenty or more shadow registers on top of what this code now handles, but properly associated with the various core modes -- parallel to the current register code. That is, the current code is stilil managing the "current" registers; the new code shadows them. You can see all the registers with "arm reg", modify the shadows like "r8_fiq" or "sp_abt" with "reg", and see them get properly written back when you step. (Just don't do that with any of the registers managed by the "old" code ...) It also switches to using more standard code, relying on those standard registers, in two places: (a) the poll status display, which now shows core state (ARM/Thumb/...) and mode (Supervisor, IRQ, etc); and (b) GDB register access. So it's not a full migration, there are warts -- every place that touches the old register cache is a potential bug -- but it's a small more-or-less-comprehensible step that's even somewhat useful. Later patches complete the migration. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM11: remove register "history" debug stuffDavid Brownell2009-11-242-59/+0
| | | | | | | | | | | | | | 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>
* ARM11: implement provider for new DPM interfaceDavid Brownell2009-11-243-0/+80
| | | | | | | 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>
* ARM: new DPM interfaceDavid Brownell2009-11-245-0/+625
| | | | | | | | | | | | | | | | | | | First version of interface for sharing code between ARMv6 and ARMv7a debug modules ... now the architecture includes debug support. (Not the same as for the trimmed-down v7m or v6m though!) This is a first version of an interface that will let the ARM11 and Cortex-A8 support share code, features, and bugfixes. Based on existing code from both of those cores. The ARM v7-AR architecture specification calls this commonality the "Debug Programmer's Model (DPM)", which seemed to be an appropriate acronym -- a TLA even! -- for use in our code. Made it so. :) The initial scope of this just supports register access, and is geared towards supporting top level "struct arm" mechanisms. Later, things like breakpoint and watchpoint support should be included. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* target: cope with *any* error setting a breakpointDavid Brownell2009-11-241-26/+24
| | | | | | It's wrong to map unrecognized failure codes to success. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* mips: fix gaffe when removing dynamic array allocationJerry Ling2009-11-241-3/+3
| | | | | | Classic sizeof() gaffe. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm926ejs: retire cp15 commands, handled by mrc/mcr.Øyvind Harboe2009-11-231-66/+0
| | | | Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARM11: remove unused state and exportsDavid Brownell2009-11-224-32/+25
| | | | | | | | | 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>
* ARM11: macro cleanupDavid Brownell2009-11-222-72/+39
| | | | | | | | | | | | | | | | | 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>
* mips: remove dynamic arrays - reduces stack usageØyvind Harboe2009-11-221-5/+15
| | | | | | Allocate working memory dynamically. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* mips: use const for code sequencesØyvind Harboe2009-11-222-13/+13
| | | | | | | | This will allow data to be allocated in read only memory instead of on the stack. Speeds things up and reduces stack usage. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm11: do not use dynamic arraysØyvind Harboe2009-11-221-3/+6
| | | | | | Allocate working memory dynamically, caught by checkstack.pl Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* arm926ejs: fix warningsØyvind Harboe2009-11-221-2/+2
| | | | | | | | buf_set_u32() operated on an uninitialized stack variable with non-byte boundaries, which led to warnings about reading uninitialized stack. Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
* ARM: use arm_reg_current()David Brownell2009-11-223-61/+74
| | | | | | | | | | Start using the arm_reg_current() call. This shrinks and speeds the affected code. It can also prevent some coredumps coming from invalid CPSR values ... the ARMV4_5_CORE_REG_MODE() macro returns bogus registers if e.g. "Secure Monitor" mode isn't supported by the current CPU. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM11: remove needless string format #ifdefferyDavid Brownell2009-11-223-21/+22
| | | | | | | | 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>
* target: make register flags "bool"David Brownell2009-11-221-2/+2
| | | | | | Mostly for clarity, but it also saves code and data space. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
* ARM: remove 'armv4_5_common_s' migration #defineDavid Brownell2009-11-2212-56/+53
| | | | | | Finish migrating from the old symbol to the new one. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>