OpenOCD
xtensa.c File Reference
Include dependency graph for xtensa.c:

Go to the source code of this file.

Data Structures

union  xtensa_reg_val_u
 

Macros

#define _XT_INS_FORMAT_RRI4(X, OPCODE, IMM4, R, S, T)
 
#define _XT_INS_FORMAT_RRI8(X, OPCODE, R, S, T, IMM8)
 
#define _XT_INS_FORMAT_RRR(X, OPCODE, ST, R)
 
#define _XT_INS_FORMAT_RRRN(X, OPCODE, S, T, IMM4)
 
#define _XT_INS_FORMAT_RSR(X, OPCODE, SR, T)
 
#define XT_EPC_REG_NUM_BASE   (0xb0U) /* (EPC1 - 1), for adding DBGLEVEL */
 
#define XT_EPS_REG_NUM_BASE   (0xc0U) /* (EPS2 - 2), for adding DBGLEVEL */
 
#define XT_HW_DBREAK_MAX_NUM   2
 
#define XT_HW_IBREAK_MAX_NUM   2
 
#define XT_INS_CALL0(X, IMM18)   (XT_ISBE(X) ? (0x500000 | ((IMM18) & 0x3ffff)) : (0x000005 | (((IMM18) & 0x3ffff) << 6)))
 
#define XT_INS_DHWB(X, S, IMM8)   _XT_INS_FORMAT_RRI8(X, 0x007042, 0, S, 0, IMM8)
 
#define XT_INS_DHWBI(X, S, IMM8)   _XT_INS_FORMAT_RRI8(X, 0x007052, 0, S, 0, IMM8)
 
#define XT_INS_IHI(X, S, IMM8)   _XT_INS_FORMAT_RRI8(X, 0x0070E2, 0, S, 0, IMM8)
 
#define XT_INS_ISYNC(X)   (XT_ISBE(X) ? 0x000200 << 8 : 0x002000)
 
#define XT_INS_JX(X, S)   (XT_ISBE(X) ? (0x050000 | ((S) << 12)) : (0x0000a0 | ((S) << 8)))
 
#define XT_INS_L16UI(X, S, T, IMM8)   _XT_INS_FORMAT_RRI8(X, 0x001002, 0, S, T, IMM8)
 
#define XT_INS_L32E(X, R, S, T)   _XT_INS_FORMAT_RRI4(X, 0x090000, 0, R, S, T)
 
#define XT_INS_L32E_S32E_MASK(X)   (XT_ISBE(X) ? 0xF000FF << 8 : 0xFF000F)
 
#define XT_INS_L32I(X, S, T, IMM8)   _XT_INS_FORMAT_RRI8(X, 0x002002, 0, S, T, IMM8)
 
#define XT_INS_L8UI(X, S, T, IMM8)   _XT_INS_FORMAT_RRI8(X, 0x000002, 0, S, T, IMM8)
 
#define XT_INS_LDDR32P(X, S)   (XT_ISBE(X) ? (0x0E0700 | ((S) << 12)) << 8 : (0x0070E0 | ((S) << 8)))
 
#define XT_INS_PPTLB(X, S, T)   _XT_INS_FORMAT_RRR(X, 0x500000, ((S) << 4) | (T), 0xD)
 
#define XT_INS_RFDD(X)   (XT_ISBE(X) ? 0x010e1f << 8 : 0xf1e010)
 
#define XT_INS_RFDO(X)   (XT_ISBE(X) ? 0x000e1f << 8 : 0xf1e000)
 
#define XT_INS_RFR(X, FR, T)   _XT_INS_FORMAT_RRR(X, 0xFA0000, ((FR << 4) | 0x4), T)
 
#define XT_INS_RFWO(X)   (XT_ISBE(X) ? 0x004300 << 8 : 0x003400)
 
#define XT_INS_RFWO_RFWU_MASK(X)   (XT_ISBE(X) ? 0xFFFFFF << 8 : 0xFFFFFF)
 
#define XT_INS_RFWU(X)   (XT_ISBE(X) ? 0x005300 << 8 : 0x003500)
 
#define XT_INS_ROTW(X, N)   (XT_ISBE(X) ? ((0x000804) | (((N) & 15) << 16)) << 8 : ((0x408000) | (((N) & 15) << 4)))
 
#define XT_INS_RSR(X, SR, T)   _XT_INS_FORMAT_RSR(X, 0x030000, SR, T)
 
#define XT_INS_RUR(X, UR, T)   _XT_INS_FORMAT_RRR(X, 0xE30000, UR, T)
 
#define XT_INS_S16I(X, S, T, IMM8)   _XT_INS_FORMAT_RRI8(X, 0x005002, 0, S, T, IMM8)
 
#define XT_INS_S32E(X, R, S, T)   _XT_INS_FORMAT_RRI4(X, 0x490000, 0, R, S, T)
 
#define XT_INS_S32I(X, S, T, IMM8)   _XT_INS_FORMAT_RRI8(X, 0x006002, 0, S, T, IMM8)
 
#define XT_INS_S8I(X, S, T, IMM8)   _XT_INS_FORMAT_RRI8(X, 0x004002, 0, S, T, IMM8)
 
#define XT_INS_SDDR32P(X, S)   (XT_ISBE(X) ? (0x0F0700 | ((S) << 12)) << 8 : (0x0070F0 | ((S) << 8)))
 
#define XT_INS_WFR(X, FR, T)   _XT_INS_FORMAT_RRR(X, 0xFA0000, ((T << 4) | 0x5), FR)
 
#define XT_INS_WSR(X, SR, T)   _XT_INS_FORMAT_RSR(X, 0x130000, SR, T)
 
#define XT_INS_WUR(X, UR, T)   _XT_INS_FORMAT_RSR(X, 0xF30000, UR, T)
 
#define XT_INS_XSR(X, SR, T)   _XT_INS_FORMAT_RSR(X, 0x610000, SR, T)
 
#define XT_NIBSWAP16(V)
 
#define XT_NIBSWAP24(V)
 
#define XT_NIBSWAP8(V)
 
#define XT_NX_IBREAKC_BASE   (0xc0U) /* (IBREAKC0..IBREAKC1) for NX */
 
#define XT_PC_DBREG_NUM_BASE   (0x20U) /* External (i.e., GDB) access */
 
#define XT_PC_REG_NUM_VIRTUAL   (0xffU) /* Marker for computing PC (EPC[DBGLEVEL) */
 
#define XT_PS_REG_NUM   (0xe6U)
 
#define XT_REG_A0   (xtensa_regs[XT_REG_IDX_AR0].reg_num)
 
#define XT_REG_A3   (xtensa_regs[XT_REG_IDX_AR3].reg_num)
 
#define XT_REG_A4   (xtensa_regs[XT_REG_IDX_AR4].reg_num)
 
#define XT_SR_DDR   (xtensa_regs[XT_REG_IDX_DDR].reg_num)
 
#define XT_SR_PS   (xtensa_regs[XT_REG_IDX_PS].reg_num)
 
#define XT_SR_WB   (xtensa_regs[XT_REG_IDX_WINDOWBASE].reg_num)
 
#define XT_SW_BREAKPOINTS_MAX_NUM   32
 
#define XT_TLB1_ACC_MSK   0xF
 
#define XT_TLB1_ACC_SHIFT   8
 
