From 03fdd23e9cd72c4793fc9107da8b0a08a5793a4f Mon Sep 17 00:00:00 2001 From: Gareth McMullin Date: Sun, 24 Jun 2012 21:37:10 +1200 Subject: Added mechanism for target driver to add new monitor commands. --- src/include/target.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'src/include/target.h') diff --git a/src/include/target.h b/src/include/target.h index 5f3a5ab..dc602aa 100644 --- a/src/include/target.h +++ b/src/include/target.h @@ -27,9 +27,6 @@ typedef struct target_s target; -target *target_new(unsigned size); -void target_list_free(void); - /* Halt/resume functions */ #define target_attach(target) \ (target)->attach(target) @@ -164,13 +161,25 @@ struct target_s { const uint8_t *src, int len); const char *driver; + struct target_command_s *commands; int size; struct target_s *next; + +}; + +struct target_command_s { + const char *specific_name; + const struct command_s *cmds; + struct target_command_s *next; }; extern target *target_list, *cur_target, *last_target; +target *target_new(unsigned size); +void target_list_free(void); +void target_add_commands(target *t, const struct command_s *cmds, const char *name); + /* Probe for various targets. * Actual functions implemented in their respective drivers. */ -- cgit v1.2.3