-
-/* cli handling */
-
-/* forward declarations */
-int mips_m4k_poll(struct target *target);
-int mips_m4k_halt(struct target *target);
-int mips_m4k_soft_reset_halt(struct target *target);
-int mips_m4k_resume(struct target *target, int current, uint32_t address, int handle_breakpoints, int debug_execution);
-int mips_m4k_step(struct target *target, int current, uint32_t address, int handle_breakpoints);
-int mips_m4k_read_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
-int mips_m4k_write_memory(struct target *target, uint32_t address, uint32_t size, uint32_t count, uint8_t *buffer);
-int mips_m4k_register_commands(struct command_context *cmd_ctx);
-int mips_m4k_init_target(struct command_context *cmd_ctx, struct target *target);
-int mips_m4k_target_create(struct target *target, Jim_Interp *interp);
-
-int mips_m4k_examine(struct target *target);
-int mips_m4k_assert_reset(struct target *target);
-int mips_m4k_deassert_reset(struct target *target);
-int mips_m4k_checksum_memory(struct target *target, uint32_t address, uint32_t size, uint32_t *checksum);
-
-struct target_type mips_m4k_target =
-{
- .name = "mips_m4k",
-
- .poll = mips_m4k_poll,
- .arch_state = mips32_arch_state,
-
- .target_request_data = NULL,
-
- .halt = mips_m4k_halt,
- .resume = mips_m4k_resume,
- .step = mips_m4k_step,
-
- .assert_reset = mips_m4k_assert_reset,
- .deassert_reset = mips_m4k_deassert_reset,
- .soft_reset_halt = mips_m4k_soft_reset_halt,
-
- .get_gdb_reg_list = mips32_get_gdb_reg_list,
-
- .read_memory = mips_m4k_read_memory,
- .write_memory = mips_m4k_write_memory,
- .bulk_write_memory = mips_m4k_bulk_write_memory,
- .checksum_memory = mips_m4k_checksum_memory,
- .blank_check_memory = NULL,
-
- .run_algorithm = mips32_run_algorithm,
-
- .add_breakpoint = mips_m4k_add_breakpoint,
- .remove_breakpoint = mips_m4k_remove_breakpoint,
- .add_watchpoint = mips_m4k_add_watchpoint,
- .remove_watchpoint = mips_m4k_remove_watchpoint,
-
- .register_commands = mips_m4k_register_commands,
- .target_create = mips_m4k_target_create,
- .init_target = mips_m4k_init_target,
- .examine = mips_m4k_examine,
-};
-
-int mips_m4k_examine_debug_reason(struct target *target)
+static void mips_m4k_enable_breakpoints(struct target *target);
+static void mips_m4k_enable_watchpoints(struct target *target);
+static int mips_m4k_set_breakpoint(struct target *target,
+ struct breakpoint *breakpoint);
+static int mips_m4k_unset_breakpoint(struct target *target,
+ struct breakpoint *breakpoint);
+static int mips_m4k_internal_restore(struct target *target, int current,
+ target_addr_t address, int handle_breakpoints,
+ int debug_execution);
+static int mips_m4k_halt(struct target *target);
+static int mips_m4k_bulk_write_memory(struct target *target, target_addr_t address,
+ uint32_t count, const uint8_t *buffer);
+
+static int mips_m4k_examine_debug_reason(struct target *target)