#define XT_WATCHPOINTS_NUM_MAX   2
 

Enumerations

enum  xtensa_mem_region_type {
  XTENSA_MEM_REG_IROM = 0x0 , XTENSA_MEM_REG_IRAM , XTENSA_MEM_REG_DROM , XTENSA_MEM_REG_DRAM ,
  XTENSA_MEM_REG_SRAM , XTENSA_MEM_REG_SROM , XTENSA_MEM_REGS_NUM
}
 Types of memory used at xtensa target. More...
 
enum  xtensa_mpu_access_type {
  XTENSA_ACC_00X_000 = 0x2 , XTENSA_ACC_000_00X , XTENSA_ACC_R00_000 , XTENSA_ACC_R0X_000 ,
  XTENSA_ACC_RW0_000 , XTENSA_ACC_RWX_000 , XTENSA_ACC_0W0_0W0 , XTENSA_ACC_RW0_RWX ,
  XTENSA_ACC_RW0_R00 , XTENSA_ACC_RWX_R0X , XTENSA_ACC_R00_R00 , XTENSA_ACC_R0X_R0X ,
  XTENSA_ACC_RW0_RW0 , XTENSA_ACC_RWX_RWX
}
 Types of access rights for MPU option The first block is kernel RWX ARs; the second block is user rwx ARs. More...
 

Functions

 COMMAND_HANDLER (xtensa_cmd_dm_rw)
 
 COMMAND_HANDLER (xtensa_cmd_exe)
 
 COMMAND_HANDLER (xtensa_cmd_mask_interrupts)
 
 COMMAND_HANDLER (xtensa_cmd_perfmon_dump)
 
 COMMAND_HANDLER (xtensa_cmd_perfmon_enable)
 
 COMMAND_HANDLER (xtensa_cmd_permissive_mode)
 
 COMMAND_HANDLER (xtensa_cmd_smpbreak)
 
 COMMAND_HANDLER (xtensa_cmd_tracedump)
 
 COMMAND_HANDLER (xtensa_cmd_tracestart)
 
 COMMAND_HANDLER (xtensa_cmd_tracestop)
 
 COMMAND_HANDLER (xtensa_cmd_xtdef)
 
 COMMAND_HANDLER (xtensa_cmd_xtmem)
 
 COMMAND_HANDLER (xtensa_cmd_xtmmu)
 
 COMMAND_HANDLER (xtensa_cmd_xtmpu)
 
 COMMAND_HANDLER (xtensa_cmd_xtopt)
 
 COMMAND_HANDLER (xtensa_cmd_xtreg)
 
 COMMAND_HANDLER (xtensa_cmd_xtregfmt)
 
 COMMAND_HELPER (xtensa_cmd_dm_rw_do, struct xtensa *xtensa)
 
static COMMAND_HELPER (xtensa_cmd_exe_do, struct target *target)
 
 COMMAND_HELPER (xtensa_cmd_mask_interrupts_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_perfmon_dump_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_perfmon_enable_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_permissive_mode_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_smpbreak_do, struct target *target)
 
 COMMAND_HELPER (xtensa_cmd_tracedump_do, struct xtensa *xtensa, const char *fname)
 
 COMMAND_HELPER (xtensa_cmd_tracestart_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_tracestop_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_xtdef_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_xtmem_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_xtmmu_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_xtmpu_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_xtopt_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_xtreg_do, struct xtensa *xtensa)
 
 COMMAND_HELPER (xtensa_cmd_xtregfmt_do, struct xtensa *xtensa)
 
int xtensa_assert_reset (struct target *target)
 
int xtensa_breakpoint_add (struct target *target, struct breakpoint *breakpoint)
 
int xtensa_breakpoint_remove (struct target *target, struct breakpoint *breakpoint)
 
static int xtensa_build_reg_cache (struct target *target)
 
static enum xtensa_reg_id xtensa_canonical_to_windowbase_offset (struct xtensa *xtensa, enum xtensa_reg_id reg_idx, int windowbase)
 
void xtensa_cause_clear (struct target *target)
 
uint32_t xtensa_cause_get (struct target *target)
 
void xtensa_cause_reset (struct target *target)
 
