+int target_register_timer_callback(int (*callback)(void *priv),
+ int time_ms, int periodic, void *priv);
+
+int target_call_timer_callbacks(void);
+/**
+ * Invoke this to ensure that e.g. polling timer callbacks happen before
+ * a synchronous command completes.
+ */
+int target_call_timer_callbacks_now(void);
+
+struct target *get_current_target(struct command_context *cmd_ctx);
+struct target *get_target(const char *id);
+
+/**
+ * Get the target type name.
+ *
+ * This routine is a wrapper for the target->type->name field.
+ * Note that this is not an instance-specific name for his target.
+ */
+const char *target_type_name(struct target *target);
+
+/**
+ * Examine the specified @a target, letting it perform any
+ * Initialisation that requires JTAG access.
+ *
+ * This routine is a wrapper for target->type->examine.
+ */
+int target_examine_one(struct target *target);
+
+/** @returns @c true if target_set_examined() has been called. */
+static inline bool target_was_examined(struct target *target)
+{
+ return target->examined;
+}
+
+/** Sets the @c examined flag for the given target. */
+/** Use in target->type->examine() after one-time setup is done. */
+static inline void target_set_examined(struct target *target)
+{
+ target->examined = true;
+}
+
+/**
+ * Add the @a breakpoint for @a target.
+ *
+ * This routine is a wrapper for target->type->add_breakpoint.
+ */
+int target_add_breakpoint(struct target *target,
+ struct breakpoint *breakpoint);
+/**
+ * Add the @a ContextID breakpoint for @a target.
+ *
+ * This routine is a wrapper for target->type->add_context_breakpoint.
+ */
+int target_add_context_breakpoint(struct target *target,
+ struct breakpoint *breakpoint);
+/**
+ * Add the @a ContextID & IVA breakpoint for @a target.
+ *
+ * This routine is a wrapper for target->type->add_hybrid_breakpoint.
+ */
+int target_add_hybrid_breakpoint(struct target *target,
+ struct breakpoint *breakpoint);
+/**
+ * Remove the @a breakpoint for @a target.
+ *
+ * This routine is a wrapper for target->type->remove_breakpoint.
+ */
+
+int target_remove_breakpoint(struct target *target,
+ struct breakpoint *breakpoint);
+/**
+ * Add the @a watchpoint for @a target.
+ *
+ * This routine is a wrapper for target->type->add_watchpoint.
+ */
+int target_add_watchpoint(struct target *target,
+ struct watchpoint *watchpoint);
+/**
+ * Remove the @a watchpoint for @a target.
+ *
+ * This routine is a wrapper for target->type->remove_watchpoint.
+ */
+int target_remove_watchpoint(struct target *target,
+ struct watchpoint *watchpoint);
+
+/**
+ * Obtain the registers for GDB.
+ *
+ * This routine is a wrapper for target->type->get_gdb_reg_list.
+ */
+int target_get_gdb_reg_list(struct target *target,
+ struct reg **reg_list[], int *reg_list_size);
+
+/**
+ * Step the target.
+ *
+ * This routine is a wrapper for target->type->step.
+ */
+int target_step(struct target *target,
+ int current, uint32_t address, int handle_breakpoints);
+/**
+ * Run an algorithm on the @a target given.
+ *
+ * This routine is a wrapper for target->type->run_algorithm.
+ */
+int target_run_algorithm(struct target *target,
+ int num_mem_params, struct mem_param *mem_params,
+ int num_reg_params, struct reg_param *reg_param,
+ uint32_t entry_point, uint32_t exit_point,
+ int timeout_ms, void *arch_info);
+
+/**
+ * Starts an algorithm in the background on the @a target given.
+ *
+ * This routine is a wrapper for target->type->start_algorithm.
+ */
+int target_start_algorithm(struct target *target,
+ int num_mem_params, struct mem_param *mem_params,
+ int num_reg_params, struct reg_param *reg_params,
+ uint32_t entry_point, uint32_t exit_point,
+ void *arch_info);
+
+/**
+ * Wait for an algorithm on the @a target given.
+ *
+ * This routine is a wrapper for target->type->wait_algorithm.
+ */
+int target_wait_algorithm(struct target *target,
+ int num_mem_params, struct mem_param *mem_params,
+ int num_reg_params, struct reg_param *reg_params,
+ uint32_t exit_point, int timeout_ms,
+ void *arch_info);
+
+/**
+ * This routine is a wrapper for asynchronous algorithms.
+ *
+ */
+int target_run_flash_async_algorithm(struct target *target,
+ uint8_t *buffer, uint32_t count, int block_size,
+ int num_mem_params, struct mem_param *mem_params,
+ int num_reg_params, struct reg_param *reg_params,
+ uint32_t buffer_start, uint32_t buffer_size,
+ uint32_t entry_point, uint32_t exit_point,
+ void *arch_info);
+
+/**
+ * Read @a count items of @a size bytes from the memory of @a target at
+ * the @a address given.
+ *
+ * This routine is a wrapper for target->type->read_memory.
+ */
+int target_read_memory(struct target *target,
+ uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
+/**
+ * Write @a count items of @a size bytes to the memory of @a target at
+ * the @a address given. @a address must be aligned to @a size
+ * in target memory.
+ *
+ * The endianness is the same in the host and target memory for this
+ * function.
+ *
+ * \todo TODO:
+ * Really @a buffer should have been defined as "const void *" and
+ * @a buffer should have been aligned to @a size in the host memory.
+ *
+ * This is not enforced via e.g. assert's today and e.g. the
+ * target_write_buffer fn breaks this assumption.
+ *
+ * This routine is wrapper for target->type->write_memory.