1
2
3
7
8
9
10
11
12
13
14
15
17
18
20
21
22
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
47
48
51
52
58
59
60
61
62
63
64
65
68
69
70
71
72
73
74
75
76
77
78
79
83
84
85
86
87
/* ... */
#ifndef OPENOCD_TARGET_ESP_H
#define OPENOCD_TARGET_ESP_H
#include <stdint.h>
#include <helper/bits.h>
/* ... */
#define ESP_DBG_STUBS_CODE_BUF_SIZE 32
/* ... */
#define ESP_DBG_STUBS_STACK_MIN_SIZE 2048
/* ... */
enum esp_dbg_stub_id {
ESP_DBG_STUB_ENTRY_MAGIC_NUM,
ESP_DBG_STUB_TABLE_SIZE,
ESP_DBG_STUB_TABLE_START,
ESP_DBG_STUB_DESC = ESP_DBG_STUB_TABLE_START,
ESP_DBG_STUB_ENTRY_FIRST,
ESP_DBG_STUB_ENTRY_GCOV = ESP_DBG_STUB_ENTRY_FIRST,
ESP_DBG_STUB_CAPABILITIES,
ESP_DBG_STUB_ENTRY_MAX,
...};
#define ESP_DBG_STUB_MAGIC_NUM_VAL 0xFEEDBEEF
#define ESP_DBG_STUB_CAP_GCOV_THREAD BIT(0)
/* ... */
struct esp_dbg_stubs_desc {
/* ... */
uint32_t tramp_addr;
/* ... */
uint32_t min_stack_addr;
uint32_t data_alloc;
uint32_t data_free;
...};
/* ... */
struct esp_dbg_stubs {
uint32_t base;
uint32_t entries[ESP_DBG_STUB_ENTRY_MAX];
uint32_t entries_count;
struct esp_dbg_stubs_desc desc;
...};
struct esp_common {
const struct esp_algorithm_hw *algo_hw;
struct esp_dbg_stubs dbg_stubs;
...};
int esp_common_init(struct esp_common *esp, const struct esp_algorithm_hw *algo_hw);
int esp_dbgstubs_table_read(struct target *target, struct esp_dbg_stubs *dbg_stubs);
/* ... */
#endif