int xtensa_checksum_memory (struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
 
static bool xtensa_cmd_xtopt_legal_val (char *opt, int val, int min, int max)
 
static int xtensa_core_reg_get (struct reg *reg)
 
static int xtensa_core_reg_set (struct reg *reg, uint8_t *buf)
 
int xtensa_core_status_check (struct target *target)
 
int xtensa_deassert_reset (struct target *target)
 
int xtensa_do_resume (struct target *target)
 
int xtensa_do_step (struct target *target, int current, target_addr_t address, int handle_breakpoints)
 
int xtensa_examine (struct target *target)
 
int xtensa_fetch_all_regs (struct target *target)
 
static void xtensa_free_reg_cache (struct target *target)
 
int xtensa_gdb_query_custom (struct target *target, const char *packet, char **response_p)
 
static int32_t xtensa_gdbqc_parse_exec_tie_ops (struct target *target, char *opstr)
 
static int xtensa_gdbqc_qxtreg (struct target *target, const char *packet, char **response_p)
 
const char * xtensa_get_gdb_arch (const struct target *target)
 
int xtensa_get_gdb_reg_list (struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
 
static const struct xtensa_local_mem_configxtensa_get_mem_config (struct xtensa *xtensa, enum xtensa_mem_region_type type)
 Gets a config for the specific mem type. More...
 
static target_addr_t xtensa_get_overlap_size (target_addr_t r1_start, target_addr_t r1_end, target_addr_t r2_start, target_addr_t r2_end)
 Returns a size of overlapped region of two ranges. More...
 
int xtensa_halt (struct target *target)
 
static void xtensa_imprecise_exception_clear (struct target *target)
 
static int xtensa_imprecise_exception_occurred (struct target *target)
 
int xtensa_init_arch_info (struct target *target, struct xtensa *xtensa, const struct xtensa_debug_module_config *dm_cfg)
 
static bool xtensa_is_cacheable (const struct xtensa_cache_config *cache, const struct xtensa_local_mem_config *mem, target_addr_t address)
 
static bool xtensa_is_dcacheable (struct xtensa *xtensa, target_addr_t address)
 
static bool xtensa_is_icacheable (struct xtensa *xtensa, target_addr_t address)
 
static bool xtensa_is_stopped (struct target *target)
 
static void xtensa_mark_register_dirty (struct xtensa *xtensa, enum xtensa_reg_id reg_idx)
 
static bool xtensa_memory_op_validate_range (struct xtensa *xtensa, target_addr_t address, size_t size, int access)
 Check if the address gets to memory regions, and its access mode. More...
 
static const struct xtensa_local_mem_region_configxtensa_memory_region_find (const struct xtensa_local_mem_config *mem, target_addr_t address)
 Extracts an exact xtensa_local_mem_region_config from xtensa_local_mem_config for a given address Returns NULL if nothing found. More...
 
static bool xtensa_memory_regions_overlap (target_addr_t r1_start, target_addr_t r1_end, target_addr_t r2_start, target_addr_t r2_end)
 Returns true if two ranges are overlapping. More...
 
int xtensa_mmu_is_enabled (struct target *target, int *enabled)
 
static bool xtensa_pc_in_winexc (struct target *target, target_addr_t pc)
 
int xtensa_poll (struct target *target)
 
int xtensa_prepare_resume (struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
 
static void xtensa_queue_exec_ins (struct xtensa *xtensa, uint32_t ins)
 
static void xtensa_queue_exec_ins_wide (struct xtensa *xtensa, uint8_t *ops, uint8_t oplen)
 
static int xtensa_queue_pwr_reg_write (struct xtensa *xtensa, unsigned int reg, uint32_t data)
 
int xtensa_read_buffer (struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer)
 
int xtensa_read_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
 
xtensa_reg_val_t xtensa_reg_get (struct target *target, enum xtensa_reg_id reg_id)
 
static xtensa_reg_val_t xtensa_reg_get_value (struct reg *reg)
 
static bool xtensa_reg_is_readable (int flags, int cpenable)
 
void xtensa_reg_set (struct target *target, enum xtensa_reg_id reg_id, xtensa_reg_val_t value)
 
void xtensa_reg_set_deep_relgen (struct target *target, enum xtensa_reg_id a_idx, xtensa_reg_val_t value)
 
static void xtensa_reg_set_value (struct reg *reg, xtensa_reg_val_t value)
 
static bool xtensa_region_ar_exec (struct target *target, target_addr_t start, target_addr_t end)
 
int xtensa_resume (struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
 
int xtensa_run_algorithm (struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info)
 
static bool xtensa_scratch_regs_fixup (struct xtensa *xtensa, struct reg *reg_list, int i, int j, int a_idx, int ar_idx)
 
void xtensa_set_permissive_mode (struct target *target, bool state)
 
int xtensa_smpbreak_get (struct target *target, uint32_t *val)
 
int xtensa_smpbreak_read (struct xtensa *xtensa, uint32_t *val)
 
int xtensa_smpbreak_set (struct target *target, uint32_t set)
 
int xtensa_smpbreak_write (struct xtensa *xtensa, uint32_t set)
 
int xtensa_soft_reset_halt (struct target *target)
 
int xtensa_start_algorithm (struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t entry_point, target_addr_t exit_point, void *arch_info)
 
int xtensa_step (struct target *target, int current, target_addr_t address, int handle_breakpoints)
 
static int xtensa_sw_breakpoint_add (struct target *target, struct breakpoint *breakpoint, struct xtensa_sw_breakpoint *sw_bp)
 
static int xtensa_sw_breakpoint_remove (struct target *target, struct xtensa_sw_breakpoint *sw_bp)
 
void xtensa_target_deinit (struct target *target)
 
int xtensa_target_init (struct command_context *cmd_ctx, struct target *target)
 
static const struct xtensa_local_mem_region_configxtensa_target_memory_region_find (struct xtensa *xtensa, target_addr_t address)
 Returns a corresponding xtensa_local_mem_region_config from the xtensa target for a given address Returns NULL if nothing found. More...
 
static int xtensa_update_instruction (struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
 
int xtensa_wait_algorithm (struct target *target, int num_mem_params, struct mem_param *mem_params, int num_reg_params, struct reg_param *reg_params, target_addr_t exit_point, unsigned int timeout_ms, void *arch_info)
 Waits for an algorithm in the target. More...
 
int xtensa_wakeup (struct target *target)
 
int xtensa_watchpoint_add (struct target *target, struct watchpoint *watchpoint)
 
int xtensa_watchpoint_remove (struct target *target, struct watchpoint *watchpoint)
 
static void xtensa_window_state_restore (struct target *target, uint32_t woe)
 
static int xtensa_window_state_save (struct target *target, uint32_t *woe)
 
static enum xtensa_reg_id xtensa_windowbase_offset_to_canonical (struct xtensa *xtensa, enum xtensa_reg_id reg_idx, int windowbase)
 
int xtensa_write_buffer (struct target *target, target_addr_t address, uint32_t count, const uint8_t *buffer)
 
static int xtensa_write_dirty_registers (struct target *target)
 
int xtensa_write_memory (struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
 

Variables

static const struct xtensa_keyval_info xt_qerr [XT_QERR_NUM]
 
static const struct command_registration xtensa_any_command_handlers []
 
const struct command_registration xtensa_command_handlers []
 
static const bool xtensa_extra_debug_log
 
static const struct reg_arch_type xtensa_reg_type
 
struct xtensa_reg_desc xtensa_regs [XT_NUM_REGS]
 

Macro Definition Documentation

◆ _XT_INS_FORMAT_RRI4

#define _XT_INS_FORMAT_RRI4 (   X,
  OPCODE,
  IMM4,
  R,
  S,
 
)
Value:
(XT_ISBE(X) ? (XT_NIBSWAP24(OPCODE) \
| (((T) & 0x0F) << 16) \
| (((S) & 0x0F) << 12) \
| (((R) & 0x0F) << 8)) << 8 \
| ((IMM4) & 0x0F) \
: (OPCODE) \
| (((IMM4) & 0x0F) << 20) \
| (((R) & 0x0F) << 12) \
| (((S) & 0x0F) << 8) \
| (((T) & 0x0F) << 4))
#define XT_NIBSWAP24(V)
Definition: xtensa.c:35
#define XT_ISBE(X)
Definition: xtensa.h:24

Definition at line 85 of file xtensa.c.

◆ _XT_INS_FORMAT_RRI8

#define _XT_INS_FORMAT_RRI8 (   X,
  OPCODE,
  R,
  S,
  T,
  IMM8 
)
Value:
(XT_ISBE(X) ? (XT_NIBSWAP24(OPCODE) \
| (((T) & 0x0F) << 16) \
| (((S) & 0x0F) << 12) \
| (((R) & 0x0F) << 8) \
| ((IMM8) & 0xFF)) << 8 \
: (OPCODE) \
| (((IMM8) & 0xFF) << 16) \
| (((R) & 0x0F) << 12) \
| (((S) & 0x0F) << 8) \
| (((T) & 0x0F) << 4))

Definition at line 73 of file xtensa.c.

◆ _XT_INS_FORMAT_RRR

#define _XT_INS_FORMAT_RRR (   X,
  OPCODE,
  ST,
 
)
Value:
(XT_ISBE(X) ? (XT_NIBSWAP24(OPCODE) \
| ((XT_NIBSWAP8((ST) & 0xFF)) << 12) \
| (((R) & 0x0F) << 8)) << 8 \
: (OPCODE) \
| (((ST) & 0xFF) << 4) \
| (((R) & 0x0F) << 12))
#define XT_NIBSWAP8(V)
Definition: xtensa.c:25

Definition at line 55 of file xtensa.c.

◆ _XT_INS_FORMAT_RRRN

#define _XT_INS_FORMAT_RRRN (   X,
  OPCODE,
  S,
  T,
  IMM4 
)
Value:
(XT_ISBE(X) ? (XT_NIBSWAP16(OPCODE) \
| (((T) & 0x0F) << 8) \
| (((S) & 0x0F) << 4) \
| ((IMM4) & 0x0F)) << 16 \
: (OPCODE) \
| (((T) & 0x0F) << 4) \
| (((S) & 0x0F) << 8) \
| (((IMM4) & 0x0F) << 12))
#define XT_NIBSWAP16(V)
Definition: xtensa.c:29

Definition at line 63 of file xtensa.c.

◆ _XT_INS_FORMAT_RSR

#define _XT_INS_FORMAT_RSR (   X,
  OPCODE,
  SR,
 
)
Value:
(XT_ISBE(X) ? (XT_NIBSWAP24(OPCODE) \
| (((T) & 0x0F) << 16) \
| (((SR) & 0xFF) << 8)) << 8 \
: (OPCODE) \
| (((SR) & 0xFF) << 8) \
| (((T) & 0x0F) << 4))

Definition at line 47 of file xtensa.c.

◆ XT_EPC_REG_NUM_BASE

#define XT_EPC_REG_NUM_BASE   (0xb0U) /* (EPC1 - 1), for adding DBGLEVEL */

Definition at line 181 of file xtensa.c.

◆ XT_EPS_REG_NUM_BASE

#define XT_EPS_REG_NUM_BASE   (0xc0U) /* (EPS2 - 2), for adding DBGLEVEL */

Definition at line 180 of file xtensa.c.

◆ XT_HW_DBREAK_MAX_NUM

#define XT_HW_DBREAK_MAX_NUM   2

Definition at line 188 of file xtensa.c.

◆ XT_HW_IBREAK_MAX_NUM

#define XT_HW_IBREAK_MAX_NUM   2

Definition at line 187 of file xtensa.c.

◆ XT_INS_CALL0

#define XT_INS_CALL0 (   X,
  IMM18 
)    (XT_ISBE(X) ? (0x500000 | ((IMM18) & 0x3ffff)) : (0x000005 | (((IMM18) & 0x3ffff) << 6)))

