71 const char *
name,
bool search_all)
77 for (i = 0; i < cache->
num_regs; i++) {
100 LOG_DEBUG(
"Resetting internal variables of caches states");
123 LOG_ERROR(
"ARC jtag instruction length should be equal to 4");
168 const char *
const type_name,
const size_t type_name_len)
180 if (!strncmp(
type->data_type.id, type_name, type_name_len)) {
192 }
else if (arc_reg->
is_bcr) {
202 "added register {name=%s, num=0x%" PRIx32
", type=%s%s%s%s}",
204 arc_reg->
is_core ?
", core" :
"", arc_reg->
is_bcr ?
", bcr" :
"",
223 LOG_DEBUG(
"Get register (cached) gdb_num=%" PRIu32
", name=%s, value=0x%" PRIx32,
231 LOG_ERROR(
"It is forbidden to read core registers 61 and 62.");
251 LOG_DEBUG(
"Get register gdb_num=%" PRIu32
", name=%s, value=0x%" PRIx32,
272 LOG_ERROR(
"It is forbidden to write core registers 61 and 62.");
277 LOG_DEBUG(
"Set register gdb_num=%" PRIu32
", name=%s, value=0x%08" PRIx32,
347 struct reg_cache *cache = calloc(1,
sizeof(*cache));
348 struct reg *reg_list = calloc(num_regs,
sizeof(*reg_list));
350 if (!cache || !reg_list) {
356 cache->
name =
"arc registers";
364 LOG_ERROR(
"No core registers were defined");
371 LOG_DEBUG(
"reg n=%3li name=%3s group=%s feature=%s", i,
379 LOG_ERROR(
"No aux registers were defined");
386 LOG_DEBUG(
"reg n=%3li name=%3s group=%s feature=%s", i,
391 if (!strcmp(
"pc", reg_desc->
name)) {
393 LOG_ERROR(
"Double definition of PC in configuration");
397 }
else if (!strcmp(
"debug", reg_desc->
name)) {
399 LOG_ERROR(
"Double definition of DEBUG in configuration");
409 LOG_ERROR(
"`pc' and `debug' registers must be present in target description.");
434 struct reg_cache *cache = malloc(
sizeof(*cache));
435 struct reg *reg_list = calloc(num_regs,
sizeof(*reg_list));
441 if (!cache || !reg_list) {
447 cache->
name =
"arc.bcr";
455 LOG_ERROR(
"No BCR registers are defined");
463 reg_list[i].
exist =
true;
465 LOG_DEBUG(
"reg n=%3li name=%3s group=%s feature=%s", i,
494 *reg_list = calloc(*reg_list_size,
sizeof(
struct reg *));
517 LOG_DEBUG(
"REG_CLASS_ALL: number of regs=%i", *reg_list_size);
520 unsigned long gdb_reg_number = 0;
535 LOG_DEBUG(
"REG_CLASS_GENERAL: number of regs=%i", *reg_list_size);
543 const char *field_name, uint32_t *value_ptr)
547 LOG_DEBUG(
"getting register field (reg_name=%s, field_name=%s)", reg_name, field_name);
553 LOG_ERROR(
"Requested register `%s' doesn't exist.", reg_name);
564 for (field = reg_struct->
fields;
566 field = field->
next) {
567 if (!strcmp(field->
name, field_name))
613 if (!(
target && reg_name)) {
623 uint8_t value_buf[4];
635 uint32_t dccm_build_version, dccm_build_size0, dccm_build_size1;
637 &dccm_build_version));
644 if ((dccm_build_version == 3 || dccm_build_version == 4) && dccm_build_size0 > 0) {
646 uint32_t dccm_size = 0x100;
647 dccm_size <<= dccm_build_size0;
648 if (dccm_build_size0 == 0xF)
649 dccm_size <<= dccm_build_size1;
651 LOG_DEBUG(
"DCCM detected start=0x%" PRIx32
" end=0x%" PRIx32,
666 uint32_t iccm_build_version, iccm_build_size00, iccm_build_size01;
667 uint32_t aux_iccm = 0;
669 &iccm_build_version));
671 &iccm_build_size00));
673 &iccm_build_size01));
674 if (iccm_build_version == 4 && iccm_build_size00 > 0) {
676 uint32_t iccm0_size = 0x100;
677 iccm0_size <<= iccm_build_size00;
678 if (iccm_build_size00 == 0xF)
679 iccm0_size <<= iccm_build_size01;
683 LOG_DEBUG(
"ICCM0 detected start=0x%" PRIx32
" end=0x%" PRIx32,
688 uint32_t iccm_build_size10, iccm_build_size11;
690 &iccm_build_size10));
692 &iccm_build_size11));
693 if (iccm_build_version == 4 && iccm_build_size10 > 0) {
697 uint32_t iccm1_size = 0x100;
698 iccm1_size <<= iccm_build_size10;
699 if (iccm_build_size10 == 0xF)
700 iccm1_size <<= iccm_build_size11;
703 LOG_DEBUG(
"ICCM1 detected start=0x%" PRIx32
" end=0x%" PRIx32,
712 LOG_DEBUG(
"Configuring ARC ICCM and DCCM");
764 LOG_WARNING(
"target was in unknown state when halt was requested");
768 LOG_ERROR(
"can't request a halt while in reset if nSRST pulls nTRST");
798 LOG_DEBUG(
"core stopped (halted) DEGUB-REG: 0x%08" PRIx32, value);
800 LOG_DEBUG(
"core STATUS32: 0x%08" PRIx32, value);
819 LOG_DEBUG(
"Saving aux and core registers values");
824 const uint32_t core_regs_size = arc->
num_core_regs *
sizeof(uint32_t);
827 const uint32_t regs_to_scan =
829 const uint32_t aux_regs_size = arc->
num_aux_regs *
sizeof(uint32_t);
830 uint32_t *core_values = malloc(core_regs_size);
831 uint32_t *aux_values = malloc(aux_regs_size);
832 uint32_t *core_addrs = malloc(core_regs_size);
833 uint32_t *aux_addrs = malloc(aux_regs_size);
834 unsigned int core_cnt = 0;
835 unsigned int aux_cnt = 0;
837 if (!core_values || !core_addrs || !aux_values || !aux_addrs) {
843 memset(core_values, 0xff, core_regs_size);
844 memset(core_addrs, 0xff, core_regs_size);
845 memset(aux_values, 0xff, aux_regs_size);
846 memset(aux_addrs, 0xff, aux_regs_size);
849 struct reg *
reg = &(reg_list[i]);
852 core_addrs[core_cnt] = arc_reg->
arch_num;
858 struct reg *
reg = &(reg_list[i]);
861 aux_addrs[aux_cnt] = arc_reg->
arch_num;
870 LOG_ERROR(
"Attempt to read core registers failed.");
878 LOG_ERROR(
"Attempt to read aux registers failed.");
887 struct reg *
reg = &(reg_list[i]);
894 LOG_DEBUG(
"Get core register regnum=%u, name=%s, value=0x%08" PRIx32,
895 i, arc_reg->
name, core_values[core_cnt]);
902 struct reg *
reg = &(reg_list[i]);
909 LOG_DEBUG(
"Get aux register regnum=%u, name=%s, value=0x%08" PRIx32,
910 i, arc_reg->
name, aux_values[aux_cnt]);
949 for (ap = 0; debug_asr > 1; debug_asr >>= 1)
985 if (!actionpoint->
used)
986 LOG_WARNING(
"Target halted by an unused actionpoint.");
1034 LOG_DEBUG(
"ARC core in halt or reset state.");
1041 LOG_DEBUG(
"Discrepancy of STATUS32[0] HALT bit and ARC_JTAG_STAT_RU, "
1042 "target is still running");
1048 LOG_DEBUG(
"ARC core is in debug running mode");
1078 LOG_DEBUG(
"Starting CPU execution after reset");
1132 LOG_DEBUG(
"target state: %s; PC at: 0x%08" PRIx32,
1151 LOG_DEBUG(
"Restoring registers values");
1154 const uint32_t core_regs_size = arc->
num_core_regs *
sizeof(uint32_t);
1155 const uint32_t aux_regs_size = arc->
num_aux_regs *
sizeof(uint32_t);
1156 uint32_t *core_values = malloc(core_regs_size);
1157 uint32_t *aux_values = malloc(aux_regs_size);
1158 uint32_t *core_addrs = malloc(core_regs_size);
1159 uint32_t *aux_addrs = malloc(aux_regs_size);
1160 unsigned int core_cnt = 0;
1161 unsigned int aux_cnt = 0;
1163 if (!core_values || !core_addrs || !aux_values || !aux_addrs) {
1169 memset(core_values, 0xff, core_regs_size);
1170 memset(core_addrs, 0xff, core_regs_size);
1171 memset(aux_values, 0xff, aux_regs_size);
1172 memset(aux_addrs, 0xff, aux_regs_size);
1175 struct reg *
reg = &(reg_list[i]);
1179 core_addrs[core_cnt] = arc_reg->
arch_num;
1190 aux_addrs[aux_cnt] = arc_reg->
arch_num;
1201 LOG_ERROR(
"Attempt to write to core registers failed.");
1210 LOG_ERROR(
"Attempt to write to aux registers failed.");
1249 int handle_breakpoints,
int debug_execution)
1252 uint32_t resume_pc = 0;
1257 " debug_execution:%i", current, address, handle_breakpoints, debug_execution);
1278 resume_pc = address;
1284 LOG_DEBUG(
"Target resumes from PC=0x%" PRIx32
", pc.dirty=%i, pc.valid=%i",
1290 LOG_DEBUG(
"resume Core (when start-core) with PC @:0x%08" PRIx32,
value);
1295 if (!debug_execution)
1312 if (!debug_execution) {
1315 LOG_DEBUG(
"target resumed at 0x%08" PRIx32, resume_pc);
1319 LOG_DEBUG(
"target debug resumed at 0x%08" PRIx32, resume_pc);
1343 LOG_DEBUG(
"deinitialization of target");
1355 free(
type->reg_type_struct_field);
1356 free(
type->bitfields);
1359 free(
type->reg_type_flags_field);
1360 free(
type->bitfields);
1385 struct arc_common *arc = calloc(1,
sizeof(*arc));
1407 uint8_t value_buf[4];
1413 LOG_DEBUG(
"Address: 0x%08" PRIx32
", value: 0x%08" PRIx32, address,
1434 uint8_t value_buf[4];
1449 LOG_DEBUG(
"Address: 0x%08" PRIx32
", value: 0x%08" PRIx32, address,
1463 uint32_t match_value, uint32_t control_tt, uint32_t control_at)
1470 LOG_ERROR(
"No free actionpoints, maximum amount is %u",
1479 char ap_amv_reg_name[24], ap_amm_reg_name[24], ap_ac_reg_name[24];
1480 snprintf(ap_amv_reg_name, 24,
"ap_amv%" PRIu32, ap_num);
1481 snprintf(ap_amm_reg_name, 24,
"ap_amm%" PRIu32, ap_num);
1482 snprintf(ap_ac_reg_name, 24,
"ap_ac%" PRIu32, ap_num);
1487 control_tt | control_at));
1490 char ap_ac_reg_name[24];
1491 snprintf(ap_ac_reg_name, 24,
"ap_ac%" PRIu32, ap_num);
1512 uint32_t verify = 0xffffffff;
1528 uint16_t verify = 0xffff;
1541 LOG_ERROR(
"Invalid breakpoint length: target supports only 2 or 4");
1549 unsigned int bp_num;
1552 if (!ap_list[bp_num].
used)
1557 LOG_ERROR(
"No free actionpoints, maximum amount is %u",
1567 ap_list[bp_num].
used = 1;
1571 LOG_DEBUG(
"bpid: %" PRIu32
", bp_num %u bp_value 0x%" PRIx32,
1576 LOG_DEBUG(
"ERROR: setting unknown breakpoint type");
1600 uint32_t current_instr;
1612 " has been overwritten outside of debugger."
1613 "Expected: @0x%x, got: @0x%" PRIx32,
1617 uint16_t current_instr;
1628 " has been overwritten outside of debugger. "
1629 "Expected: 0x%04x, got: 0x%04" PRIx16,
1633 LOG_ERROR(
"Invalid breakpoint length: target supports only 2 or 4");
1644 LOG_DEBUG(
"Invalid actionpoint ID: %u in breakpoint: %" PRIu32,
1654 ap_list[bp_num].
used = 0;
1657 LOG_DEBUG(
"bpid: %" PRIu32
" - released actionpoint ID: %u",
1661 LOG_DEBUG(
"ERROR: unsetting unknown breakpoint type");
1678 LOG_WARNING(
" > core was not halted, please try again.");
1718 if ((ap_list[i].used) && (ap_list[i].reg_address))
1748 uint32_t auxreg_addr, uint32_t transaction)
1750 unsigned int ap_num = 0;
1759 while (ap_list[ap_num].
used)
1763 LOG_ERROR(
"No actionpoint free, maximum amount is %u",
1772 ap_list[ap_num].
used = 1;
1782 bool ap_found =
false;
1783 unsigned int ap_num = 0;
1791 while ((ap_list[ap_num].
used) && (ap_num < arc->actionpoints_num)) {
1804 ap_list[ap_num].
used = 0;
1808 LOG_ERROR(
"Register actionpoint not found");
1817 unsigned int wp_num;
1827 if (!ap_list[wp_num].
used)
1832 LOG_ERROR(
"No free actionpoints, maximum amount is %u",
1838 LOG_ERROR(
"Only watchpoints of length 4 are supported");
1854 LOG_ERROR(
"BUG: watchpoint->rw neither read, write nor access");
1863 ap_list[wp_num].
used = 1;
1867 LOG_DEBUG(
"wpid: %" PRIu32
", wp_num %u wp_value 0x%" PRIx32,
1888 LOG_DEBUG(
"Invalid actionpoint ID: %u in watchpoint: %" PRIu32,
1898 ap_list[wp_num].
used = 0;
1901 LOG_DEBUG(
"wpid: %" PRIu32
" - releasing actionpoint ID: %u",
1938 assert(hit_watchpoint);
1944 if (!actionpoint->
used)
1945 LOG_WARNING(
"Target halted by unused actionpoint.");
1949 LOG_WARNING(
"Target halted by breakpoint, but is treated as a watchpoint.");
1956 LOG_DEBUG(
"Hit watchpoint, wpid: %" PRIu32
", watchpoint num: %u",
1981 LOG_DEBUG(
" [status32:0x%08" PRIx32
"]", value);
1990 LOG_DEBUG(
"core debug step mode enabled [debug-reg:0x%08" PRIx32
"]", value);
1998 LOG_DEBUG(
"core debug step mode disabled");
2005 int handle_breakpoints)
2024 LOG_DEBUG(
"Target steps one instruction from PC=0x%" PRIx32,
2028 if (handle_breakpoints) {
2092 uint32_t value, dc_ctrl_value;
2102 dc_ctrl_value = value;
2121 uint32_t value, slc_ctrl_value;
2131 slc_ctrl_value = value;
2141 LOG_DEBUG(
"Waiting for invalidation end.");
2170 uint32_t value, dc_ctrl_value;
2171 bool has_to_set_dc_ctrl_im;
2185 has_to_set_dc_ctrl_im = (dc_ctrl_value &
DC_CTRL_IM) == 0;
2186 if (has_to_set_dc_ctrl_im) {
2196 if (has_to_set_dc_ctrl_im)
2249 .target_request_data =
NULL,
2259 .soft_reset_halt =
NULL,
2265 .checksum_memory =
NULL,
2266 .blank_check_memory =
NULL,
2269 .add_context_breakpoint =
NULL,
2270 .add_hybrid_breakpoint =
NULL,
2276 .run_algorithm =
NULL,
2277 .start_algorithm =
NULL,
2278 .wait_algorithm =
NULL,
2288 .read_phys_memory =
NULL,
2289 .write_phys_memory =
NULL,
static int arc_set_register(struct reg *reg, uint8_t *buf)
static int arc_restore_context(struct target *target)
See arc_save_context() for reason why we want to dump all regs at once.
static int arc_build_bcr_reg_cache(struct target *target)
int arc_reg_get_field(struct target *target, const char *reg_name, const char *field_name, uint32_t *value_ptr)
static int arc_configure_actionpoint(struct target *target, uint32_t ap_num, uint32_t match_value, uint32_t control_tt, uint32_t control_at)
static int arc_save_context(struct target *target)
Read registers that are used in GDB g-packet.
static int get_current_actionpoint(struct target *target, struct arc_actionpoint **actionpoint)
Finds an actionpoint that triggered last actionpoint event, as specified by DEBUG....
int arc_reg_add(struct target *target, struct arc_reg_desc *arc_reg, const char *const type_name, const size_t type_name_len)
static int arc_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
static int arc_config_step(struct target *target, int enable_step)
static int arc_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int arc_configure(struct target *target)
static int arc_get_register(struct reg *reg)
static const struct reg_arch_type arc_reg_type
static int arc_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int arc_unset_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int arc_build_reg_cache(struct target *target)
void arc_reg_data_type_add(struct target *target, struct arc_reg_data_type *data_type)
static int arc_configure_iccm(struct target *target)
static int arc_assert_reset(struct target *target)
static const char *const reg_group_other
struct target_type arcv2_target
static int arc_unset_watchpoint(struct target *target, struct watchpoint *watchpoint)
int arc_cache_flush(struct target *target)
static int arc_debug_entry(struct target *target)
static int arc_set_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int arc_examine(struct target *target)
static int arc_enable_interrupts(struct target *target, int enable)
static int arc_halt(struct target *target)
static int arc_configure_dccm(struct target *target)
static int arc_l2cache_flush(struct target *target)
int arc_cache_invalidate(struct target *target)
static int arc_deassert_reset(struct target *target)
static int arc_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
static const char *const reg_group_general
static int arc_l2cache_invalidate(struct target *target)
static int arc_init_arch_info(struct target *target, struct arc_common *arc, struct jtag_tap *tap)
static void arc_free_reg_cache(struct reg_cache *cache)
static void arc_reset_actionpoints(struct target *target)
static int arc_poll(struct target *target)
static int arc_examine_debug_reason(struct target *target)
static int arc_arch_state(struct target *target)
int arc_remove_auxreg_actionpoint(struct target *target, uint32_t auxreg_addr)
static int arc_icache_invalidate(struct target *target)
static int arc_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int arc_dcache_invalidate(struct target *target)
static int arc_write_instruction_u32(struct target *target, uint32_t address, uint32_t instr)
Write 4-byte instruction to memory.
static int arc_target_create(struct target *target, Jim_Interp *interp)
static int arc_set_breakpoint(struct target *target, struct breakpoint *breakpoint)
int arc_add_auxreg_actionpoint(struct target *target, uint32_t auxreg_addr, uint32_t transaction)
static int arc_set_register_value(struct target *target, const char *reg_name, uint32_t value)
int arc_set_actionpoints_num(struct target *target, uint32_t ap_num)
static int arc_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
static int arc_reset_caches_states(struct target *target)
Reset internal states of caches.
static int arc_read_instruction_u32(struct target *target, uint32_t address, uint32_t *value)
Read 32-bit instruction from memory.
static int arc_dcache_flush(struct target *target)
static void arc_deinit_target(struct target *target)
static int arc_init_target(struct command_context *cmd_ctx, struct target *target)
static int arc_hit_watchpoint(struct target *target, struct watchpoint **hit_watchpoint)
static int arc_init_reg(struct target *target, struct reg *reg, struct arc_reg_desc *reg_desc, unsigned long number)
struct reg * arc_reg_get_by_name(struct reg_cache *first, const char *name, bool search_all)
Private implementation of register_get_by_name() for ARC that doesn't skip not [yet] existing registe...
static int arc_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int arc_get_register_value(struct target *target, const char *reg_name, uint32_t *value_ptr)
#define AUX_STATUS32_REG_IE_BIT
static struct arc_common * target_to_arc(struct target *target)
#define ERROR_ARC_REGTYPE_NOT_FOUND
#define ERROR_ARC_REGISTER_FIELD_NOT_FOUND
#define AP_AC_TT_READWRITE
#define SET_CORE_SINGLE_INSTR_STEP
#define AUX_STATUS32_REG_HALT_BIT
static void arc_h_u32_to_me(uint8_t *buf, int val)
Convert data in host endianness to the middle endian.
#define IC_IVIC_INVALIDATE
#define AP_AC_AT_INST_ADDR
#define SLC_AUX_CACHE_FLUSH
#define ERROR_ARC_REGISTER_IS_NOT_STRUCT
static const struct reg_data_type standard_gdb_types[]
#define AP_AC_AT_MEMORY_ADDR
#define SLC_AUX_CACHE_CTRL
#define AP_AC_AT_AUXREG_ADDR
static uint32_t arc_me_to_h_u32(const uint8_t *buf)
Convert data in middle endian to host endian.
#define SET_CORE_ENABLE_INTERRUPTS
#define SLC_AUX_CACHE_INV
#define ERROR_ARC_REGISTER_NOT_FOUND
void free_reg_desc(struct arc_reg_desc *r)
#define SET_CORE_FORCE_HALT
#define CHECK_RETVAL(action)
#define ERROR_ARC_FIELD_IS_NOT_BITFIELD
#define SET_CORE_HALT_BIT
#define DC_IVDC_INVALIDATE
const struct command_registration arc_monitor_command_handlers[]
int arc_jtag_startup(struct arc_jtag *jtag_info)
int arc_jtag_write_core_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, const uint32_t *buffer)
Write core registers.
int arc_jtag_read_core_reg_one(struct arc_jtag *jtag_info, uint32_t addr, uint32_t *value)
Wrapper function to ease reading of one core register.
int arc_jtag_status(struct arc_jtag *const jtag_info, uint32_t *const value)
Read STATUS register.
int arc_jtag_write_aux_reg_one(struct arc_jtag *jtag_info, uint32_t addr, uint32_t value)
Wrapper function to ease writing of one AUX register.
int arc_jtag_read_core_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, uint32_t *buffer)
Read core registers.
int arc_jtag_read_aux_reg_one(struct arc_jtag *jtag_info, uint32_t addr, uint32_t *value)
Wrapper function to ease reading of one AUX register.
int arc_jtag_write_aux_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, const uint32_t *buffer)
Write AUX registers.
int arc_jtag_read_aux_reg(struct arc_jtag *jtag_info, uint32_t *addr, uint32_t count, uint32_t *buffer)
Read AUX registers.
int arc_mem_read(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
int arc_mem_write(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
struct reg_data_type * data_type
static uint32_t buf_get_u32(const uint8_t *_buffer, unsigned first, unsigned num)
Retrieves num bits from _buffer, starting at the first bit, returning the bits in a 32-bit word.
static void buf_set_u32(uint8_t *_buffer, unsigned first, unsigned num, uint32_t value)
Sets num bits in _buffer, starting at the first bit, using the bits in value.
struct breakpoint * breakpoint_find(struct target *target, target_addr_t address)
static void watchpoint_set(struct watchpoint *watchpoint, unsigned int number)
static void breakpoint_hw_set(struct breakpoint *breakpoint, unsigned int hw_number)
#define ERROR_COMMAND_ARGUMENT_INVALID
enum esirisc_reg_num number
void jtag_add_reset(int req_tlr_or_trst, int req_srst)
A reset of the TAP state machine can be requested.
static enum reset_types jtag_reset_config
void jtag_add_sleep(uint32_t us)
enum reset_types jtag_get_reset_config(void)
#define list_first_entry(ptr, type, member)
list_first_entry - get the first element from a list
#define list_for_each_entry_safe_reverse(pos, n, head, member)
list_for_each_entry_safe_reverse - iterate backwards over list safe against removal
static void list_add_tail(struct list_head *new, struct list_head *head)
list_add_tail - add a new entry
static int list_empty(const struct list_head *head)
list_empty - tests whether a list is empty
#define list_for_each_entry(pos, head, member)
list_for_each_entry - iterate over list of given type
#define list_for_each_entry_safe(pos, n, head, member)
list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
static void INIT_LIST_HEAD(struct list_head *list)
INIT_LIST_HEAD - Initialize a list_head structure.
void alive_sleep(uint64_t ms)
#define LOG_WARNING(expr ...)
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
struct reg_cache ** register_get_last_cache_p(struct reg_cache **first)
void register_cache_invalidate(struct reg_cache *cache)
Marks the contents of the register cache as invalid (and clean).
enum arc_actionpointype type
unsigned long num_core_regs
struct list_head core_reg_descriptions
unsigned long debug_index_in_cache
unsigned long num_aux_regs
unsigned int actionpoints_num
unsigned long pc_index_in_cache
unsigned int actionpoints_num_avail
struct reg_cache * core_and_aux_cache
bool core_aux_cache_built
unsigned long num_bcr_regs
unsigned int common_magic
struct reg_cache * bcr_cache
struct arc_jtag jtag_info
struct arc_actionpoint * actionpoints_list
unsigned long last_general_reg
struct list_head reg_data_types
struct list_head aux_reg_descriptions
struct list_head bcr_reg_descriptions
struct reg_data_type data_type
struct reg_data_type * data_type
struct reg_feature feature
enum breakpoint_type type
int ir_length
size of instruction register
int(* get)(struct reg *reg)
int(* set)(struct reg *reg, uint8_t *buf)
struct reg_data_type_bitfield * bitfield
struct reg_data_type_struct_field * next
struct reg_data_type_struct_field * fields
enum reg_data_type_class type_class
struct reg_data_type_struct * reg_type_struct
struct reg_feature * feature
struct reg_data_type * reg_data_type
const struct reg_arch_type * type
This holds methods shared between all instances of a given target type.
const char * name
Name of this type of target.
enum target_debug_reason debug_reason
enum target_endianness endianness
struct reg_cache * reg_cache
struct breakpoint * breakpoints
struct watchpoint * watchpoints
int target_call_event_callbacks(struct target *target, enum target_event event)
const char * target_state_name(struct target *t)
Return the name of this targets current state.
int target_halt(struct target *target)
void target_buffer_set_u32(struct target *target, uint8_t *buffer, uint32_t value)
bool target_has_event_action(struct target *target, enum target_event event)
Returns true only if the target has a handler for the specified event.
int target_write_buffer(struct target *target, target_addr_t address, uint32_t size, const uint8_t *buffer)
int target_write_u16(struct target *target, target_addr_t address, uint16_t value)
int target_read_buffer(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
int target_read_u16(struct target *target, target_addr_t address, uint16_t *value)
void target_handle_event(struct target *target, enum target_event e)
uint32_t target_buffer_get_u32(struct target *target, const uint8_t *buffer)
int target_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
Make the target (re)start executing using its saved execution context (possibly with some modificatio...
#define ERROR_TARGET_NOT_HALTED
#define ERROR_TARGET_UNALIGNED_ACCESS
@ TARGET_EVENT_DEBUG_RESUMED
@ TARGET_EVENT_DEBUG_HALTED
@ TARGET_EVENT_RESET_ASSERT
static const char * target_name(struct target *target)
Returns the instance-specific name of the specified target.
#define ERROR_TARGET_RESOURCE_NOT_AVAILABLE
static void target_set_examined(struct target *target)
Sets the examined flag for the given target.
static bool target_was_examined(struct target *target)
#define ERROR_TARGET_FAILURE
static void h_u32_to_be(uint8_t *buf, uint32_t val)
#define ARRAY_SIZE(x)
Compute the number of elements of a variable length array.
static uint32_t be_to_h_u32(const uint8_t *buf)