summaryrefslogtreecommitdiff
path: root/src/target/target.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Transform 'u32' to 'uint32_t' in src/targetzwelch2009-06-181-99/+99
| | | | | | | | - Replace '\([^_]\)u32' with '\1uint32_t'. - Replace '^u32' with 'uint32_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2279 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Transform 'u16' to 'uint16_t'zwelch2009-06-181-6/+6
| | | | | | | | - Replace '\([^_]\)u16' with '\1uint16_t'. - Replace '^u16' with 'uint16_t'. git-svn-id: svn://svn.berlios.de/openocd/trunk@2277 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Transform 'u8' to 'uint8_t' in src/targetzwelch2009-06-181-38/+38
| | | | | | | | - 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
* David Brownell <david-b@pacbell.net>:zwelch2009-06-171-2/+2
| | | | | | | | Fix parsing bugs for "$target_name mww addr data [count]" ... it was always requiring the count, instead of just defaulting it to one. git-svn-id: svn://svn.berlios.de/openocd/trunk@2263 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>:zwelch2009-06-161-1/+17
| | | | | | | | | | | | | | | | | | | | | | | Extend the internal JTAG event handlers to cover enable/disable, and use those events to make sure that targets get "examined" if they were disabled when the scan chain was first set up: - Remove "enum jtag_tap_event", merge with "enum jtag_event", so C code can now listen for TAP enable/disable events. - Report those events so they can trigger callbacks. - During startup, make target_examine() register a handler to catch ENABLE events for any then-disabled targets. This fixes bugs like "can't halt target after enabling its TAP". One class of unresolved bugs: if the target has an ETM hooked up to an ETB, nothing activates the ETB. But starting up the ETM without access to the ETB registers fails... git-svn-id: svn://svn.berlios.de/openocd/trunk@2251 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>:zwelch2009-06-161-13/+21
| | | | | | | | | | | | | | | | | | | | | Fix some polling issues: - Don't background-poll disabled TAPs ... this was just a bug waiting to happen. (And then it happened!) - Don't fail command line polls of disabled taps; that's not any kind of error, it's just that you can't do much. But do show that tap-disabled status. - Spell "continuous" correctly in the variable name. ;) Not resolved by this patch: the need for an interlock whereby other code (like the JTAG layer) can block all other access to the JTAG layer, e.g. while enabling or disabling TAPs. And that interlock needs to be timer-safe... git-svn-id: svn://svn.berlios.de/openocd/trunk@2247 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Factor load_image argument parsing to parse_load_image_command_args:zwelch2009-06-131-69/+44
| | | | | | | | - Make fast_load_image use the helper coverage the standard load_image. - Improve whitespace in the moved lines. git-svn-id: svn://svn.berlios.de/openocd/trunk@2239 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Improve handle_profile_command argument parsing:zwelch2009-06-131-7/+6
| | | | | | | - Use parse_uint to ensure timeout value parses properly. git-svn-id: svn://svn.berlios.de/openocd/trunk@2238 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Improve handle_virt2phys_command argument parsing:zwelch2009-06-131-3/+6
| | | | | | | - Use parse_u32 to ensure virtual address parses properly. git-svn-id: svn://svn.berlios.de/openocd/trunk@2237 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Cleanup and improve handle_wp_command and handle_rwp_command:zwelch2009-06-131-40/+57
| | | | | | | | | - Simplify argument parsing logic using switch statement. - Use parse_u32 to ensure all values parse properly. - Return syntax error when mode argument fails to parse. git-svn-id: svn://svn.berlios.de/openocd/trunk@2236 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Improve and simplify handle_bp_command and handle_rbp_command:zwelch2009-06-131-5/+18
| | | | | | | | - Bug fix: return syntax error if remove called without one argument. - Use parse_u32 to ensure address and length arguments parse properly. git-svn-id: svn://svn.berlios.de/openocd/trunk@2235 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Improve handle_verify_image_command_internal command argument handling:zwelch2009-06-131-1/+5
| | | | | | | - Use parse_u32 to ensure address parses properly. git-svn-id: svn://svn.berlios.de/openocd/trunk@2234 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Improve handle_dump_image_command argument parsing:zwelch2009-06-131-5/+10
| | | | | | | - Use parse_u32 to ensure address and size parse properly. git-svn-id: svn://svn.berlios.de/openocd/trunk@2233 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Improve handle_load_image_command argument parsing:zwelch2009-06-131-3/+13
| | | | | | | - Use parse_u32 to ensure base/min/max addresses parse properly. git-svn-id: svn://svn.berlios.de/openocd/trunk@2232 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Improve handle_mw_command argument handling:zwelch2009-06-131-13/+21
| | | | | | | | | | - Change: All local variable types are now unsigned. - Use parse_u32 to ensure address and value parse properly. - Use parse_uint to ensure count parses properly. - Move variables to location of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2231 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Improve handle_md_command argument handling:zwelch2009-06-131-3/+10
| | | | | | | - Use parse_u32 and parse_uint for address and count, respectively. git-svn-id: svn://svn.berlios.de/openocd/trunk@2230 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Use parse_u32 in handle_resume_command and handle_step_command.zwelch2009-06-131-2/+10
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2229 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Cleanup and improve handle_halt_command:zwelch2009-06-131-11/+8
| | | | | | | | - Make argument check use parse_uint to ensure value parses properly. - Move variable declarations to location of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2228 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Cleanup and fi handle_wait_halt_command:zwelch2009-06-131-8/+10
| | | | | | | | | | - Use unsigned type for delay variable. - Use parse_uint to ensure delay argument parses properly. - Bug fix: Return syntax error if more than one argument is given. - Bug fix: Return syntax error when argument fails to parse. git-svn-id: svn://svn.berlios.de/openocd/trunk@2227 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Use parse_uint in handle_reg_command to ensure reg number parses properly.zwelch2009-06-131-3/+6
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2226 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Use parse_uint in get_target to ensure target id is parsed properly.zwelch2009-06-131-5/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2225 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* fix ordering of arguments to fwrite()oharboe2009-06-111-1/+1
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2197 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Factor handle_bp_command into pieces:zwelch2009-06-111-37/+49
| | | | | | | | | | - Bug fix: return a syntax error if the wrong number of arguments are given. - Add handle_bp_command_list() and handle_bp_command_set(). - Use temporary addr variable to eliminate redundant strtoul() calls. - Place variable declarations at their point of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2196 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Factor target_timer_callbacks_check_time into pieces:zwelch2009-06-111-30/+40
| | | | | | | | | - Add target_timer_callback_periodic_restart and target_call_timer_callback. - Clean up and simplify logic that determines whether to call each callback. - Move variable declarations to location of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2195 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify and clean handle_virt2phys_command:zwelch2009-06-111-18/+15
| | | | | | | | - Add a doxygen block to simplify logic. - Move declarations to point of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2194 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify and fix target handle_rwp_command routine:zwelch2009-06-111-3/+4
| | | | | | | | - Return syntax error unless exactly one argument is passed. - Move variable declaration to point of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2193 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify and fix handle_reset_command:zwelch2009-06-111-3/+5
| | | | | | | | - Return syntax error if more than one argument is given. - Move variables to location of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2192 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify handle_resume_command:zwelch2009-06-111-12/+11
| | | | | | | | | - Eliminate redundant calls to target_resume with addr temp variable. - Place variables at location of first use. - Fix minor whitespace issues. git-svn-id: svn://svn.berlios.de/openocd/trunk@2191 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Simplify and fix handle_step_command:zwelch2009-06-111-6/+9
| | | | | | | | | - Bug fix: return syntax error when more than one argument is given. - Eliminate redundant calls to step callback with addr temp variable. - Place variables at location of first use. git-svn-id: svn://svn.berlios.de/openocd/trunk@2190 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* disable polling continuous polling during resetoharboe2009-06-111-0/+9
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2183 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Move the documentation for the "poll" command up withzwelch2009-06-101-2/+4
| | | | | | | | | | | | | | other server configuration. Explain what it's about; reference the related "$target_name curstate" method. Update "poll" output to report whether background polling is enabled or not. Also fix a small typo; PC's have "complementary" tools. Some have also "complimentary" ones; but not all. git-svn-id: svn://svn.berlios.de/openocd/trunk@2178 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net> Bugfix: $target_name cget/configure ↵oharboe2009-06-081-1/+1
| | | | | | | | -work-area-backup commands should return the "is it backed up?" flag, not the work area size. git-svn-id: svn://svn.berlios.de/openocd/trunk@2108 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>oharboe2009-06-081-7/+26
| | | | | | | | | | | | | | | | - Don't let disabled TAPs be set as the current target - Improve "targets" output: * Remove undesirable "chain position" number; we discourage using them * TAP and Target column updates: + make them long enough for current usage + improve labels, removing guesswork + "TapName" label patches scan_chain output * Highlight the "current" target * Display "tap disabled" as a new pseudo-state * Update docs accordingly git-svn-id: svn://svn.berlios.de/openocd/trunk@2107 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* David Brownell <david-b@pacbell.net>:zwelch2009-06-071-3/+19
| | | | | | | | | | | | | | | Let disabled targets be ignored during normal operation: - In target_examine(), ignore disabled TAPs - Reset handling must not poke at them either: * fail $target_name arp_* operations on disabled TAPs * in startup.tcl, don't even issue the arp_* wait ops ZW: removed superfluous braces from the patch to target.c. git-svn-id: svn://svn.berlios.de/openocd/trunk@2100 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Fix regression in mdw output; identified by Magnus Lundin.zwelch2009-06-071-3/+3
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2098 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* remove unused include file: inttypes.hoharboe2009-06-051-2/+0
| | | | git-svn-id: svn://svn.berlios.de/openocd/trunk@2071 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Eliminate MixedCaps symbol from public JTAG TAP API:zwelch2009-06-051-1/+1
| | | | | | | | - Purely mechanical transformations to the source files. - Rename 'jtag_TapByJimObj' as 'jtag_tap_by_jim_obj.' git-svn-id: svn://svn.berlios.de/openocd/trunk@2066 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* fix warning for a variable that GCC thought might be uninitialized(which it ↵oharboe2009-06-011-1/+1
| | | | | | can't be). git-svn-id: svn://svn.berlios.de/openocd/trunk@1979 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Final step in isolating target_type_s structure:zwelch2009-05-311-2/+1
| | | | | | | | | - Move definition of 'struct target_type_s' into new 'target_type.h' file. - Forward delclaration remains in target.h, with comment pointing to new file. - Replaces #define with #include in source files. git-svn-id: svn://svn.berlios.de/openocd/trunk@1971 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* First step in hiding target_type_s from public interface:zwelch2009-05-311-0/+2
| | | | | | | | - Add DEFINE_TARGET_TYPE_S symbol in files that need it defined. - Forward declare 'struct target_type_s' only, unless that symbol is defined. git-svn-id: svn://svn.berlios.de/openocd/trunk@1969 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_examine_one wrapper:zwelch2009-05-311-1/+6
| | | | | | | - replaces all calls to target->type->examine. git-svn-id: svn://svn.berlios.de/openocd/trunk@1968 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target breakpoint and watchpoint wrapper:zwelch2009-05-311-0/+21
| | | | | | | - replaces all calls to target->type->{add,remove}_{break,watch}point. git-svn-id: svn://svn.berlios.de/openocd/trunk@1967 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_get_name wrapper:zwelch2009-05-311-4/+8
| | | | | | | | - replaces all accesses to target->type->name. - add documentation in target_s to warn not to access field directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1966 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_step wrapper:zwelch2009-05-311-0/+6
| | | | | | | - replaces all calls to target->type->step. git-svn-id: svn://svn.berlios.de/openocd/trunk@1965 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_get_gdb_reg_list wrapper:zwelch2009-05-311-0/+6
| | | | | | | | - replaces all calls to target->type->get_gdb_reg_list. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1964 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_bulk_write_memory wrapper:zwelch2009-05-311-0/+6
| | | | | | | | - replaces all calls to target->type->bulk_write_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1963 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add wrappers for target->type->examined:zwelch2009-05-311-20/+36
| | | | | | | | | | - replace all checks of target->type->examined with target_was_examined(). - replace all setting of target->type->examined with target_set_examined(). - replace clearing of target->type->examined with target_reset_examined(). - add documentation in target_s to warn not to access field directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1962 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_run_algorithm wrapper:zwelch2009-05-311-0/+11
| | | | | | | | - replaces all calls to target->type->run_algorithm. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1961 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_write_memory wrapper:zwelch2009-05-311-11/+18
| | | | | | | | - replaces all calls to target->type->write_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1960 b42882b7-edfa-0310-969c-e2dbd0fdcd60
* Add target_read_memory wrapper:zwelch2009-05-311-12/+18
| | | | | | | | - replaces all calls to target->type->read_memory. - add documentation in target_s to warn not to invoke callback directly. git-svn-id: svn://svn.berlios.de/openocd/trunk@1959 b42882b7-edfa-0310-969c-e2dbd0fdcd60