Definition at line 131 of file xtensa.c.

◆ XT_INS_DHWB

#define XT_INS_DHWB (   X,
  S,
  IMM8 
)    _XT_INS_FORMAT_RRI8(X, 0x007042, 0, S, 0, IMM8)

Definition at line 126 of file xtensa.c.

◆ XT_INS_DHWBI

#define XT_INS_DHWBI (   X,
  S,
  IMM8 
)    _XT_INS_FORMAT_RRI8(X, 0x007052, 0, S, 0, IMM8)

Definition at line 125 of file xtensa.c.

◆ XT_INS_IHI

#define XT_INS_IHI (   X,
  S,
  IMM8 
)    _XT_INS_FORMAT_RRI8(X, 0x0070E2, 0, S, 0, IMM8)

Definition at line 124 of file xtensa.c.

◆ XT_INS_ISYNC

#define XT_INS_ISYNC (   X)    (XT_ISBE(X) ? 0x000200 << 8 : 0x002000)

Definition at line 127 of file xtensa.c.

◆ XT_INS_JX

#define XT_INS_JX (   X,
 
)    (XT_ISBE(X) ? (0x050000 | ((S) << 12)) : (0x0000a0 | ((S) << 8)))

Definition at line 130 of file xtensa.c.

◆ XT_INS_L16UI

#define XT_INS_L16UI (   X,
  S,
  T,
  IMM8 
)    _XT_INS_FORMAT_RRI8(X, 0x001002, 0, S, T, IMM8)

Definition at line 112 of file xtensa.c.

◆ XT_INS_L32E

#define XT_INS_L32E (   X,
  R,
  S,
 
)    _XT_INS_FORMAT_RRI4(X, 0x090000, 0, R, S, T)

Definition at line 153 of file xtensa.c.

◆ XT_INS_L32E_S32E_MASK

#define XT_INS_L32E_S32E_MASK (   X)    (XT_ISBE(X) ? 0xF000FF << 8 : 0xFF000F)

Definition at line 155 of file xtensa.c.

◆ XT_INS_L32I

#define XT_INS_L32I (   X,
  S,
  T,
  IMM8 
)    _XT_INS_FORMAT_RRI8(X, 0x002002, 0, S, T, IMM8)

Definition at line 110 of file xtensa.c.

◆ XT_INS_L8UI

#define XT_INS_L8UI (   X,
  S,
  T,
  IMM8 
)    _XT_INS_FORMAT_RRI8(X, 0x000002, 0, S, T, IMM8)

Definition at line 114 of file xtensa.c.

◆ XT_INS_LDDR32P

#define XT_INS_LDDR32P (   X,
 
)    (XT_ISBE(X) ? (0x0E0700 | ((S) << 12)) << 8 : (0x0070E0 | ((S) << 8)))

Definition at line 105 of file xtensa.c.

◆ XT_INS_PPTLB

#define XT_INS_PPTLB (   X,
  S,
 
)    _XT_INS_FORMAT_RRR(X, 0x500000, ((S) << 4) | (T), 0xD)

Definition at line 162 of file xtensa.c.

◆ XT_INS_RFDD

#define XT_INS_RFDD (   X)    (XT_ISBE(X) ? 0x010e1f << 8 : 0xf1e010)

Definition at line 102 of file xtensa.c.

◆ XT_INS_RFDO

#define XT_INS_RFDO (   X)    (XT_ISBE(X) ? 0x000e1f << 8 : 0xf1e000)

Definition at line 100 of file xtensa.c.

◆ XT_INS_RFR

#define XT_INS_RFR (   X,
  FR,
 
)    _XT_INS_FORMAT_RRR(X, 0xFA0000, ((FR << 4) | 0x4), T)

Definition at line 149 of file xtensa.c.

◆ XT_INS_RFWO

#define XT_INS_RFWO (   X)    (XT_ISBE(X) ? 0x004300 << 8 : 0x003400)

Definition at line 157 of file xtensa.c.

◆ XT_INS_RFWO_RFWU_MASK

#define XT_INS_RFWO_RFWU_MASK (   X)    (XT_ISBE(X) ? 0xFFFFFF << 8 : 0xFFFFFF)

Definition at line 159 of file xtensa.c.

◆ XT_INS_RFWU

#define XT_INS_RFWU (   X)    (XT_ISBE(X) ? 0x005300 << 8 : 0x003500)

Definition at line 158 of file xtensa.c.

◆ XT_INS_ROTW

#define XT_INS_ROTW (   X,
 
)    (XT_ISBE(X) ? ((0x000804) | (((N) & 15) << 16)) << 8 : ((0x408000) | (((N) & 15) << 4)))

Definition at line 141 of file xtensa.c.

◆ XT_INS_RSR

#define XT_INS_RSR (   X,
  SR,
 
)    _XT_INS_FORMAT_RSR(X, 0x030000, SR, T)

Definition at line 134 of file xtensa.c.

◆ XT_INS_RUR

#define XT_INS_RUR (   X,
  UR,
 
)    _XT_INS_FORMAT_RRR(X, 0xE30000, UR, T)

Definition at line 144 of file xtensa.c.

◆ XT_INS_S16I

#define XT_INS_S16I (   X,
  S,
  T,
  IMM8 
)    _XT_INS_FORMAT_RRI8(X, 0x005002, 0, S, T, IMM8)

Definition at line 119 of file xtensa.c.

◆ XT_INS_S32E

#define XT_INS_S32E (   X,
  R,
  S,
 
)    _XT_INS_FORMAT_RRI4(X, 0x490000, 0, R, S, T)

Definition at line 154 of file xtensa.c.

◆ XT_INS_S32I

#define XT_INS_S32I (   X,
  S,
  T,
  IMM8 
)    _XT_INS_FORMAT_RRI8(X, 0x006002, 0, S, T, IMM8)

Definition at line 117 of file xtensa.c.

