removed a couple of exit()'s from error handling.
[fw/openocd] / src / target / target.h
index 5d1e5773ce7d961a8613222422a20f68a1943efe..621640a9eca7bc0f9ba04ef609e9a27bfc406bbc 100644 (file)
@@ -162,12 +162,27 @@ typedef struct target_type_s
        int (*checksum_memory)(struct target_s *target, u32 address, u32 count, u32* checksum);
        int (*blank_check_memory)(struct target_s *target, u32 address, u32 count, u32* blank);
        
-       /* target break-/watchpoint control 
-       * rw: 0 = write, 1 = read, 2 = access
-       */
+       /* 
+        * target break-/watchpoint control 
+        * rw: 0 = write, 1 = read, 2 = access
+        * 
+        * Target must be halted while this is invoked as this
+        * will actually set up breakpoints on target.
+        * 
+        * The breakpoint hardware will be set up upon adding the first breakpoint.
+        * 
+        * Upon GDB connection all breakpoints/watchpoints are cleared.
+        */
        int (*add_breakpoint)(struct target_s *target, breakpoint_t *breakpoint);
+       
+       /* remove breakpoint. hw will only be updated if the target is currently halted.
+        * However, this method can be invoked on unresponsive targets.
+        */
        int (*remove_breakpoint)(struct target_s *target, breakpoint_t *breakpoint);
        int (*add_watchpoint)(struct target_s *target, watchpoint_t *watchpoint);
+       /* remove watchpoint. hw will only be updated if the target is currently halted.
+        * However, this method can be invoked on unresponsive targets.
+        */
        int (*remove_watchpoint)(struct target_s *target, watchpoint_t *watchpoint);
 
        /* target algorithm support */
@@ -182,7 +197,7 @@ typedef struct target_type_s
         * 
         * invoked every time after the jtag chain has been validated/examined
         */
-       int (*examine)(struct command_context_s *cmd_ctx, struct target_s *target);
+       int (*examine)(struct target_s *target);
        /* Set up structures for target.
         *  
         * It is illegal to talk to the target at this stage as this fn is invoked
@@ -250,7 +265,7 @@ typedef struct target_timer_callback_s
 extern int target_register_commands(struct command_context_s *cmd_ctx);
 extern int target_register_user_commands(struct command_context_s *cmd_ctx);
 extern int target_init(struct command_context_s *cmd_ctx);
-extern int target_examine(struct command_context_s *cmd_ctx);
+extern int target_examine(void);
 extern int handle_target(void *priv);
 extern int target_process_reset(struct command_context_s *cmd_ctx, enum target_reset_mode reset_mode);
 
@@ -266,11 +281,11 @@ extern int target_call_event_callbacks(target_t *target, enum target_event event
  */
 extern int target_register_timer_callback(int (*callback)(void *priv), int time_ms, int periodic, void *priv);
 extern int target_unregister_timer_callback(int (*callback)(void *priv), void *priv);
-extern int target_call_timer_callbacks();
+extern int target_call_timer_callbacks(void);
 /* invoke this to ensure that e.g. polling timer callbacks happen before
  * a syncrhonous command completes.
  */
-extern int target_call_timer_callbacks_now();
+extern int target_call_timer_callbacks_now(void);
 
 extern target_t* get_current_target(struct command_context_s *cmd_ctx);
 extern int get_num_by_target(target_t *query_target);