59 #define ESP_XTENSA_SMP_EXAMINE_OTHER_CORES 5
156 bool other_core_resume_req =
false;
187 bool all_examined =
true;
195 all_examined =
false;
230 if (
target->
smp && other_core_resume_req) {
256 *need_resume =
false;
285 if (curr == gdb_target)
310 if (gdb_target && gdb_target !=
target) {
337 int handle_breakpoints,
363 int handle_breakpoints,
413 if (!debug_execution)
425 int handle_breakpoints)
428 uint32_t smp_break = 0;
507 uint32_t smp_break = 0;
513 run_target = head->
target;
518 LOG_ERROR(
"Failed to find HALTED core!");
527 va_start(ap, num_args);
548 uint32_t smp_break = 0;
554 run_target = head->
target;
559 LOG_ERROR(
"Failed to find HALTED core!");
567 va_start(ap, num_args);
588 esp_xtensa_smp->
chip_ops = chip_ops;
886 int32_t cores_max_id = 0;
890 if (cores_max_id < curr->
coreid)
891 cores_max_id = curr->
coreid;
893 if (
CMD_ARGC < ((uint32_t)cores_max_id + 1)) {
895 "Need %d filenames to dump to as output!",
915 .handler = esp_xtensa_smp_cmd_xtdef,
917 .help =
"Configure Xtensa core type",
922 .handler = esp_xtensa_smp_cmd_xtopt,
924 .help =
"Configure Xtensa core option",
925 .usage =
"<name> <value>",
929 .handler = esp_xtensa_smp_cmd_xtmem,
931 .help =
"Configure Xtensa memory/cache option",
932 .usage =
"<type> [parameters]",
936 .handler = esp_xtensa_smp_cmd_xtmmu,
938 .help =
"Configure Xtensa MMU option",
939 .usage =
"<NIREFILLENTRIES> <NDREFILLENTRIES> <IVARWAY56> <DVARWAY56>",
943 .handler = esp_xtensa_smp_cmd_xtmpu,
945 .help =
"Configure Xtensa MPU option",
946 .usage =
"<num FG seg> <min seg size> <lockable> <executeonly>",
950 .handler = esp_xtensa_smp_cmd_xtreg,
952 .help =
"Configure Xtensa register",
953 .usage =
"<regname> <regnum>",
957 .handler = esp_xtensa_smp_cmd_xtreg,
959 .help =
"Configure number of Xtensa registers",
960 .usage =
"<numregs>",
964 .handler = esp_xtensa_smp_cmd_xtregfmt,
966 .help =
"Configure format of Xtensa register map",
967 .usage =
"<numgregs>",
970 .name =
"set_permissive",
971 .handler = esp_xtensa_smp_cmd_permissive_mode,
973 .help =
"When set to 1, enable Xtensa permissive mode (less client-side checks)",
978 .handler = esp_xtensa_smp_cmd_mask_interrupts,
980 .help =
"mask Xtensa interrupts at step",
981 .usage =
"['on'|'off']",
985 .handler = esp_xtensa_smp_cmd_smpbreak,
987 .help =
"Set the way the CPU chains OCD breaks",
989 "[none|breakinout|runstall] | [BreakIn] [BreakOut] [RunStallIn] [DebugModeOut]",
992 .name =
"perfmon_enable",
993 .handler = esp_xtensa_smp_cmd_perfmon_enable,
995 .help =
"Enable and start performance counter",
996 .usage =
"<counter_id> <select> [mask] [kernelcnt] [tracelevel]",
999 .name =
"perfmon_dump",
1000 .handler = esp_xtensa_smp_cmd_perfmon_dump,
1003 "Dump performance counter value. If no argument specified, dumps all counters.",
1004 .usage =
"[counter_id]",
1007 .name =
"tracestart",
1008 .handler = esp_xtensa_smp_cmd_tracestart,
1011 "Tracing: Set up and start a trace. Optionally set stop trigger address and amount of data captured after.",
1012 .usage =
"[pc <pcval>/[maskbitcount]] [after <n> [ins|words]]",
1015 .name =
"tracestop",
1016 .handler = esp_xtensa_smp_cmd_tracestop,
1018 .help =
"Tracing: Stop current trace as started by the tracestart command",
1022 .name =
"tracedump",
1023 .handler = esp_xtensa_smp_cmd_tracedump,
1025 .help =
"Tracing: Dump trace memory to a files. One file per core.",
1026 .usage =
"<outfile1> <outfile2>",
int watchpoint_add(struct target *target, target_addr_t address, unsigned int length, enum watchpoint_rw rw, uint64_t value, uint64_t mask)
int watchpoint_remove(struct target *target, target_addr_t address)
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.
static int esp_algorithm_run_func_image_va(struct target *target, struct esp_algorithm_run_data *run, uint32_t num_args, va_list ap)
Loads and runs stub from specified image.
static int esp_algorithm_run_onboard_func_va(struct target *target, struct esp_algorithm_run_data *run, target_addr_t func_addr, uint32_t num_args, va_list ap)
Runs pre-compiled on-board function.
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)
int esp_xtensa_on_halt(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_run_onboard_func(struct target *target, struct esp_algorithm_run_data *run, uint32_t func_addr, uint32_t num_args,...)
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)
int esp_xtensa_smp_run_func_image(struct target *target, struct esp_algorithm_run_data *run, uint32_t num_args,...)
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_on_halt(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 list_first_entry(ptr, type, member)
#define LOG_TARGET_INFO(target, fmt_str,...)
#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 ...)
static uint32_t lh(unsigned int rd, unsigned int base, uint16_t offset) __attribute__((unused))
#define foreach_smp_target(pos, head)
struct esp_dbg_stubs dbg_stubs
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...
static bool target_was_examined(const struct target *target)
@ TARGET_EVENT_DEBUG_HALTED
static const char * target_name(const struct target *target)
Returns the instance-specific name of the specified 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)