◆ XT_INS_S8I

#define XT_INS_S8I (   X,
  S,
  T,
  IMM8 
)    _XT_INS_FORMAT_RRI8(X, 0x004002, 0, S, T, IMM8)

Definition at line 121 of file xtensa.c.

◆ XT_INS_SDDR32P

#define XT_INS_SDDR32P (   X,
 
)    (XT_ISBE(X) ? (0x0F0700 | ((S) << 12)) << 8 : (0x0070F0 | ((S) << 8)))

Definition at line 107 of file xtensa.c.

◆ XT_INS_WFR

#define XT_INS_WFR (   X,
  FR,
 
)    _XT_INS_FORMAT_RRR(X, 0xFA0000, ((T << 4) | 0x5), FR)

Definition at line 151 of file xtensa.c.

◆ XT_INS_WSR

#define XT_INS_WSR (   X,
  SR,
 
)    _XT_INS_FORMAT_RSR(X, 0x130000, SR, T)

Definition at line 136 of file xtensa.c.

◆ XT_INS_WUR

#define XT_INS_WUR (   X,
  UR,
 
)    _XT_INS_FORMAT_RSR(X, 0xF30000, UR, T)

Definition at line 146 of file xtensa.c.

◆ XT_INS_XSR

#define XT_INS_XSR (   X,
  SR,
 
)    _XT_INS_FORMAT_RSR(X, 0x610000, SR, T)

Definition at line 138 of file xtensa.c.

◆ XT_NIBSWAP16

#define XT_NIBSWAP16 (   V)
Value:
((((V) & 0x000F) << 12) \
| (((V) & 0x00F0) << 4) \
| (((V) & 0x0F00) >> 4) \
| (((V) & 0xF000) >> 12))

Definition at line 29 of file xtensa.c.

◆ XT_NIBSWAP24

#define XT_NIBSWAP24 (   V)
Value:
((((V) & 0x00000F) << 20) \
| (((V) & 0x0000F0) << 12) \
| (((V) & 0x000F00) << 4) \
| (((V) & 0x00F000) >> 4) \
| (((V) & 0x0F0000) >> 12) \
| (((V) & 0xF00000) >> 20))

Definition at line 35 of file xtensa.c.

◆ XT_NIBSWAP8

#define XT_NIBSWAP8 (   V)
Value:
((((V) & 0x0F) << 4) \
| (((V) & 0xF0) >> 4))

Definition at line 25 of file xtensa.c.

◆ XT_NX_IBREAKC_BASE

#define XT_NX_IBREAKC_BASE   (0xc0U) /* (IBREAKC0..IBREAKC1) for NX */

Definition at line 184 of file xtensa.c.

◆ XT_PC_DBREG_NUM_BASE

#define XT_PC_DBREG_NUM_BASE   (0x20U) /* External (i.e., GDB) access */

Definition at line 183 of file xtensa.c.

◆ XT_PC_REG_NUM_VIRTUAL

#define XT_PC_REG_NUM_VIRTUAL   (0xffU) /* Marker for computing PC (EPC[DBGLEVEL) */

Definition at line 182 of file xtensa.c.

◆ XT_PS_REG_NUM

#define XT_PS_REG_NUM   (0xe6U)

Definition at line 179 of file xtensa.c.

◆ XT_REG_A0

#define XT_REG_A0   (xtensa_regs[XT_REG_IDX_AR0].reg_num)

Definition at line 175 of file xtensa.c.

◆ XT_REG_A3

#define XT_REG_A3   (xtensa_regs[XT_REG_IDX_AR3].reg_num)

Definition at line 176 of file xtensa.c.

◆ XT_REG_A4

#define XT_REG_A4   (xtensa_regs[XT_REG_IDX_AR4].reg_num)

Definition at line 177 of file xtensa.c.

◆ XT_SR_DDR

#define XT_SR_DDR   (xtensa_regs[XT_REG_IDX_DDR].reg_num)

Definition at line 172 of file xtensa.c.

◆ XT_SR_PS

#define XT_SR_PS   (xtensa_regs[XT_REG_IDX_PS].reg_num)

Definition at line 173 of file xtensa.c.

◆ XT_SR_WB

#define XT_SR_WB   (xtensa_regs[XT_REG_IDX_WINDOWBASE].reg_num)

Definition at line 174 of file xtensa.c.

◆ XT_SW_BREAKPOINTS_MAX_NUM

#define XT_SW_BREAKPOINTS_MAX_NUM   32

Definition at line 186 of file xtensa.c.

◆ XT_TLB1_ACC_MSK

#define XT_TLB1_ACC_MSK   0xF

Definition at line 165 of file xtensa.c.

◆ XT_TLB1_ACC_SHIFT

#define XT_TLB1_ACC_SHIFT   8

Definition at line 164 of file xtensa.c.

◆ XT_WATCHPOINTS_NUM_MAX

#define XT_WATCHPOINTS_NUM_MAX   2

Definition at line 167 of file xtensa.c.

Enumeration Type Documentation

◆ xtensa_mem_region_type

Types of memory used at xtensa target.

Enumerator
XTENSA_MEM_REG_IROM 
XTENSA_MEM_REG_IRAM 
XTENSA_MEM_REG_DROM 
XTENSA_MEM_REG_DRAM 
XTENSA_MEM_REG_SRAM 
XTENSA_MEM_REG_SROM 
XTENSA_MEM_REGS_NUM 

Definition at line 297 of file xtensa.c.

◆ xtensa_mpu_access_type

Types of access rights for MPU option The first block is kernel RWX ARs; the second block is user rwx ARs.

Enumerator
XTENSA_ACC_00X_000 
XTENSA_ACC_000_00X 
XTENSA_ACC_R00_000 
XTENSA_ACC_R0X_000 
XTENSA_ACC_RW0_000 
XTENSA_ACC_RWX_000 
XTENSA_ACC_0W0_0W0 
XTENSA_ACC_RW0_RWX 
XTENSA_ACC_RW0_R00 
XTENSA_ACC_RWX_R0X 
XTENSA_ACC_R00_R00 
XTENSA_ACC_R0X_R0X 
XTENSA_ACC_RW0_RW0 
XTENSA_ACC_RWX_RWX 

Definition at line 311 of file xtensa.c.

Function Documentation

◆ COMMAND_HANDLER() [1/17]

COMMAND_HANDLER ( xtensa_cmd_dm_rw  )

Definition at line 4299 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [2/17]

COMMAND_HANDLER ( xtensa_cmd_exe  )

Definition at line 3593 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, and get_current_target().

◆ COMMAND_HANDLER() [3/17]

COMMAND_HANDLER ( xtensa_cmd_mask_interrupts  )

Definition at line 4213 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [4/17]

COMMAND_HANDLER ( xtensa_cmd_perfmon_dump  )

Definition at line 4171 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [5/17]

COMMAND_HANDLER ( xtensa_cmd_perfmon_enable  )

Definition at line 4131 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [6/17]

COMMAND_HANDLER ( xtensa_cmd_permissive_mode  )

Definition at line 4071 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [7/17]

COMMAND_HANDLER ( xtensa_cmd_smpbreak  )

Definition at line 4267 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, and get_current_target().

◆ COMMAND_HANDLER() [8/17]

COMMAND_HANDLER ( xtensa_cmd_tracedump  )

