OpenOCD
xtensa.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Generic Xtensa target *
5  * Copyright (C) 2020-2022 Cadence Design Systems, Inc. *
6  * Copyright (C) 2019 Espressif Systems Ltd. *
7  ***************************************************************************/
8 
9 #ifndef OPENOCD_TARGET_XTENSA_H
10 #define OPENOCD_TARGET_XTENSA_H
11 
12 #include "assert.h"
13 #include <target/target.h>
14 #include <target/breakpoints.h>
15 #include "xtensa_regs.h"
16 #include "xtensa_debug_module.h"
17 
23 /* Big-endian vs. little-endian detection */
24 #define XT_ISBE(X) ((X)->target->endianness == TARGET_BIG_ENDIAN)
25 
26 /* 24-bit break; BE version field-swapped then byte-swapped for use in memory R/W fns */
27 #define XT_INS_BREAK_LE(S, T) (0x004000 | (((S) & 0xF) << 8) | (((T) & 0xF) << 4))
28 #define XT_INS_BREAK_BE(S, T) (0x000400 | (((S) & 0xF) << 12) | ((T) & 0xF))
29 #define XT_INS_BREAK(X, S, T) (XT_ISBE(X) ? XT_INS_BREAK_BE(S, T) : XT_INS_BREAK_LE(S, T))
30 
31 /* 16-bit break; BE version field-swapped then byte-swapped for use in memory R/W fns */
32 #define XT_INS_BREAKN_LE(IMM4) (0xF02D | (((IMM4) & 0xF) << 8))
33 #define XT_INS_BREAKN_BE(IMM4) (0x0FD2 | (((IMM4) & 0xF) << 12))
34 #define XT_INS_BREAKN(X, IMM4) (XT_ISBE(X) ? XT_INS_BREAKN_BE(IMM4) : XT_INS_BREAKN_LE(IMM4))
35 
36 #define XT_ISNS_SZ_MAX 3
37 
38 /* PS register bits (LX) */
39 #define XT_PS_RING(_v_) ((uint32_t)((_v_) & 0x3) << 6)
40 #define XT_PS_RING_MSK (0x3 << 6)
41 #define XT_PS_RING_GET(_v_) (((_v_) >> 6) & 0x3)
42 #define XT_PS_CALLINC_MSK (0x3 << 16)
43 #define XT_PS_OWB_MSK (0xF << 8)
44 #define XT_PS_WOE_MSK BIT(18)
45 
46 /* PS register bits (NX) */
47 #define XT_PS_DIEXC_MSK BIT(2)
48 #define XT_PS_DI_MSK BIT(3)
49 
50 /* MS register bits (NX) */
51 #define XT_MS_DE_MSK BIT(5)
52 #define XT_MS_DISPST_MSK (0x1f)
53 #define XT_MS_DISPST_DBG (0x10)
54 
55 /* WB register bits (NX) */
56 #define XT_WB_P_SHIFT (0)
57 #define XT_WB_P_MSK (0x7U << XT_WB_P_SHIFT)
58 #define XT_WB_C_SHIFT (4)
59 #define XT_WB_C_MSK (0x7U << XT_WB_C_SHIFT)
60 #define XT_WB_N_SHIFT (8)
61 #define XT_WB_N_MSK (0x7U << XT_WB_N_SHIFT)
62 #define XT_WB_S_SHIFT (30)
63 #define XT_WB_S_MSK (0x3U << XT_WB_S_SHIFT)
64 
65 /* IBREAKC register bits (NX) */
66 #define XT_IBREAKC_FB (0x80000000)
67 
68 /* Definitions for imprecise exception registers (NX) */
69 #define XT_IMPR_EXC_MSK (0x00000013)
70 #define XT_MESRCLR_IMPR_EXC_MSK (0x00000090)
71 
72 #define XT_LOCAL_MEM_REGIONS_NUM_MAX 8
73 
74 #define XT_AREGS_NUM_MAX 64
75 #define XT_USER_REGS_NUM_MAX 256
76 
77 #define XT_MEM_ACCESS_NONE 0x0
78 #define XT_MEM_ACCESS_READ 0x1
79 #define XT_MEM_ACCESS_WRITE 0x2
80 
81 #define XT_MAX_TIE_REG_WIDTH (512) /* TIE register file max 4096 bits */
82 #define XT_QUERYPKT_RESP_MAX (XT_MAX_TIE_REG_WIDTH * 2 + 1)
83 
90 };
91 
92 /* An and ARn registers potentially used as scratch regs */
99 };
100 
102  char *chrval;
103  int intval;
104 };
105 
107  XT_UNDEF = 0,
110 };
111 
113  uint8_t way_count;
114  uint32_t line_size;
115  uint32_t size;
117 };
118 
121  uint32_t size;
122  int access;
123 };
124 
126  uint16_t count;
128 };
129 
131  bool enabled;
134 };
135 
137  bool enabled;
138  uint8_t nfgseg;
139  uint32_t minsegsize;
140  bool lockable;
141  bool execonly;
142 };
143 
145  bool enabled;
146  uint8_t irq_num;
147 };
148 
150  bool enabled;
151  uint8_t level_num;
152  uint8_t excm_level;
153 };
154 
156  bool enabled;
157  uint8_t irq_level;
158  uint8_t ibreaks_num;
159  uint8_t dbreaks_num;
160  uint8_t perfcount_num;
161 };
162 
164  bool enabled;
165  uint32_t mem_sz;
167 };
168 
170  enum xtensa_type core_type;
171  uint8_t aregs_num;
172  bool windowed;
173  bool coproc;
175  struct xtensa_irq_config irq;
177  struct xtensa_mmu_config mmu;
178  struct xtensa_mpu_config mpu;
179  struct xtensa_debug_config debug;
189 };
190 
191 typedef uint32_t xtensa_insn_t;
192 
194  XT_STEPPING_ISR_OFF, /* interrupts are disabled during stepping */
195  XT_STEPPING_ISR_ON, /* interrupts are enabled during stepping */
196 };
197 
202  XT_NX_REG_IDX_IEVEC, /* IEVEC, IEEXTERN, and MESR must be contiguous */
207 };
208 
209 /* Only supported in cores with in-CPU MMU. None of Espressif chips as of now. */
215  XT_MODE_ANY /* special value to run algorithm in current core mode */
216 };
217 
220  /* original insn */
222  /* original insn size */
223  uint8_t insn_sz; /* 2 or 3 bytes */
224 };
225 
231  enum xtensa_mode core_mode;
235 };
236 
237 #define XTENSA_COMMON_MAGIC 0x54E4E555U
238 
242 struct xtensa {
243  unsigned int common_magic;
248  unsigned int total_regs_num;
249  unsigned int core_regs_num;
251  unsigned int genpkt_regs_num;
254  /* Per-config Xtensa registers as specified via "xtreg" in xtensa-core*.cfg */
256  unsigned int num_optregs;
257  struct reg *empty_regs;
259  /* An array of pointers to buffers to backup registers' values while algo is run on target.
260  * Size is 'regs_num'. */
262  unsigned int eps_dbglevel_idx;
263  unsigned int dbregs_num;
264  struct target *target;
267  struct breakpoint **hw_brps;
268  struct watchpoint **hw_wps;
271  bool permissive_mode; /* bypass memory checks */
273  uint32_t smp_break;
274  uint32_t spill_loc;
275  unsigned int spill_bytes;
276  uint8_t *spill_buf;
278  /* Sometimes debug module's 'powered' bit is cleared after reset, but get set after some
279  * time.This is the number of polling periods after which core is considered to be powered
280  * off (marked as unexamined) if the bit retains to be cleared (e.g. if core is disabled by
281  * SW running on target).*/
285  uint32_t nx_stop_cause;
288  bool regs_fetched; /* true after first register fetch completed successfully */
289 };
290 
291 static inline struct xtensa *target_to_xtensa(struct target *target)
292 {
293  assert(target);
294  struct xtensa *xtensa = target->arch_info;
296  return xtensa;
297 }
298 
300  struct xtensa *xtensa,
301  const struct xtensa_debug_module_config *dm_cfg);
302 int xtensa_target_init(struct command_context *cmd_ctx, struct target *target);
303 void xtensa_target_deinit(struct target *target);
304 
305 static inline bool xtensa_addr_in_mem(const struct xtensa_local_mem_config *mem, uint32_t addr)
306 {
307  for (unsigned int i = 0; i < mem->count; i++) {
308  if (addr >= mem->regions[i].base &&
309  addr < mem->regions[i].base + mem->regions[i].size)
310  return true;
311  }
312  return false;
313 }
314 
315 static inline bool xtensa_data_addr_valid(struct target *target, uint32_t addr)
316 {
318 
320  return true;
322  return true;
324  return true;
325  return false;
326 }
327 
328 static inline int xtensa_queue_dbg_reg_read(struct xtensa *xtensa, enum xtensa_dm_reg reg, uint8_t *data)
329 {
330  struct xtensa_debug_module *dm = &xtensa->dbg_mod;
331 
332  if (!xtensa->core_config->trace.enabled &&
333  (reg <= XDMREG_MEMADDREND || (reg >= XDMREG_PMG && reg <= XDMREG_PMSTAT7))) {
334  LOG_ERROR("Can not access %u reg when Trace Port option disabled!", reg);
335  return ERROR_FAIL;
336  }
337  return dm->dbg_ops->queue_reg_read(dm, reg, data);
338 }
339 
340 static inline int xtensa_queue_dbg_reg_write(struct xtensa *xtensa, enum xtensa_dm_reg reg, uint32_t data)
341 {
342  struct xtensa_debug_module *dm = &xtensa->dbg_mod;
343 
344  if (!xtensa->core_config->trace.enabled &&
345  (reg <= XDMREG_MEMADDREND || (reg >= XDMREG_PMG && reg <= XDMREG_PMSTAT7))) {
346  LOG_ERROR("Can not access %u reg when Trace Port option disabled!", reg);
347  return ERROR_FAIL;
348  }
349  return dm->dbg_ops->queue_reg_write(dm, reg, data);
350 }
351 
352 static inline int xtensa_core_status_clear(struct target *target, uint32_t bits)
353 {
356 }
357 
359 
360 int xtensa_examine(struct target *target);
361 int xtensa_wakeup(struct target *target);
362 int xtensa_smpbreak_set(struct target *target, uint32_t set);
363 int xtensa_smpbreak_get(struct target *target, uint32_t *val);
364 int xtensa_smpbreak_write(struct xtensa *xtensa, uint32_t set);
365 int xtensa_smpbreak_read(struct xtensa *xtensa, uint32_t *val);
367 void xtensa_reg_set(struct target *target, enum xtensa_reg_id reg_id, xtensa_reg_val_t value);
369 int xtensa_fetch_all_regs(struct target *target);
371  struct reg **reg_list[],
372  int *reg_list_size,
373  enum target_register_class reg_class);
374 uint32_t xtensa_cause_get(struct target *target);
375 void xtensa_cause_clear(struct target *target);
376 void xtensa_cause_reset(struct target *target);
377 int xtensa_poll(struct target *target);
379 int xtensa_halt(struct target *target);
380 int xtensa_resume(struct target *target,
381  int current,
382  target_addr_t address,
383  int handle_breakpoints,
384  int debug_execution);
386  int current,
387  target_addr_t address,
388  int handle_breakpoints,
389  int debug_execution);
390 int xtensa_do_resume(struct target *target);
391 int xtensa_step(struct target *target, int current, target_addr_t address, int handle_breakpoints);
392 int xtensa_do_step(struct target *target, int current, target_addr_t address, int handle_breakpoints);
393 int xtensa_mmu_is_enabled(struct target *target, int *enabled);
394 int xtensa_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer);
395 int xtensa_read_buffer(struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer);
396 int xtensa_write_memory(struct target *target,
397  target_addr_t address,
398  uint32_t size,
399  uint32_t count,
400  const uint8_t *buffer);
401 int xtensa_write_buffer(struct target *target, target_addr_t address, uint32_t count, const uint8_t *buffer);
402 int xtensa_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum);
403 int xtensa_assert_reset(struct target *target);
404 int xtensa_deassert_reset(struct target *target);
411  int num_mem_params, struct mem_param *mem_params,
412  int num_reg_params, struct reg_param *reg_params,
413  target_addr_t entry_point, target_addr_t exit_point,
414  void *arch_info);
416  int num_mem_params, struct mem_param *mem_params,
417  int num_reg_params, struct reg_param *reg_params,
418  target_addr_t exit_point, unsigned int timeout_ms,
419  void *arch_info);
421  int num_mem_params, struct mem_param *mem_params,
422  int num_reg_params, struct reg_param *reg_params,
423  target_addr_t entry_point, target_addr_t exit_point,
424  unsigned int timeout_ms, void *arch_info);
425 void xtensa_set_permissive_mode(struct target *target, bool state);
426 const char *xtensa_get_gdb_arch(const struct target *target);
427 int xtensa_gdb_query_custom(struct target *target, const char *packet, char **response_p);
428 
429 COMMAND_HELPER(xtensa_cmd_xtdef_do, struct xtensa *xtensa);
430 COMMAND_HELPER(xtensa_cmd_xtopt_do, struct xtensa *xtensa);
431 COMMAND_HELPER(xtensa_cmd_xtmem_do, struct xtensa *xtensa);
432 COMMAND_HELPER(xtensa_cmd_xtmpu_do, struct xtensa *xtensa);
433 COMMAND_HELPER(xtensa_cmd_xtmmu_do, struct xtensa *xtensa);
434 COMMAND_HELPER(xtensa_cmd_xtreg_do, struct xtensa *xtensa);
435 COMMAND_HELPER(xtensa_cmd_xtregfmt_do, struct xtensa *xtensa);
436 COMMAND_HELPER(xtensa_cmd_permissive_mode_do, struct xtensa *xtensa);
437 COMMAND_HELPER(xtensa_cmd_mask_interrupts_do, struct xtensa *xtensa);
438 COMMAND_HELPER(xtensa_cmd_smpbreak_do, struct target *target);
439 COMMAND_HELPER(xtensa_cmd_perfmon_dump_do, struct xtensa *xtensa);
440 COMMAND_HELPER(xtensa_cmd_perfmon_enable_do, struct xtensa *xtensa);
441 COMMAND_HELPER(xtensa_cmd_tracestart_do, struct xtensa *xtensa);
442 COMMAND_HELPER(xtensa_cmd_tracestop_do, struct xtensa *xtensa);
443 COMMAND_HELPER(xtensa_cmd_tracedump_do, struct xtensa *xtensa, const char *fname);
444 
445 extern const struct command_registration xtensa_command_handlers[];
446 
447 #endif /* OPENOCD_TARGET_XTENSA_H */
#define ERROR_FAIL
Definition: log.h:173
#define LOG_ERROR(expr ...)
Definition: log.h:132
uint8_t bits[QN908X_FLASH_MAX_BLOCKS *QN908X_FLASH_PAGES_PER_BLOCK/8]
Definition: qn908x.c:0
target_addr_t addr
Start address to search for the control block.
Definition: rtt/rtt.c:28
size_t size
Size of the control block search area.
Definition: rtt/rtt.c:30
Definition: register.h:111
Definition: target.h:116
void * arch_info
Definition: target.h:164
Definition: trace.h:21
Xtensa algorithm data.
Definition: xtensa.h:229
xtensa_reg_val_t ctx_ps
Definition: xtensa.h:234
enum target_debug_reason ctx_debug_reason
Used internally to backup and restore core state.
Definition: xtensa.h:233
enum xtensa_mode core_mode
User can set this to specify which core mode algorithm should be run in.
Definition: xtensa.h:231
uint8_t way_count
Definition: xtensa.h:113
uint32_t size
Definition: xtensa.h:115
uint32_t line_size
Definition: xtensa.h:114
struct xtensa_cache_config dcache
Definition: xtensa.h:182
struct xtensa_debug_config debug
Definition: xtensa.h:179
struct xtensa_tracing_config trace
Definition: xtensa.h:180
struct xtensa_local_mem_config irom
Definition: xtensa.h:183
struct xtensa_local_mem_config drom
Definition: xtensa.h:185
struct xtensa_mpu_config mpu
Definition: xtensa.h:178
enum xtensa_type core_type
Definition: xtensa.h:170
struct xtensa_cache_config icache
Definition: xtensa.h:181
struct xtensa_local_mem_config iram
Definition: xtensa.h:184
struct xtensa_high_prio_irq_config high_irq
Definition: xtensa.h:176
struct xtensa_mmu_config mmu
Definition: xtensa.h:177
uint8_t aregs_num
Definition: xtensa.h:171
struct xtensa_irq_config irq
Definition: xtensa.h:175
struct xtensa_local_mem_config dram
Definition: xtensa.h:186
struct xtensa_local_mem_config sram
Definition: xtensa.h:187
bool windowed
Definition: xtensa.h:172
struct xtensa_local_mem_config srom
Definition: xtensa.h:188
bool coproc
Definition: xtensa.h:173
bool exceptions
Definition: xtensa.h:174
uint8_t irq_level
Definition: xtensa.h:157
uint8_t ibreaks_num
Definition: xtensa.h:158
uint8_t dbreaks_num
Definition: xtensa.h:159
uint8_t perfcount_num
Definition: xtensa.h:160
const struct xtensa_debug_ops * dbg_ops
int(* queue_reg_write)(struct xtensa_debug_module *dm, enum xtensa_dm_reg reg, uint32_t data)
register write.
int(* queue_reg_read)(struct xtensa_debug_module *dm, enum xtensa_dm_reg reg, uint8_t *data)
register read.
uint8_t irq_num
Definition: xtensa.h:146
struct xtensa_local_mem_region_config regions[XT_LOCAL_MEM_REGIONS_NUM_MAX]
Definition: xtensa.h:127
uint8_t itlb_entries_count
Definition: xtensa.h:132
uint8_t dtlb_entries_count
Definition: xtensa.h:133
uint8_t nfgseg
Definition: xtensa.h:138
uint32_t minsegsize
Definition: xtensa.h:139
uint8_t insn[XT_ISNS_SZ_MAX]
Definition: xtensa.h:221
struct breakpoint * oocd_bp
Definition: xtensa.h:219
bool reversed_mem_access
Definition: xtensa.h:166
Represents a generic Xtensa core.
Definition: xtensa.h:242
struct watchpoint ** hw_wps
Definition: xtensa.h:268
uint8_t come_online_probes_num
Definition: xtensa.h:282
unsigned int dbregs_num
Definition: xtensa.h:263
struct xtensa_reg_desc ** contiguous_regs_desc
Definition: xtensa.h:252
unsigned int total_regs_num
Definition: xtensa.h:248
struct reg * empty_regs
Definition: xtensa.h:257
struct xtensa_debug_module dbg_mod
Definition: xtensa.h:246
char qpkt_resp[XT_QUERYPKT_RESP_MAX]
Definition: xtensa.h:258
bool permissive_mode
Definition: xtensa.h:271
struct xtensa_chip_common * xtensa_chip
Definition: xtensa.h:244
uint32_t smp_break
Definition: xtensa.h:273
bool suppress_dsr_errors
Definition: xtensa.h:272
struct reg ** contiguous_regs_list
Definition: xtensa.h:253
bool trace_active
Definition: xtensa.h:270
uint32_t spill_loc
Definition: xtensa.h:274
struct target * target
Definition: xtensa.h:264
int8_t probe_lsddr32p
Definition: xtensa.h:277
unsigned int eps_dbglevel_idx
Definition: xtensa.h:262
void ** algo_context_backup
Definition: xtensa.h:261
bool reset_asserted
Definition: xtensa.h:265
uint8_t * spill_buf
Definition: xtensa.h:276
struct xtensa_sw_breakpoint * sw_brps
Definition: xtensa.h:269
uint32_t nx_stop_cause
Definition: xtensa.h:285
unsigned int genpkt_regs_num
Definition: xtensa.h:251
enum xtensa_stepping_isr_mode stepping_isr_mode
Definition: xtensa.h:266
bool regmap_contiguous
Definition: xtensa.h:250
bool halt_request
Definition: xtensa.h:284
struct reg_cache * core_cache
Definition: xtensa.h:247
bool regs_fetched
Definition: xtensa.h:288
unsigned int num_optregs
Definition: xtensa.h:256
unsigned int core_regs_num
Definition: xtensa.h:249
struct xtensa_keyval_info scratch_ars[XT_AR_SCRATCH_NUM]
Definition: xtensa.h:287
struct xtensa_reg_desc * optregs
Definition: xtensa.h:255
uint32_t nx_reg_idx[XT_NX_REG_IDX_NUM]
Definition: xtensa.h:286
struct breakpoint ** hw_brps
Definition: xtensa.h:267
bool proc_syscall
Definition: xtensa.h:283
unsigned int common_magic
Definition: xtensa.h:243
struct xtensa_config * core_config
Definition: xtensa.h:245
unsigned int spill_bytes
Definition: xtensa.h:275
target_debug_reason
Definition: target.h:68
target_register_class
Definition: target.h:110
uint64_t target_addr_t
Definition: types.h:335
uint8_t state[4]
Definition: vdebug.c:21
uint8_t count[4]
Definition: vdebug.c:22
int xtensa_gdb_query_custom(struct target *target, const char *packet, char **response_p)
Definition: xtensa.c:3274
void xtensa_reg_set_deep_relgen(struct target *target, enum xtensa_reg_id a_idx, xtensa_reg_val_t value)
Definition: xtensa.c:1080
xtensa_qerr_e
Definition: xtensa.h:84
@ XT_QERR_FAIL
Definition: xtensa.h:86
@ XT_QERR_INVAL
Definition: xtensa.h:87
@ XT_QERR_INTERNAL
Definition: xtensa.h:85
@ XT_QERR_MEM
Definition: xtensa.h:88
@ XT_QERR_NUM
Definition: xtensa.h:89
static struct xtensa * target_to_xtensa(struct target *target)
Definition: xtensa.h:291
static int xtensa_queue_dbg_reg_write(struct xtensa *xtensa, enum xtensa_dm_reg reg, uint32_t data)
Definition: xtensa.h:340
int xtensa_breakpoint_add(struct target *target, struct breakpoint *breakpoint)
Definition: xtensa.c:2564
void xtensa_target_deinit(struct target *target)
Definition: xtensa.c:3495
xtensa_stepping_isr_mode
Definition: xtensa.h:193
@ XT_STEPPING_ISR_OFF
Definition: xtensa.h:194
@ XT_STEPPING_ISR_ON
Definition: xtensa.h:195
#define XT_ISNS_SZ_MAX
Definition: xtensa.h:36
int xtensa_watchpoint_add(struct target *target, struct watchpoint *watchpoint)
Definition: xtensa.c:2646
static bool xtensa_data_addr_valid(struct target *target, uint32_t addr)
Definition: xtensa.h:315
static bool xtensa_addr_in_mem(const struct xtensa_local_mem_config *mem, uint32_t addr)
Definition: xtensa.h:305
const char * xtensa_get_gdb_arch(const struct target *target)
Definition: xtensa.c:3528
uint32_t xtensa_cause_get(struct target *target)
Definition: xtensa.c:1095
int xtensa_do_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
Definition: xtensa.c:1722
int xtensa_smpbreak_read(struct xtensa *xtensa, uint32_t *val)
Definition: xtensa.c:956
xtensa_type
Definition: xtensa.h:106
@ XT_LX
Definition: xtensa.h:108
@ XT_UNDEF
Definition: xtensa.h:107
@ XT_NX
Definition: xtensa.h:109
int xtensa_poll(struct target *target)
Definition: xtensa.c:2314
int xtensa_prepare_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Definition: xtensa.c:1593
xtensa_nx_reg_idx
Definition: xtensa.h:198
@ XT_NX_REG_IDX_IEVEC
Definition: xtensa.h:202
@ XT_NX_REG_IDX_MS
Definition: xtensa.h:201
@ XT_NX_REG_IDX_NUM
Definition: xtensa.h:206
@ XT_NX_REG_IDX_MESR
Definition: xtensa.h:204
@ XT_NX_REG_IDX_IBREAKC0
Definition: xtensa.h:199
@ XT_NX_REG_IDX_MESRCLR
Definition: xtensa.h:205
@ XT_NX_REG_IDX_IEEXTERN
Definition: xtensa.h:203
@ XT_NX_REG_IDX_WB
Definition: xtensa.h:200
int xtensa_halt(struct target *target)
Definition: xtensa.c:1566
int xtensa_breakpoint_remove(struct target *target, struct breakpoint *breakpoint)
Definition: xtensa.c:2608
int xtensa_read_buffer(struct target *target, target_addr_t address, uint32_t count, uint8_t *buffer)
Definition: xtensa.c:2091
int xtensa_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
Definition: xtensa.c:1489
int xtensa_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
Definition: xtensa.c:1944
int xtensa_target_init(struct command_context *cmd_ctx, struct target *target)
Definition: xtensa.c:3429
int xtensa_checksum_memory(struct target *target, target_addr_t address, uint32_t count, uint32_t *checksum)
Definition: xtensa.c:2308
void xtensa_on_poll(struct target *target)
const struct command_registration xtensa_command_handlers[]
Definition: xtensa.c:4619
int xtensa_smpbreak_set(struct target *target, uint32_t set)
Definition: xtensa.c:944
int xtensa_examine(struct target *target)
Definition: xtensa.c:886
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)
Definition: xtensa.c:2722
int xtensa_init_arch_info(struct target *target, struct xtensa *xtensa, const struct xtensa_debug_module_config *dm_cfg)
Definition: xtensa.c:3385
int xtensa_fetch_all_regs(struct target *target)
Definition: xtensa.c:1210
int xtensa_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Definition: xtensa.c:1673
int xtensa_watchpoint_remove(struct target *target, struct watchpoint *watchpoint)
Definition: xtensa.c:2702
void xtensa_cause_reset(struct target *target)
Definition: xtensa.c:1154
int xtensa_write_buffer(struct target *target, target_addr_t address, uint32_t count, const uint8_t *buffer)
Definition: xtensa.c:2302
int xtensa_smpbreak_write(struct xtensa *xtensa, uint32_t set)
Definition: xtensa.c:929
int xtensa_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
Definition: xtensa.c:2097
void xtensa_reg_set(struct target *target, enum xtensa_reg_id reg_id, xtensa_reg_val_t value)
Definition: xtensa.c:1070
xtensa_ar_scratch_set_e
Definition: xtensa.h:93
@ XT_AR_SCRATCH_A3
Definition: xtensa.h:94
@ XT_AR_SCRATCH_AR4
Definition: xtensa.h:97
@ XT_AR_SCRATCH_NUM
Definition: xtensa.h:98
@ XT_AR_SCRATCH_A4
Definition: xtensa.h:96
@ XT_AR_SCRATCH_AR3
Definition: xtensa.h:95
void xtensa_cause_clear(struct target *target)
Definition: xtensa.c:1142
xtensa_mode
Definition: xtensa.h:210
@ XT_MODE_RING2
Definition: xtensa.h:213
@ XT_MODE_RING1
Definition: xtensa.h:212
@ XT_MODE_ANY
Definition: xtensa.h:215
@ XT_MODE_RING0
Definition: xtensa.h:211
@ XT_MODE_RING3
Definition: xtensa.h:214
int xtensa_smpbreak_get(struct target *target, uint32_t *val)
Definition: xtensa.c:968
int xtensa_core_status_check(struct target *target)
Definition: xtensa.c:1017
int xtensa_do_resume(struct target *target)
Definition: xtensa.c:1656
#define XT_LOCAL_MEM_REGIONS_NUM_MAX
Definition: xtensa.h:72
int xtensa_wakeup(struct target *target)
Definition: xtensa.c:915
int xtensa_mmu_is_enabled(struct target *target, int *enabled)
Definition: xtensa.c:1558
#define XT_QUERYPKT_RESP_MAX
Definition: xtensa.h:82
#define XTENSA_COMMON_MAGIC
Definition: xtensa.h:237
void xtensa_set_permissive_mode(struct target *target, bool state)
Definition: xtensa.c:3424
int xtensa_deassert_reset(struct target *target)
Definition: xtensa.c:1182
COMMAND_HELPER(xtensa_cmd_xtdef_do, struct xtensa *xtensa)
Definition: xtensa.c:3609
int xtensa_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
Definition: xtensa.c:2008
int xtensa_soft_reset_halt(struct target *target)
Definition: xtensa.c:1204
int xtensa_assert_reset(struct target *target)
Definition: xtensa.c:1161
uint32_t xtensa_insn_t
Definition: xtensa.h:191
static int xtensa_queue_dbg_reg_read(struct xtensa *xtensa, enum xtensa_dm_reg reg, uint8_t *data)
Definition: xtensa.h:328
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: xtensa.c:2921
static int xtensa_core_status_clear(struct target *target, uint32_t bits)
Definition: xtensa.h:352
xtensa_reg_val_t xtensa_reg_get(struct target *target, enum xtensa_reg_id reg_id)
Definition: xtensa.c:1063
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.
Definition: xtensa.c:2813
int xtensa_dm_core_status_clear(struct xtensa_debug_module *dm, xtensa_dsr_t bits)
xtensa_dm_reg
@ XDMREG_MEMADDREND
@ XDMREG_PMSTAT7
@ XDMREG_PMG
xtensa_reg_id
Definition: xtensa_regs.h:15
uint32_t xtensa_reg_val_t
Definition: xtensa_regs.h:70