From 1d0cf0df37a4e831ca3121ba8987d5848cad3e42 Mon Sep 17 00:00:00 2001 From: Austin Morton Date: Sat, 21 Feb 2015 04:20:33 -0500 Subject: server: tcl_notifications command Implements async target notifications to the tcl server Change-Id: I4d83e9fa209e95426c440030597f99e9f0c3b260 Signed-off-by: Austin Morton Reviewed-on: http://openocd.zylin.com/2336 Reviewed-by: Paul Fertser Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/target/target.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/target/target.h') 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 + 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 -- cgit v1.1