◆ COMMAND_HANDLER() [9/17]

COMMAND_HANDLER ( xtensa_cmd_tracestart  )

Definition at line 4356 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [10/17]

COMMAND_HANDLER ( xtensa_cmd_tracestop  )

Definition at line 4384 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [11/17]

COMMAND_HANDLER ( xtensa_cmd_xtdef  )

Definition at line 3616 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [12/17]

COMMAND_HANDLER ( xtensa_cmd_xtmem  )

Definition at line 3795 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [13/17]

COMMAND_HANDLER ( xtensa_cmd_xtmmu  )

Definition at line 3862 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [14/17]

COMMAND_HANDLER ( xtensa_cmd_xtmpu  )

Definition at line 3834 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [15/17]

COMMAND_HANDLER ( xtensa_cmd_xtopt  )

Definition at line 3724 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [16/17]

COMMAND_HANDLER ( xtensa_cmd_xtreg  )

Definition at line 4028 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HANDLER() [17/17]

COMMAND_HANDLER ( xtensa_cmd_xtregfmt  )

Definition at line 4059 of file xtensa.c.

References CALL_COMMAND_HANDLER, CMD_CTX, get_current_target(), and target_to_xtensa().

◆ COMMAND_HELPER() [1/17]

COMMAND_HELPER ( xtensa_cmd_dm_rw_do  ,
struct xtensa xtensa 
)

◆ COMMAND_HELPER() [2/17]

◆ COMMAND_HELPER() [3/17]

COMMAND_HELPER ( xtensa_cmd_mask_interrupts_do  ,
struct xtensa xtensa 
)

◆ COMMAND_HELPER() [4/17]

◆ COMMAND_HELPER() [5/17]

◆ COMMAND_HELPER() [6/17]

COMMAND_HELPER ( xtensa_cmd_permissive_mode_do  ,
struct xtensa xtensa 
)

Definition at line 4065 of file xtensa.c.

References CALL_COMMAND_HANDLER, and xtensa::permissive_mode.

◆ COMMAND_HELPER() [7/17]

COMMAND_HELPER ( xtensa_cmd_smpbreak_do  ,
struct target target 
)

◆ COMMAND_HELPER() [8/17]

◆ COMMAND_HELPER() [9/17]

◆ COMMAND_HELPER() [10/17]

COMMAND_HELPER ( xtensa_cmd_tracestop_do  ,
struct xtensa xtensa 
)

◆ COMMAND_HELPER() [11/17]

COMMAND_HELPER ( xtensa_cmd_xtdef_do  ,
struct xtensa xtensa 
)

◆ COMMAND_HELPER() [12/17]

◆ COMMAND_HELPER() [13/17]

◆ COMMAND_HELPER() [14/17]

◆ COMMAND_HELPER() [15/17]

◆ COMMAND_HELPER() [16/17]

◆ COMMAND_HELPER() [17/17]

COMMAND_HELPER ( xtensa_cmd_xtregfmt_do  ,
struct xtensa xtensa 
)

◆ xtensa_assert_reset()

◆ xtensa_breakpoint_add()

◆ xtensa_breakpoint_remove()

◆ xtensa_build_reg_cache()

◆ xtensa_canonical_to_windowbase_offset()

◆ xtensa_cause_clear()

◆ xtensa_cause_get()

◆ xtensa_cause_reset()

void xtensa_cause_reset ( struct target target)

Definition at line 1154 of file xtensa.c.

References xtensa::nx_stop_cause, and target_to_xtensa().

Referenced by xtensa_do_resume().

◆ xtensa_checksum_memory()

int xtensa_checksum_memory ( struct target target,
target_addr_t  address,
uint32_t  count,
uint32_t *  checksum 
)

Definition at line 2298 of file xtensa.c.

References ERROR_FAIL, and LOG_WARNING.

◆ xtensa_cmd_xtopt_legal_val()

static bool xtensa_cmd_xtopt_legal_val ( char *  opt,
int  val,
int  min,
int  max 
)
inlinestatic

Definition at line 3622 of file xtensa.c.

References LOG_ERROR.

Referenced by COMMAND_HELPER().

◆ xtensa_core_reg_get()

static int xtensa_core_reg_get ( struct reg reg)
static

◆ xtensa_core_reg_set()

static int xtensa_core_reg_set ( struct reg reg,
uint8_t *  buf 
)
static

Definition at line 450 of file xtensa.c.

◆ xtensa_core_status_check()

◆ xtensa_deassert_reset()

◆ xtensa_do_resume()

◆ xtensa_do_step()

◆ xtensa_examine()

◆ xtensa_fetch_all_regs()

int xtensa_fetch_all_regs ( struct target target)

Definition at line 1210 of file xtensa.c.

References a0, a3, xtensa_reg_val_u::buf, buf_cpy(), buf_get_u32(), xtensa_keyval_info::chrval, xtensa_config::coproc, xtensa::core_cache, xtensa::core_config, xtensa_config::core_type, xtensa::dbg_mod, xtensa_config::debug, reg::dirty, ERROR_FAIL, ERROR_OK, xtensa_reg_desc::exist, xtensa_reg_desc::flags, xtensa_keyval_info::intval, xtensa_debug_config::irq_level, LOG_DEBUG, LOG_ERROR, LOG_INFO, LOG_LEVEL_IS, LOG_LVL_DEBUG, LOG_TARGET_DEBUG, LOG_TARGET_ERROR, name, reg_cache::num_regs, xtensa::nx_reg_idx, OCDDSR_EXECEXCEPTION, xtensa::optregs, reg_cache::reg_list, xtensa_reg_desc::reg_num, xtensa::regs_fetched, xtensa::scratch_ars, size, target_to_xtensa(), type, xtensa_reg_desc::type, reg::valid, xtensa_config::windowed, XDMREG_DDR, XDMREG_DSR, XT_AR_SCRATCH_AR3, XT_AR_SCRATCH_AR4, XT_AR_SCRATCH_NUM, XT_AREGS_NUM_MAX, XT_EPC_REG_NUM_BASE, XT_EPS_REG_NUM_BASE, XT_INS_CALL0, XT_INS_RFR, XT_INS_ROTW, XT_INS_RSR, XT_INS_RUR, XT_INS_WSR, XT_LX, XT_MS_DISPST_DBG, XT_NUM_REGS, XT_NX, XT_NX_REG_IDX_MS, XT_NX_REG_IDX_WB, XT_PC_REG_NUM_VIRTUAL, XT_REG_A0, XT_REG_A3, XT_REG_DEBUG, XT_REG_FR, XT_REG_GENERAL, XT_REG_IDX_A0, XT_REG_IDX_A3, XT_REG_IDX_A4, XT_REG_IDX_AR0, XT_REG_IDX_CPENABLE, XT_REG_IDX_PS, XT_REG_IDX_WINDOWBASE, XT_REG_OTHER, XT_REG_RELGEN, XT_REG_SPECIAL, XT_REG_TIE, XT_REG_USER, XT_REGF_MASK, XT_REGF_NOREAD, XT_SR_DDR, XT_WB_P_MSK, XT_WB_P_SHIFT, xtensa_canonical_to_windowbase_offset(), xtensa_core_status_check(), xtensa_dm_queue_execute(), xtensa_extra_debug_log, xtensa_mark_register_dirty(), xtensa_queue_dbg_reg_read(), xtensa_queue_dbg_reg_write(), xtensa_queue_exec_ins(), xtensa_reg_is_readable(), xtensa_reg_set(), xtensa_regs, xtensa_window_state_restore(), xtensa_window_state_save(), and xtensa_windowbase_offset_to_canonical().

