diff options
author | Austin Morton <austinpmorton@gmail.com> | 2015-02-21 04:20:33 -0500 |
---|---|---|
committer | Paul Fertser <fercerpav@gmail.com> | 2015-03-09 06:30:30 +0000 |
commit | 1d0cf0df37a4e831ca3121ba8987d5848cad3e42 (patch) | |
tree | f1a83b1fc467323c8d19024e4274c67c35f2ed34 /src/target/target.h | |
parent | c50047bb418da6a4ed735ca87acee04e7fd2dbe7 (diff) | |
download | riscv-openocd-1d0cf0df37a4e831ca3121ba8987d5848cad3e42.zip riscv-openocd-1d0cf0df37a4e831ca3121ba8987d5848cad3e42.tar.gz riscv-openocd-1d0cf0df37a4e831ca3121ba8987d5848cad3e42.tar.bz2 |
server: tcl_notifications command
Implements async target notifications to the tcl server
Change-Id: I4d83e9fa209e95426c440030597f99e9f0c3b260
Signed-off-by: Austin Morton <austinpmorton@gmail.com>
Reviewed-on: http://openocd.zylin.com/2336
Reviewed-by: Paul Fertser <fercerpav@gmail.com>
Tested-by: jenkins
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/target/target.h')
-rw-r--r-- | src/target/target.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/target/target.h b/src/target/target.h index 0552b8f..d46571e 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -33,6 +33,8 @@ #ifndef TARGET_H #define TARGET_H +#include <helper/list.h> + struct reg; struct trace; struct command_context; @@ -282,6 +284,12 @@ struct target_event_callback { struct target_event_callback *next; }; +struct target_reset_callback { + struct list_head list; + void *priv; + int (*callback)(struct target *target, enum target_reset_mode reset_mode, void *priv); +}; + struct target_timer_callback { int (*callback)(void *priv); int time_ms; @@ -303,6 +311,15 @@ int target_unregister_event_callback( enum target_event event, void *priv), void *priv); +int target_register_reset_callback( + int (*callback)(struct target *target, + enum target_reset_mode reset_mode, void *priv), + void *priv); +int target_unregister_reset_callback( + int (*callback)(struct target *target, + enum target_reset_mode reset_mode, void *priv), + void *priv); + /* Poll the status of the target, detect any error conditions and report them. * * Also note that this fn will clear such error conditions, so a subsequent @@ -320,6 +337,7 @@ int target_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution); int target_halt(struct target *target); int target_call_event_callbacks(struct target *target, enum target_event event); +int target_call_reset_callbacks(struct target *target, enum target_reset_mode reset_mode); /** * The period is very approximate, the callback can happen much more often @@ -565,6 +583,12 @@ int target_gdb_fileio_end(struct target *target, int retcode, int fileio_errno, /** Return the *name* of this targets current state */ const char *target_state_name(struct target *target); +/** Return the *name* of a target event enumeration value */ +const char *target_event_name(enum target_event event); + +/** Return the *name* of a target reset reason enumeration value */ +const char *target_reset_mode_name(enum target_reset_mode reset_mode); + /* DANGER!!!!! * * if "area" passed in to target_alloc_working_area() points to a memory |