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

Go to the source code of this file.

Macros

#define XTENSA_APPTRACE_BLOCK_ID(_id_)   (((_id_) & XTENSA_APPTRACE_BLOCK_ID_MSK) << 15)
 
#define XTENSA_APPTRACE_BLOCK_ID_GET(_v_)   (((_v_) >> 15) & XTENSA_APPTRACE_BLOCK_ID_MSK)
 
#define XTENSA_APPTRACE_BLOCK_ID_MAX   XTENSA_APPTRACE_BLOCK_ID_MSK
 
#define XTENSA_APPTRACE_BLOCK_ID_MSK   0x7FUL
 
#define XTENSA_APPTRACE_BLOCK_LEN(_l_)   ((_l_) & XTENSA_APPTRACE_BLOCK_LEN_MSK)
 
#define XTENSA_APPTRACE_BLOCK_LEN_GET(_v_)   ((_v_) & XTENSA_APPTRACE_BLOCK_LEN_MSK)
 
#define XTENSA_APPTRACE_BLOCK_LEN_MSK   0x7FFFUL
 
#define XTENSA_APPTRACE_CTRL_REG   XDMREG_DELAYCNT
 
#define XTENSA_APPTRACE_HOST_CONNECT   BIT(23)
 
#define XTENSA_APPTRACE_HOST_DATA   BIT(22)
 
#define XTENSA_APPTRACE_STAT_REG   XDMREG_TRIGGERPC
 

Functions

uint32_t esp_xtensa_apptrace_block_max_size_get (struct target *target)
 
static int esp_xtensa_apptrace_buffs_write (struct target *target, uint32_t bufs_num, uint32_t buf_sz[], const uint8_t *bufs[], uint32_t block_id, bool ack, bool data)
 
int esp_xtensa_apptrace_ctrl_reg_read (struct target *target, uint32_t *block_id, uint32_t *len, bool *conn)
 
int esp_xtensa_apptrace_ctrl_reg_write (struct target *target, uint32_t block_id, uint32_t len, bool conn, bool data)
 
int esp_xtensa_apptrace_data_len_read (struct target *target, uint32_t *block_id, uint32_t *len)
 
static int esp_xtensa_apptrace_data_normal_read (struct xtensa *xtensa, uint32_t size, uint8_t *buffer, uint8_t *unal_bytes)
 
int esp_xtensa_apptrace_data_read (struct target *target, uint32_t size, uint8_t *buffer, uint32_t block_id, bool ack)
 
static int esp_xtensa_apptrace_data_reverse_read (struct xtensa *xtensa, uint32_t size, uint8_t *buffer, uint8_t *unal_bytes)
 
static int esp_xtensa_apptrace_leave_crit_section_start (struct target *target)
 
static int esp_xtensa_apptrace_leave_crit_section_stop (struct target *target)
 
static int esp_xtensa_apptrace_queue_normal_write (struct target *target, uint32_t bufs_num, uint32_t buf_sz[], const uint8_t *bufs[])
 
static int esp_xtensa_apptrace_queue_reverse_write (struct target *target, uint32_t bufs_num, uint32_t buf_sz[], const uint8_t *bufs[])
 
int esp_xtensa_apptrace_status_reg_read (struct target *target, uint32_t *stat)
 
int esp_xtensa_apptrace_status_reg_write (struct target *target, uint32_t stat)
 
uint32_t esp_xtensa_apptrace_usr_block_max_size_get (struct target *target)
 
int esp_xtensa_apptrace_usr_block_write (struct target *target, uint32_t block_id, const uint8_t *data, uint32_t size)
 
static int esp_xtensa_swdbg_activate (struct target *target, int enab)
 

Variables

struct esp32_apptrace_hw esp_xtensa_apptrace_hw
 

Macro Definition Documentation

◆ XTENSA_APPTRACE_BLOCK_ID

#define XTENSA_APPTRACE_BLOCK_ID (   _id_)    (((_id_) & XTENSA_APPTRACE_BLOCK_ID_MSK) << 15)

Definition at line 35 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_BLOCK_ID_GET

#define XTENSA_APPTRACE_BLOCK_ID_GET (   _v_)    (((_v_) >> 15) & XTENSA_APPTRACE_BLOCK_ID_MSK)

Definition at line 36 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_BLOCK_ID_MAX

#define XTENSA_APPTRACE_BLOCK_ID_MAX   XTENSA_APPTRACE_BLOCK_ID_MSK

Definition at line 27 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_BLOCK_ID_MSK

#define XTENSA_APPTRACE_BLOCK_ID_MSK   0x7FUL

Definition at line 26 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_BLOCK_LEN

#define XTENSA_APPTRACE_BLOCK_LEN (   _l_)    ((_l_) & XTENSA_APPTRACE_BLOCK_LEN_MSK)

Definition at line 33 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_BLOCK_LEN_GET

#define XTENSA_APPTRACE_BLOCK_LEN_GET (   _v_)    ((_v_) & XTENSA_APPTRACE_BLOCK_LEN_MSK)

Definition at line 34 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_BLOCK_LEN_MSK

#define XTENSA_APPTRACE_BLOCK_LEN_MSK   0x7FFFUL

Definition at line 32 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_CTRL_REG

#define XTENSA_APPTRACE_CTRL_REG   XDMREG_DELAYCNT

Definition at line 25 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_HOST_CONNECT

#define XTENSA_APPTRACE_HOST_CONNECT   BIT(23)

Definition at line 38 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_HOST_DATA

