58 #define ESP_XTENSA_SMP_EXAMINE_OTHER_CORES 5
136 bool other_core_resume_req =
false;
157 bool all_examined =
true;
165 all_examined =
false;
200 if (
target->
smp && other_core_resume_req) {
226 *need_resume =
false;
255 if (curr == gdb_target)
280 if (gdb_target && gdb_target !=
target) {
307 int handle_breakpoints,
333 int handle_breakpoints,
383 if (!debug_execution)
395 int handle_breakpoints)
398 uint32_t smp_break = 0;
481 esp_xtensa_smp->
chip_ops = chip_ops;
779 int32_t cores_max_id = 0;
783 if (cores_max_id < curr->
coreid)
784 cores_max_id = curr->
coreid;
786 if (
CMD_ARGC < ((uint32_t)cores_max_id + 1)) {
788 "Need %d filenames to dump to as output!",
808 .handler = esp_xtensa_smp_cmd_xtdef,
810 .help =
"Configure Xtensa core type",
815 .handler = esp_xtensa_smp_cmd_xtopt,
817 .help =
"Configure Xtensa core option",
818 .usage =
"<name> <value>",
822 .handler = esp_xtensa_smp_cmd_xtmem,
824 .help =
"Configure Xtensa memory/cache option",
825 .usage =
"<type> [parameters]",
829 .handler = esp_xtensa_smp_cmd_xtmmu,
831 .help =
"Configure Xtensa MMU option",
832 .usage =
"<NIREFILLENTRIES> <NDREFILLENTRIES> <IVARWAY56> <DVARWAY56>",
836 .handler = esp_xtensa_smp_cmd_xtmpu,
838 .help =
"Configure Xtensa MPU option",
839 .usage =
"<num FG seg> <min seg size> <lockable> <executeonly>",
843 .handler = esp_xtensa_smp_cmd_xtreg,
845 .help =
"Configure Xtensa register",
846 .usage =
"<regname> <regnum>",
850 .handler = esp_xtensa_smp_cmd_xtreg,
852 .help =
"Configure number of Xtensa registers",
853 .usage =
"<numregs>",
857 .handler = esp_xtensa_smp_cmd_xtregfmt,
859 .help =
"Configure format of Xtensa register map",
860 .usage =
"<numgregs>",
863 .name =
"set_permissive",
864 .handler = esp_xtensa_smp_cmd_permissive_mode,
866 .help =
"When set to 1, enable Xtensa permissive mode (less client-side checks)",
871 .handler = esp_xtensa_smp_cmd_mask_interrupts,
873 .help =
"mask Xtensa interrupts at step",
874 .usage =
"['on'|'off']",
878 .handler = esp_xtensa_smp_cmd_smpbreak,
880 .help =
"Set the way the CPU chains OCD breaks",
882 "[none|breakinout|runstall] | [BreakIn] [BreakOut] [RunStallIn] [DebugModeOut]",
885 .name =
"perfmon_enable",
886 .handler = esp_xtensa_smp_cmd_perfmon_enable,
888 .help =
"Enable and start performance counter",
889 .usage =
"<counter_id> <select> [mask] [kernelcnt] [tracelevel]",
892 .name =
"perfmon_dump",
893 .handler = esp_xtensa_smp_cmd_perfmon_dump,
896 "Dump performance counter value. If no argument specified, dumps all counters.",
897 .usage =
"[counter_id]",
900 .name =
"tracestart",
901 .handler = esp_xtensa_smp_cmd_tracestart,
904 "Tracing: Set up and start a trace. Optionally set stop trigger address and amount of data captured after.",
905 .usage =
"[pc <pcval>/[maskbitcount]] [after <n> [ins|words]]",
909 .handler = esp_xtensa_smp_cmd_tracestop,
911 .help =
"Tracing: Stop current trace as started by the tracestart command",
916 .handler = esp_xtensa_smp_cmd_tracedump,
918 .help =
"Tracing: Dump trace memory to a files. One file per core.",
919 .usage =
"<outfile1> <outfile2>",
void watchpoint_remove(struct target *target, target_addr_t address)
int watchpoint_add(struct target *target, target_addr_t address, uint32_t length, enum watchpoint_rw rw, uint32_t value, uint32_t mask)
void command_print(struct command_invocation *cmd, const char *format,...)
#define CMD
Use this macro to access the command being handled, rather than accessing the variable directly.
#define CALL_COMMAND_HANDLER(name, extra ...)
Use this to macro to call a command helper (or a nested handler).
#define CMD_ARGV
Use this macro to access the arguments for the command being handled, rather than accessing the varia...
#define CMD_ARGC
Use this macro to access the number of arguments for the command being handled, rather than accessing...
#define CMD_CTX
Use this macro to access the context of the command being handled, rather than accessing the variable...
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
int esp_xtensa_init_arch_info(struct target *target, struct esp_xtensa_common *esp_xtensa, struct xtensa_debug_module_config *dm_cfg, const struct esp_semihost_ops *semihost_ops)
int esp_xtensa_poll(struct target *target)
int esp_xtensa_target_init(struct command_context *cmd_ctx, struct target *target)
static struct esp_xtensa_common * target_to_esp_xtensa(struct target *target)
int esp_xtensa_semihosting_init(struct target *target)
int esp_xtensa_semihosting(struct target *target, int *retval)
Checks and processes an ESP Xtensa semihosting request.
int esp_xtensa_smp_init_arch_info(struct target *target, struct esp_xtensa_smp_common *esp_xtensa_smp, struct xtensa_debug_module_config *dm_cfg, const struct esp_xtensa_smp_chip_ops *chip_ops, const struct esp_semihost_ops *semihost_ops)
const struct command_registration esp_xtensa_smp_command_handlers[]
#define ESP_XTENSA_SMP_EXAMINE_OTHER_CORES
static int esp_xtensa_smp_update_halt_gdb(struct target *target, bool *need_resume)
COMMAND_HANDLER(esp_xtensa_smp_cmd_xtdef)
int esp_xtensa_smp_soft_reset_halt(struct target *target)
int esp_xtensa_smp_deassert_reset(struct target *target)
const struct command_registration esp_xtensa_smp_xtensa_command_handlers[]
int esp_xtensa_smp_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
static int esp_xtensa_smp_resume_cores(struct target *target, int handle_breakpoints, int debug_execution)
static struct esp_xtensa_smp_common * target_to_esp_xtensa_smp(struct target *target)
static int esp_xtensa_smp_smpbreak_disable(struct target *target, uint32_t *smp_break)
int esp_xtensa_smp_watchpoint_remove(struct target *target, struct watchpoint *watchpoint)
static int esp_xtensa_smp_smpbreak_restore(struct target *target, uint32_t smp_break)
int esp_xtensa_smp_target_init(struct command_context *cmd_ctx, struct target *target)
int esp_xtensa_smp_watchpoint_add(struct target *target, struct watchpoint *watchpoint)
int esp_xtensa_smp_assert_reset(struct target *target)
int esp_xtensa_smp_poll(struct target *target)
int esp_xtensa_smp_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
static struct target * get_halted_esp_xtensa_smp(struct target *target, int32_t coreid)
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_TARGET_DEBUG(target, fmt_str,...)
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
#define LOG_DEBUG(expr ...)
#define foreach_smp_target(pos, head)
Semihost calls handling operations.
struct esp_semihost_data semihost
int(* poll)(struct target *target)
int(* on_halt)(struct target *target)
int(* reset)(struct target *target)
struct esp_xtensa_common esp_xtensa
const struct esp_xtensa_smp_chip_ops * chip_ops
bool other_core_does_resume
struct gdb_service * gdb_service
enum target_debug_reason debug_reason
struct list_head * smp_targets
int target_call_event_callbacks(struct target *target, enum target_event event)
int target_examine_one(struct target *target)
Examine the specified target, letting it perform any Initialisation that requires JTAG access.
struct target * get_current_target(struct command_context *cmd_ctx)
int target_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Make the target (re)start executing using its saved execution context (possibly with some modificatio...
@ TARGET_EVENT_DEBUG_HALTED
static const char * target_name(struct target *target)
Returns the instance-specific name of the specified target.
static bool target_was_examined(struct target *target)
#define container_of(ptr, type, member)
Cast a member of a structure out to the containing structure.
int xtensa_watchpoint_add(struct target *target, struct watchpoint *watchpoint)
int xtensa_prepare_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
int xtensa_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
int xtensa_smpbreak_set(struct target *target, uint32_t set)
int xtensa_examine(struct target *target)
int xtensa_watchpoint_remove(struct target *target, struct watchpoint *watchpoint)
int xtensa_smpbreak_get(struct target *target, uint32_t *val)
int xtensa_do_resume(struct target *target)
int xtensa_deassert_reset(struct target *target)
int xtensa_assert_reset(struct target *target)
static struct xtensa * target_to_xtensa(struct target *target)