X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Ftarget%2Ftarget.h;h=2dfe48513dcb9de9dc50861ade6b9f93aad8486e;hb=83655bf49bfa03b0c57c20123984cf09c4c09393;hp=7632c9331a4cdc5a26b6596cff04efedbbe6007e;hpb=3c2eabd20f5182c53f0bfb0c6f2a9f2595434e87;p=openocd.git diff --git a/src/target/target.h b/src/target/target.h index 7632c9331a..2dfe48513d 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -42,7 +42,11 @@ struct command_context_s; * TARGET_RESET = 3: the target is being held in reset (only a temporary state, * not sure how this is used with all the recent changes) * TARGET_DEBUG_RUNNING = 4: the target is running, but it is executing code on - * behalf of the debugger (e.g. algorithm for flashing) */ + * behalf of the debugger (e.g. algorithm for flashing) + * + * also see: target_state_name(); + */ + enum target_state { @@ -87,7 +91,7 @@ extern const Jim_Nvp nvp_target_debug_reason[]; enum target_endianess { - TARGET_ENDIAN_UNKNOWN=0, + TARGET_ENDIAN_UNKNOWN = 0, TARGET_BIG_ENDIAN = 1, TARGET_LITTLE_ENDIAN = 2 }; @@ -131,6 +135,7 @@ typedef struct target_s struct working_area_s *working_areas;/* list of allocated working areas */ enum target_debug_reason debug_reason;/* reason why the target entered debug state */ enum target_endianess endianness; /* target endianess */ + // also see: target_state_name() enum target_state state; /* the current backend-state (running, halted, ...) */ struct reg_cache_s *reg_cache; /* the first register cache of the target (core regs) */ struct breakpoint_s *breakpoints; /* list of breakpoints */ @@ -357,6 +362,9 @@ extern int target_checksum_memory(struct target_s *target, uint32_t address, uin extern int target_blank_check_memory(struct target_s *target, uint32_t address, uint32_t size, uint32_t* blank); extern int target_wait_state(target_t *target, enum target_state state, int ms); +/** Return the *name* of this targets current state */ +const char *target_state_name( target_t *target ); + /* DANGER!!!!! * * if "area" passed in to target_alloc_working_area() points to a memory @@ -396,8 +404,8 @@ int target_write_u8(struct target_s *target, uint32_t address, uint8_t value); /* Issues USER() statements with target state information */ int target_arch_state(struct target_s *target); -void target_handle_event( target_t *t, enum target_event e); -void target_all_handle_event( enum target_event e ); +void target_handle_event(target_t *t, enum target_event e); +void target_all_handle_event(enum target_event e); #define ERROR_TARGET_INVALID (-300) #define ERROR_TARGET_INIT_FAILED (-301) @@ -412,6 +420,6 @@ void target_all_handle_event( enum target_event e ); #define ERROR_TARGET_NOT_EXAMINED (-311) extern const Jim_Nvp nvp_error_target[]; -extern const char *target_strerror_safe( int err ); +extern const char *target_strerror_safe(int err); #endif /* TARGET_H */