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 bool handle_breakpoints,
bool debug_execution)
362 bool handle_breakpoints,
363 bool debug_execution)
412 if (!debug_execution)
424 bool handle_breakpoints)
427 uint32_t smp_break = 0;
506 uint32_t smp_break = 0;
512 run_target = head->
target;
517 LOG_ERROR(
"Failed to find HALTED core!");
526 va_start(ap, num_args);
547 uint32_t smp_break = 0;
553 run_target = head->
target;
558 LOG_ERROR(
"Failed to find HALTED core!");
566 va_start(ap, num_args);
587 esp_xtensa_smp->
chip_ops = chip_ops;
885 int32_t cores_max_id = 0;
889 if (cores_max_id < curr->
coreid)
890 cores_max_id = curr->
coreid;
892 if (
CMD_ARGC < ((uint32_t)cores_max_id + 1)) {
894 "Need %d filenames to dump to as output!",
914 .handler = esp_xtensa_smp_cmd_xtdef,
916 .help =
"Configure Xtensa core type",
921 .handler = esp_xtensa_smp_cmd_xtopt,
923 .help =
"Configure Xtensa core option",
924 .usage =
"<name> <value>",
928 .handler = esp_xtensa_smp_cmd_xtmem,
930 .help =
"Configure Xtensa memory/cache option",
931 .usage =
"<type> [parameters]",
935 .handler = esp_xtensa_smp_cmd_xtmmu,
937 .help =
"Configure Xtensa MMU option",
938 .usage =
"<NIREFILLENTRIES> <NDREFILLENTRIES> <IVARWAY56> <DVARWAY56>",
942 .handler = esp_xtensa_smp_cmd_xtmpu,
944 .help =
"Configure Xtensa MPU option",
945 .usage =
"<num FG seg> <min seg size> <lockable> <executeonly>",
949 .handler = esp_xtensa_smp_cmd_xtreg,
951 .help =
"Configure Xtensa register",
952 .usage =
"<regname> <regnum>",
956 .handler = esp_xtensa_smp_cmd_xtreg,
958 .help =
"Configure number of Xtensa registers",
959 .usage =
"<numregs>",
963 .handler = esp_xtensa_smp_cmd_xtregfmt,
965 .help =
"Configure format of Xtensa register map",
966 .usage =
"<numgregs>",
969 .name =
"set_permissive",
970 .handler = esp_xtensa_smp_cmd_permissive_mode,
972 .help =
"When set to 1, enable Xtensa permissive mode (less client-side checks)",
977 .handler = esp_xtensa_smp_cmd_mask_interrupts,
979 .help =
"mask Xtensa interrupts at step",
980 .usage =
"['on'|'off']",
984 .handler = esp_xtensa_smp_cmd_smpbreak,
986 .help =
"Set the way the CPU chains OCD breaks",
988 "[none|breakinout|runstall] | [BreakIn] [BreakOut] [RunStallIn] [DebugModeOut]",
991 .name =
"perfmon_enable",
992 .handler = esp_xtensa_smp_cmd_perfmon_enable,
994 .help =
"Enable and start performance counter",
995 .usage =
"<counter_id> <select> [mask] [kernelcnt] [tracelevel]",
998 .name =
"perfmon_dump",
999 .handler = esp_xtensa_smp_cmd_perfmon_dump,
1002 "Dump performance counter value. If no argument specified, dumps all counters.",
1003 .usage =
"[counter_id]",
1006 .name =
"tracestart",
1007 .handler = esp_xtensa_smp_cmd_tracestart,
1010 "Tracing: Set up and start a trace. Optionally set stop trigger address and amount of data captured after.",
1011 .usage =
"[pc <pcval>/[maskbitcount]] [after <n> [ins|words]]",
1014 .name =
"tracestop",
1015 .handler = esp_xtensa_smp_cmd_tracestop,
1017 .help =
"Tracing: Stop current trace as started by the tracestart command",
1021 .name =
"tracedump",
1022 .handler = esp_xtensa_smp_cmd_tracedump,
1024 .help =
"Tracing: Dump trace memory to a files. One file per core.",
1025 .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.
uint32_t address
Starting address. Sector aligned.
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[]
int esp_xtensa_smp_step(struct target *target, bool current, target_addr_t address, bool handle_breakpoints)
#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)
static int esp_xtensa_smp_resume_cores(struct target *target, bool handle_breakpoints, bool debug_execution)
int esp_xtensa_smp_soft_reset_halt(struct target *target)
int esp_xtensa_smp_deassert_reset(struct target *target)
int esp_xtensa_smp_resume(struct target *target, bool current, target_addr_t address, bool handle_breakpoints, bool debug_execution)
const struct command_registration esp_xtensa_smp_xtensa_command_handlers[]
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)
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.
int target_resume(struct target *target, bool current, target_addr_t address, bool handle_breakpoints, bool debug_execution)
Make the target (re)start executing using its saved execution context (possibly with some modificatio...
struct target * get_current_target(struct command_context *cmd_ctx)
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_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)
int xtensa_step(struct target *target, bool current, target_addr_t address, bool handle_breakpoints)
int xtensa_prepare_resume(struct target *target, bool current, target_addr_t address, bool handle_breakpoints, bool debug_execution)
static struct xtensa * target_to_xtensa(struct target *target)