Referenced by COMMAND_HELPER(), xtensa_do_step(), and xtensa_poll().

◆ xtensa_free_reg_cache()

◆ xtensa_gdb_query_custom()

◆ xtensa_gdbqc_parse_exec_tie_ops()

static int32_t xtensa_gdbqc_parse_exec_tie_ops ( struct target target,
char *  opstr 
)
static

◆ xtensa_gdbqc_qxtreg()

◆ xtensa_get_gdb_arch()

const char* xtensa_get_gdb_arch ( const struct target target)

Definition at line 3518 of file xtensa.c.

◆ xtensa_get_gdb_reg_list()

◆ xtensa_get_mem_config()

◆ xtensa_get_overlap_size()

static target_addr_t xtensa_get_overlap_size ( target_addr_t  r1_start,
target_addr_t  r1_end,
target_addr_t  r2_start,
target_addr_t  r2_end 
)
inlinestatic

Returns a size of overlapped region of two ranges.

Definition at line 1962 of file xtensa.c.

References xtensa_memory_regions_overlap().

Referenced by xtensa_memory_op_validate_range().

◆ xtensa_halt()

◆ xtensa_imprecise_exception_clear()

◆ xtensa_imprecise_exception_occurred()

static int xtensa_imprecise_exception_occurred ( struct target target)
static

◆ xtensa_init_arch_info()

◆ xtensa_is_cacheable()

static bool xtensa_is_cacheable ( const struct xtensa_cache_config cache,
const struct xtensa_local_mem_config mem,
target_addr_t  address 
)
inlinestatic

Definition at line 406 of file xtensa.c.

References xtensa_cache_config::size, and xtensa_memory_region_find().

Referenced by xtensa_is_dcacheable(), and xtensa_is_icacheable().

◆ xtensa_is_dcacheable()

static bool xtensa_is_dcacheable ( struct xtensa xtensa,
target_addr_t  address 
)
inlinestatic

◆ xtensa_is_icacheable()

static bool xtensa_is_icacheable ( struct xtensa xtensa,
target_addr_t  address 
)
inlinestatic

◆ xtensa_is_stopped()

static bool xtensa_is_stopped ( struct target target)
inlinestatic

◆ xtensa_mark_register_dirty()

static void xtensa_mark_register_dirty ( struct xtensa xtensa,
enum xtensa_reg_id  reg_idx 
)
static

◆ xtensa_memory_op_validate_range()

static bool xtensa_memory_op_validate_range ( struct xtensa xtensa,
target_addr_t  address,
size_t  size,
int  access 
)
static

◆ xtensa_memory_region_find()

static const struct xtensa_local_mem_region_config* xtensa_memory_region_find ( const struct xtensa_local_mem_config mem,
target_addr_t  address 
)
inlinestatic

◆ xtensa_memory_regions_overlap()

static bool xtensa_memory_regions_overlap ( target_addr_t  r1_start,
target_addr_t  r1_end,
target_addr_t  r2_start,
target_addr_t  r2_end 
)
inlinestatic

Returns true if two ranges are overlapping.

Definition at line 1947 of file xtensa.c.

Referenced by xtensa_get_overlap_size().

◆ xtensa_mmu_is_enabled()

int xtensa_mmu_is_enabled ( struct target target,
int *  enabled 
)

◆ xtensa_pc_in_winexc()

static bool xtensa_pc_in_winexc ( struct target target,
target_addr_t  pc 
)
static

◆ xtensa_poll()

int xtensa_poll ( struct target target)

Definition at line 2304 of file xtensa.c.

References xtensa::come_online_probes_num, xtensa::core_config, xtensa_debug_module::core_status, xtensa_config::core_type, xtensa::dbg_mod, DBG_REASON_BREAKPOINT, DBG_REASON_DBGRQ, DBG_REASON_NOTHALTED, DBG_REASON_SINGLESTEP, DBG_REASON_WATCHPOINT, DBG_REASON_WPTANDBKPT, target::debug_reason, DEBUGCAUSE_BI, DEBUGCAUSE_BN, DEBUGCAUSE_DB, DEBUGCAUSE_IB, DEBUGCAUSE_IC, xtensa_core_status::dsr, ERROR_OK, ERROR_TARGET_NOT_EXAMINED, target::examined, LOG_INFO, LOG_TARGET_DEBUG, LOG_TARGET_ERROR, LOG_TARGET_INFO, OCDDSR_DEBUGINTBREAK, OCDDSR_DEBUGINTHOST, OCDDSR_DEBUGINTTRAX, OCDDSR_DEBUGPENDBREAK, OCDDSR_DEBUGPENDHOST, OCDDSR_DEBUGPENDTRAX, OCDDSR_STOPPED, xtensa_debug_module::power_status, PWRSTAT_COREWASRESET, PWRSTAT_DEBUGWASRESET, xtensa::smp_break, xtensa_power_status::stat, target::state, xtensa_power_status::stath, TARGET_DEBUG_RUNNING, TARGET_HALTED, TARGET_RESET, TARGET_RUNNING, target_to_xtensa(), TARGET_UNKNOWN, xtensa::trace_active, TRAXSTAT_CTITG, TRAXSTAT_PCMTG, TRAXSTAT_PTITG, TRAXSTAT_TRACT, XDMREG_DDR, XT_INS_RSR, XT_INS_WSR, XT_NX, XT_PS_DIEXC_MSK, XT_REG_A3, XT_REG_IDX_EXCCAUSE, XT_REG_IDX_PC, XT_REG_IDX_PS, XT_SR_DDR, XT_SR_PS, xtensa_cause_get(), xtensa_core_status_check(), xtensa_dm_core_status_clear(), xtensa_dm_core_status_read(), xtensa_dm_core_was_reset(), xtensa_dm_is_powered(), xtensa_dm_poll(), xtensa_dm_power_status_cache(), xtensa_dm_power_status_read(), xtensa_dm_queue_execute(), xtensa_dm_tap_was_reset(), xtensa_dm_trace_status_read(), xtensa_fetch_all_regs(), xtensa_is_stopped(), xtensa_mark_register_dirty(), xtensa_queue_dbg_reg_write(), xtensa_queue_exec_ins(), xtensa_reg_get(), xtensa_smpbreak_write(), and xtensa_wakeup().

Referenced by esp32_soc_reset(), esp32s2_soc_reset(), esp32s3_soc_reset(), esp_xtensa_poll(), and xtensa_chip_poll().

◆ xtensa_prepare_resume()

◆ xtensa_queue_exec_ins()

◆ xtensa_queue_exec_ins_wide()

static void xtensa_queue_exec_ins_wide ( struct xtensa xtensa,
uint8_t *  ops,
uint8_t  oplen 
)
static

◆ xtensa_queue_pwr_reg_write()

static int xtensa_queue_pwr_reg_write ( struct xtensa xtensa,
unsigned int  reg,
uint32_t  data 
)
static

◆ xtensa_read_buffer()

int xtensa_read_buffer ( struct target target,
target_addr_t  address,
uint32_t  count,
uint8_t *  buffer 
)