#define XTENSA_APPTRACE_HOST_DATA   BIT(22)

Definition at line 37 of file esp_xtensa_apptrace.c.

◆ XTENSA_APPTRACE_STAT_REG

#define XTENSA_APPTRACE_STAT_REG   XDMREG_TRIGGERPC

Definition at line 30 of file esp_xtensa_apptrace.c.

Function Documentation

◆ esp_xtensa_apptrace_block_max_size_get()

◆ esp_xtensa_apptrace_buffs_write()

◆ esp_xtensa_apptrace_ctrl_reg_read()

◆ esp_xtensa_apptrace_ctrl_reg_write()

int esp_xtensa_apptrace_ctrl_reg_write ( struct target target,
uint32_t  block_id,
uint32_t  len,
bool  conn,
bool  data 
)

◆ esp_xtensa_apptrace_data_len_read()

int esp_xtensa_apptrace_data_len_read ( struct target target,
uint32_t *  block_id,
uint32_t *  len 
)

Definition at line 97 of file esp_xtensa_apptrace.c.

References esp_xtensa_apptrace_ctrl_reg_read(), and NULL.

◆ esp_xtensa_apptrace_data_normal_read()

static int esp_xtensa_apptrace_data_normal_read ( struct xtensa xtensa,
uint32_t  size,
uint8_t *  buffer,
uint8_t *  unal_bytes 
)
static

◆ esp_xtensa_apptrace_data_read()

◆ esp_xtensa_apptrace_data_reverse_read()

static int esp_xtensa_apptrace_data_reverse_read ( struct xtensa xtensa,
uint32_t  size,
uint8_t *  buffer,
uint8_t *  unal_bytes 
)
static

◆ esp_xtensa_apptrace_leave_crit_section_start()

static int esp_xtensa_apptrace_leave_crit_section_start ( struct target target)
static

Definition at line 287 of file esp_xtensa_apptrace.c.

References ERROR_OK, esp_xtensa_swdbg_activate(), and LOG_ERROR.

◆ esp_xtensa_apptrace_leave_crit_section_stop()

static int esp_xtensa_apptrace_leave_crit_section_stop ( struct target target)
static

Definition at line 299 of file esp_xtensa_apptrace.c.

References ERROR_OK, esp_xtensa_swdbg_activate(), and LOG_ERROR.

◆ esp_xtensa_apptrace_queue_normal_write()

static int esp_xtensa_apptrace_queue_normal_write ( struct target target,
uint32_t  bufs_num,
uint32_t  buf_sz[],
const uint8_t *  bufs[] 
)
static

◆ esp_xtensa_apptrace_queue_reverse_write()

static int esp_xtensa_apptrace_queue_reverse_write ( struct target target,
uint32_t  bufs_num,
uint32_t  buf_sz[],
const uint8_t *  bufs[] 
)
static

◆ esp_xtensa_apptrace_status_reg_read()

int esp_xtensa_apptrace_status_reg_read ( struct target target,
uint32_t *  stat 
)

◆ esp_xtensa_apptrace_status_reg_write()

int esp_xtensa_apptrace_status_reg_write ( struct target target,
uint32_t  stat 
)

◆ esp_xtensa_apptrace_usr_block_max_size_get()

uint32_t esp_xtensa_apptrace_usr_block_max_size_get ( struct target target)

Definition at line 92 of file esp_xtensa_apptrace.c.

References esp_xtensa_apptrace_block_max_size_get().

◆ esp_xtensa_apptrace_usr_block_write()

int esp_xtensa_apptrace_usr_block_write ( struct target target,
uint32_t  block_id,
const uint8_t *  data,
uint32_t  size 
)

◆ esp_xtensa_swdbg_activate()

Variable Documentation

◆ esp_xtensa_apptrace_hw

struct esp32_apptrace_hw esp_xtensa_apptrace_hw
Initial value:
= {
.usr_block_max_size_get = esp_xtensa_apptrace_usr_block_max_size_get,
.leave_trace_crit_section_start = esp_xtensa_apptrace_leave_crit_section_start,
.leave_trace_crit_section_stop = esp_xtensa_apptrace_leave_crit_section_stop,
}
int esp_xtensa_apptrace_data_read(struct target *target, uint32_t size, uint8_t *buffer, uint32_t block_id, bool ack)
static int esp_xtensa_apptrace_leave_crit_section_stop(struct target *target)
int esp_xtensa_apptrace_data_len_read(struct target *target, uint32_t *block_id, uint32_t *len)
int esp_xtensa_apptrace_status_reg_read(struct target *target, uint32_t *stat)
uint32_t esp_xtensa_apptrace_usr_block_max_size_get(struct target *target)
static int esp_xtensa_apptrace_buffs_write(struct target *target, uint32_t bufs_num, uint32_t buf_sz[], const uint8_t *bufs[], uint32_t block_id, bool ack, bool data)
int esp_xtensa_apptrace_ctrl_reg_read(struct target *target, uint32_t *block_id, uint32_t *len, bool *conn)
int esp_xtensa_apptrace_ctrl_reg_write(struct target *target, uint32_t block_id, uint32_t len, bool conn, bool data)
#define XTENSA_APPTRACE_BLOCK_ID_MAX
uint32_t esp_xtensa_apptrace_block_max_size_get(struct target *target)
static int esp_xtensa_apptrace_leave_crit_section_start(struct target *target)

Definition at line 42 of file esp_xtensa_apptrace.c.

Referenced by esp_xtensa_apptrace_usr_block_write(), and esp_xtensa_init_arch_info().