Definition at line 2081 of file xtensa.c.

References buffer, count, and xtensa_read_memory().

Referenced by xtensa_pc_in_winexc().

◆ xtensa_read_memory()

◆ xtensa_reg_get()

◆ xtensa_reg_get_value()

static xtensa_reg_val_t xtensa_reg_get_value ( struct reg reg)
inlinestatic

Definition at line 975 of file xtensa.c.

References buf_get_u32(), and reg::value.

Referenced by xtensa_get_gdb_reg_list(), xtensa_reg_get(), xtensa_reg_set(), and xtensa_wait_algorithm().

◆ xtensa_reg_is_readable()

static bool xtensa_reg_is_readable ( int  flags,
int  cpenable 
)
static

Definition at line 641 of file xtensa.c.

References BIT, XT_REGF_COPROC0, and XT_REGF_NOREAD.

Referenced by xtensa_fetch_all_regs().

◆ xtensa_reg_set()

◆ xtensa_reg_set_deep_relgen()

◆ xtensa_reg_set_value()

static void xtensa_reg_set_value ( struct reg reg,
xtensa_reg_val_t  value 
)
inlinestatic

Definition at line 980 of file xtensa.c.

References buf_set_u32(), reg::dirty, and reg::value.

Referenced by xtensa_reg_set(), and xtensa_start_algorithm().

◆ xtensa_region_ar_exec()

◆ xtensa_resume()

int xtensa_resume ( struct target target,
int  current,
target_addr_t  address,
int  handle_breakpoints,
int  debug_execution 
)

◆ xtensa_run_algorithm()

int xtensa_run_algorithm ( struct target target,
int  num_mem_params,
struct mem_param mem_params,
int  num_reg_params,
struct reg_param reg_params,
target_addr_t  entry_point,
target_addr_t  exit_point,
unsigned int  timeout_ms,
void *  arch_info 
)

Definition at line 2911 of file xtensa.c.

References reg::arch_info, ERROR_OK, xtensa_start_algorithm(), and xtensa_wait_algorithm().

◆ xtensa_scratch_regs_fixup()

static bool xtensa_scratch_regs_fixup ( struct xtensa xtensa,
struct reg reg_list,
int  i,
int  j,
int  a_idx,
int  ar_idx 
)
static

◆ xtensa_set_permissive_mode()

void xtensa_set_permissive_mode ( struct target target,
bool  state 
)

Definition at line 3414 of file xtensa.c.

References xtensa::permissive_mode, state, and target_to_xtensa().

◆ xtensa_smpbreak_get()

int xtensa_smpbreak_get ( struct target target,
uint32_t *  val 
)

Definition at line 968 of file xtensa.c.

References ERROR_OK, xtensa::smp_break, and target_to_xtensa().

Referenced by esp_xtensa_smp_resume(), and esp_xtensa_smp_smpbreak_disable().

◆ xtensa_smpbreak_read()

int xtensa_smpbreak_read ( struct xtensa xtensa,
uint32_t *  val 
)

◆ xtensa_smpbreak_set()

int xtensa_smpbreak_set ( struct target target,
uint32_t  set 
)

◆ xtensa_smpbreak_write()

◆ xtensa_soft_reset_halt()

int xtensa_soft_reset_halt ( struct target target)

Definition at line 1204 of file xtensa.c.

References LOG_TARGET_DEBUG, and xtensa_assert_reset().

Referenced by esp32s2_soft_reset_halt().

◆ xtensa_start_algorithm()

◆ xtensa_step()

int xtensa_step ( struct target target,
int  current,
target_addr_t  address,
int  handle_breakpoints 
)

◆ xtensa_sw_breakpoint_add()

◆ xtensa_sw_breakpoint_remove()

static int xtensa_sw_breakpoint_remove ( struct target target,
struct xtensa_sw_breakpoint sw_bp 
)
static

◆ xtensa_target_deinit()

◆ xtensa_target_init()

◆ xtensa_target_memory_region_find()

static const struct xtensa_local_mem_region_config* xtensa_target_memory_region_find ( struct xtensa xtensa,
target_addr_t  address 
)
inlinestatic

Returns a corresponding xtensa_local_mem_region_config from the xtensa target for a given address Returns NULL if nothing found.

Definition at line 391 of file xtensa.c.

References NULL, xtensa_get_mem_config(), XTENSA_MEM_REGS_NUM, and xtensa_memory_region_find().

Referenced by xtensa_memory_op_validate_range().

◆ xtensa_update_instruction()

◆ xtensa_wait_algorithm()

◆ xtensa_wakeup()

◆ xtensa_watchpoint_add()

◆ xtensa_watchpoint_remove()

◆ xtensa_window_state_restore()

◆ xtensa_window_state_save()

◆ xtensa_windowbase_offset_to_canonical()

static enum xtensa_reg_id xtensa_windowbase_offset_to_canonical ( struct xtensa xtensa,
enum xtensa_reg_id  reg_idx,
int  windowbase 
)
static

◆ xtensa_write_buffer()

int xtensa_write_buffer ( struct target target,
target_addr_t  address,
uint32_t  count,
const uint8_t *  buffer 
)

Definition at line 2292 of file xtensa.c.

References buffer, count, and xtensa_write_memory().

◆ xtensa_write_dirty_registers()

static int xtensa_write_dirty_registers ( struct target target)
static

◆ xtensa_write_memory()

Variable Documentation

◆ xt_qerr

const struct xtensa_keyval_info xt_qerr[XT_QERR_NUM]
static
Initial value:
= {
{ .chrval = "E00", .intval = ERROR_FAIL },
{ .chrval = "E01", .intval = ERROR_FAIL },
{ .chrval = "E02", .intval = ERROR_COMMAND_ARGUMENT_INVALID },
{ .chrval = "E03", .intval = ERROR_FAIL },
}
#define ERROR_COMMAND_ARGUMENT_INVALID
Definition: command.h:404
#define ERROR_FAIL
Definition: log.h:170

Definition at line 1 of file xtensa.c.

Referenced by xtensa_gdb_query_custom(), and xtensa_gdbqc_qxtreg().

◆ xtensa_any_command_handlers

const struct command_registration xtensa_any_command_handlers[]
static

Definition at line 4472 of file xtensa.c.

◆ xtensa_command_handlers

const struct command_registration xtensa_command_handlers[]
Initial value:
= {
{
.name = "xtensa",
.mode = COMMAND_ANY,
.help = "Xtensa command group",
.usage = "",
},
}
#define COMMAND_REGISTRATION_DONE
Use this as the last entry in an array of command_registration records.
Definition: command.h:253
@ COMMAND_ANY
Definition: command.h:42
static const struct command_registration xtensa_any_command_handlers[]
Definition: xtensa.c:4483

Definition at line 4472 of file xtensa.c.

◆ xtensa_extra_debug_log

const bool xtensa_extra_debug_log
static

◆ xtensa_reg_type

const struct reg_arch_type xtensa_reg_type
static
Initial value:
= {
}
static int xtensa_core_reg_set(struct reg *reg, uint8_t *buf)
Definition: xtensa.c:450
static int xtensa_core_reg_get(struct reg *reg)
Definition: xtensa.c:431

Definition at line 450 of file xtensa.c.

Referenced by xtensa_build_reg_cache().

◆ xtensa_regs