78 const char *
name,
bool search_all)
84 for (i = 0; i < cache->
num_regs; i++) {
107 LOG_DEBUG(
"Resetting internal variables of caches states");
130 LOG_ERROR(
"ARC jtag instruction length should be equal to 4");
175 const char *
const type_name,
const size_t type_name_len)
187 if (!strncmp(
type->data_type.id, type_name, type_name_len)) {
199 }
else if (arc_reg->
is_bcr) {
209 "added register {name=%s, num=0x%" PRIx32
", type=%s%s%s%s}",
211 arc_reg->
is_core ?
", core" :
"", arc_reg->
is_bcr ?
", bcr" :
"",
230 LOG_DEBUG(
"Get register (cached) gdb_num=%" PRIu32
", name=%s, value=0x%" PRIx32,
238 LOG_ERROR(
"It is forbidden to read core registers 61 and 62.");
258 LOG_DEBUG(
"Get register gdb_num=%" PRIu32
", name=%s, value=0x%" PRIx32,
279 LOG_ERROR(
"It is forbidden to write core registers 61 and 62.");
284 LOG_DEBUG(
"Set register gdb_num=%" PRIu32
", name=%s, value=0x%08" PRIx32,
354 struct reg_cache *cache = calloc(1,
sizeof(*cache));
355 struct reg *reg_list = calloc(num_regs,
sizeof(*reg_list));
357 if (!cache || !reg_list) {
363 cache->
name =
"arc registers";
371 LOG_ERROR(
"No core registers were defined");
378 LOG_DEBUG(
"reg n=%3li name=%3s group=%s feature=%s", i,
386 LOG_ERROR(
"No aux registers were defined");
393 LOG_DEBUG(
"reg n=%3li name=%3s group=%s feature=%s", i,
398 if (!strcmp(
"pc", reg_desc->
name)) {
400 LOG_ERROR(
"Double definition of PC in configuration");
404 }
else if (!strcmp(
"debug", reg_desc->
name)) {
406 LOG_ERROR(
"Double definition of DEBUG in configuration");
416 LOG_ERROR(
"`pc' and `debug' registers must be present in target description.");
441 struct reg_cache *cache = malloc(
sizeof(*cache));
442 struct reg *reg_list = calloc(num_regs,
sizeof(*reg_list));
448 if (!cache || !reg_list) {
454 cache->
name =
"arc.bcr";
462 LOG_ERROR(
"No BCR registers are defined");
470 reg_list[i].
exist =
true;
472 LOG_DEBUG(
"reg n=%3li name=%3s group=%s feature=%s", i,
501 *reg_list = calloc(*reg_list_size,
sizeof(
struct reg *));
524 LOG_DEBUG(
"REG_CLASS_ALL: number of regs=%i", *reg_list_size);
527 unsigned long gdb_reg_number = 0;
530 for (
unsigned int j = 0;
542 LOG_DEBUG(
"REG_CLASS_GENERAL: number of regs=%i", *reg_list_size);
550 const char *field_name, uint32_t *value_ptr)
554 LOG_DEBUG(
"getting register field (reg_name=%s, field_name=%s)", reg_name, field_name);
560 LOG_ERROR(
"Requested register `%s' doesn't exist.", reg_name);
571 for (field = reg_struct->
fields;
573 field = field->
next) {
574 if (!strcmp(field->
name, field_name))
620 if (!(
target && reg_name)) {
630 uint8_t value_buf[4];
642 uint32_t dccm_build_version, dccm_build_size0, dccm_build_size1;
644 &dccm_build_version));
651 if ((dccm_build_version == 3 || dccm_build_version == 4) && dccm_build_size0 > 0) {
653 uint32_t dccm_size = 0x100;
654 dccm_size <<= dccm_build_size0;
655 if (dccm_build_size0 == 0xF)
656 dccm_size <<= dccm_build_size1;
658 LOG_DEBUG(
"DCCM detected start=0x%" PRIx32
" end=0x%" PRIx32,
673 uint32_t iccm_build_version, iccm_build_size00, iccm_build_size01;
674 uint32_t aux_iccm = 0;
676 &iccm_build_version));
678 &iccm_build_size00));
680 &iccm_build_size01));
681 if (iccm_build_version == 4 && iccm_build_size00 > 0) {
683 uint32_t iccm0_size = 0x100;
684 iccm0_size <<= iccm_build_size00;
685 if (iccm_build_size00 == 0xF)
686 iccm0_size <<= iccm_build_size01;
690 LOG_DEBUG(
"ICCM0 detected start=0x%" PRIx32
" end=0x%" PRIx32,
695 uint32_t iccm_build_size10, iccm_build_size11;
697 &iccm_build_size10));
699 &iccm_build_size11));
700 if (iccm_build_version == 4 && iccm_build_size10 > 0) {
704 uint32_t iccm1_size = 0x100;
705 iccm1_size <<= iccm_build_size10;
706 if (iccm_build_size10 == 0xF)
707 iccm1_size <<= iccm_build_size11;
710 LOG_DEBUG(
"ICCM1 detected start=0x%" PRIx32
" end=0x%" PRIx32,
719 LOG_DEBUG(
"Configuring ARC ICCM and DCCM");
773 LOG_DEBUG(
"core stopped (halted) debug-reg: 0x%08" PRIx32, value);
775 LOG_DEBUG(
"core STATUS32: 0x%08" PRIx32, value);
794 LOG_WARNING(
"target was in unknown state when halt was requested");
798 LOG_ERROR(
"can't request a halt while in reset if nSRST pulls nTRST");
828 LOG_DEBUG(
"core stopped (halted) DEGUB-REG: 0x%08" PRIx32, value);
830 LOG_DEBUG(
"core STATUS32: 0x%08" PRIx32, value);
849 LOG_DEBUG(
"Saving aux and core registers values");
854 const uint32_t core_regs_size = arc->
num_core_regs *
sizeof(uint32_t);
857 const uint32_t regs_to_scan =
859 const uint32_t aux_regs_size = arc->
num_aux_regs *
sizeof(uint32_t);
860 uint32_t *core_values = malloc(core_regs_size);
861 uint32_t *aux_values = malloc(aux_regs_size);
862 uint32_t *core_addrs = malloc(core_regs_size);
863 uint32_t *aux_addrs = malloc(aux_regs_size);
864 unsigned int core_cnt = 0;
865 unsigned int aux_cnt = 0;
867 if (!core_values || !core_addrs || !aux_values || !aux_addrs) {
873 memset(core_values, 0xff, core_regs_size);
874 memset(core_addrs, 0xff, core_regs_size);
875 memset(aux_values, 0xff, aux_regs_size);
876 memset(aux_addrs, 0xff, aux_regs_size);
879 struct reg *
reg = reg_list + i;
882 core_addrs[core_cnt++] = arc_reg->
arch_num;
886 struct reg *
reg = reg_list + i;
889 aux_addrs[aux_cnt++] = arc_reg->
arch_num;
896 LOG_ERROR(
"Attempt to read core registers failed.");
904 LOG_ERROR(
"Attempt to read aux registers failed.");
913 struct reg *
reg = reg_list + i;
919 LOG_DEBUG(
"Get core register regnum=%u, name=%s, value=0x%08" PRIx32,
920 i, arc_reg->
name, core_values[core_cnt]);
928 struct reg *
reg = reg_list + i;
934 LOG_DEBUG(
"Get aux register regnum=%u, name=%s, value=0x%08" PRIx32,
935 i, arc_reg->
name, aux_values[aux_cnt]);
975 for (ap = 0; debug_asr > 1; debug_asr >>= 1)
1011 if (!actionpoint->
used)
1012 LOG_WARNING(
"Target halted by an unused actionpoint.");
1060 LOG_DEBUG(
"ARC core in halt or reset state.");
1067 LOG_DEBUG(
"Discrepancy of STATUS32[0] HALT bit and ARC_JTAG_STAT_RU, "
1068 "target is still running");
1074 LOG_DEBUG(
"ARC core is in debug running mode");
1104 LOG_DEBUG(
"Starting CPU execution after reset");
1158 LOG_DEBUG(
"target state: %s; PC at: 0x%08" PRIx32,
1177 LOG_DEBUG(
"Restoring registers values");
1180 const uint32_t core_regs_size = arc->
num_core_regs *
sizeof(uint32_t);
1181 const uint32_t aux_regs_size = arc->
num_aux_regs *
sizeof(uint32_t);
1182 uint32_t *core_values = malloc(core_regs_size);
1183 uint32_t *aux_values = malloc(aux_regs_size);
1184 uint32_t *core_addrs = malloc(core_regs_size);
1185 uint32_t *aux_addrs = malloc(aux_regs_size);
1186 unsigned int core_cnt = 0;
1187 unsigned int aux_cnt = 0;
1189 if (!core_values || !core_addrs || !aux_values || !aux_addrs) {
1195 memset(core_values, 0xff, core_regs_size);
1196 memset(core_addrs, 0xff, core_regs_size);
1197 memset(aux_values, 0xff, aux_regs_size);
1198 memset(aux_addrs, 0xff, aux_regs_size);
1201 struct reg *
reg = &(reg_list[i]);
1205 core_addrs[core_cnt] = arc_reg->
arch_num;
1216 aux_addrs[aux_cnt] = arc_reg->
arch_num;
1227 LOG_ERROR(
"Attempt to write to core registers failed.");
1236 LOG_ERROR(
"Attempt to write to aux registers failed.");
1275 int handle_breakpoints,
int debug_execution)
1278 uint32_t resume_pc = 0;
1283 " debug_execution:%i", current, address, handle_breakpoints, debug_execution);
1295 if (!debug_execution) {
1311 resume_pc = address;
1317 LOG_DEBUG(
"Target resumes from PC=0x%" PRIx32
", pc.dirty=%i, pc.valid=%i",
1323 LOG_DEBUG(
"resume Core (when start-core) with PC @:0x%08" PRIx32,
value);
1328 if (handle_breakpoints) {
1341 if (!debug_execution)
1358 if (!debug_execution) {
1361 LOG_DEBUG(
"target resumed at 0x%08" PRIx32, resume_pc);
1365 LOG_DEBUG(
"target debug resumed at 0x%08" PRIx32, resume_pc);
1389 LOG_DEBUG(
"deinitialization of target");
1401 free(
type->reg_type_struct_field);
1402 free(
type->bitfields);
1405 free(
type->reg_type_flags_field);
1406 free(
type->bitfields);
1431 struct arc_common *arc = calloc(1,
sizeof(*arc));
1453 uint8_t value_buf[4];
1459 LOG_DEBUG(
"Address: 0x%08" PRIx32
", value: 0x%08" PRIx32, address,
1480 uint8_t value_buf[4];
1495 LOG_DEBUG(
"Address: 0x%08" PRIx32
", value: 0x%08" PRIx32, address,
1509 uint32_t match_value, uint32_t control_tt, uint32_t control_at)
1516 LOG_ERROR(
"No free actionpoints, maximum amount is %u",
1525 char ap_amv_reg_name[24], ap_amm_reg_name[24], ap_ac_reg_name[24];
1526 snprintf(ap_amv_reg_name, 24,
"ap_amv%" PRIu32, ap_num);
1527 snprintf(ap_amm_reg_name, 24,
"ap_amm%" PRIu32, ap_num);
1528 snprintf(ap_ac_reg_name, 24,
"ap_ac%" PRIu32, ap_num);
1533 control_tt | control_at));
1536 char ap_ac_reg_name[24];
1537 snprintf(ap_ac_reg_name, 24,
"ap_ac%" PRIu32, ap_num);
1558 uint32_t verify = 0xffffffff;
1574 uint16_t verify = 0xffff;
1587 LOG_ERROR(
"Invalid breakpoint length: target supports only 2 or 4");
1595 unsigned int bp_num;
1598 if (!ap_list[bp_num].
used)
1603 LOG_ERROR(
"No free actionpoints, maximum amount is %u",
1613 ap_list[bp_num].
used = 1;
1617 LOG_DEBUG(
"bpid: %" PRIu32
", bp_num %u bp_value 0x%" PRIx32,
1622 LOG_DEBUG(
"ERROR: setting unknown breakpoint type");
1643 uint32_t current_instr;
1655 " has been overwritten outside of debugger."
1656 "Expected: @0x%x, got: @0x%" PRIx32,
1660 uint16_t current_instr;
1671 " has been overwritten outside of debugger. "
1672 "Expected: 0x%04x, got: 0x%04" PRIx16,
1676 LOG_ERROR(
"Invalid breakpoint length: target supports only 2 or 4");
1687 LOG_DEBUG(
"Invalid actionpoint ID: %u in breakpoint: %" PRIu32,
1697 ap_list[bp_num].
used = 0;
1700 LOG_DEBUG(
"bpid: %" PRIu32
" - released actionpoint ID: %u",
1704 LOG_DEBUG(
"ERROR: unsetting unknown breakpoint type");
1771 if ((ap_list[i].used) && (ap_list[i].reg_address))
1801 uint32_t auxreg_addr, uint32_t transaction)
1803 unsigned int ap_num = 0;
1812 while (ap_list[ap_num].
used)
1816 LOG_ERROR(
"No actionpoint free, maximum amount is %u",
1825 ap_list[ap_num].
used = 1;
1835 bool ap_found =
false;
1836 unsigned int ap_num = 0;
1844 while ((ap_list[ap_num].
used) && (ap_num < arc->actionpoints_num)) {
1857 ap_list[ap_num].
used = 0;
1861 LOG_ERROR(
"Register actionpoint not found");
1870 unsigned int wp_num;
1880 if (!ap_list[wp_num].
used)
1885 LOG_ERROR(
"No free actionpoints, maximum amount is %u",
1891 LOG_ERROR(
"Only watchpoints of length 4 are supported");
1907 LOG_ERROR(
"BUG: watchpoint->rw neither read, write nor access");
1916 ap_list[wp_num].
used = 1;
1920 LOG_DEBUG(
"wpid: %" PRIu32
", wp_num %u wp_value 0x%" PRIx32,
1941 LOG_DEBUG(
"Invalid actionpoint ID: %u in watchpoint: %" PRIu32,
1951 ap_list[wp_num].
used = 0;
1954 LOG_DEBUG(
"wpid: %" PRIu32
" - releasing actionpoint ID: %u",
2005 assert(hit_watchpoint);
2011 if (!actionpoint->
used)
2012 LOG_WARNING(
"Target halted by unused actionpoint.");
2016 LOG_WARNING(
"Target halted by breakpoint, but is treated as a watchpoint.");
2023 LOG_DEBUG(
"Hit watchpoint, wpid: %" PRIu32
", watchpoint num: %u",
2048 LOG_DEBUG(
" [status32:0x%08" PRIx32
"]", value);
2057 LOG_DEBUG(
"core debug step mode enabled [debug-reg:0x%08" PRIx32
"]", value);
2065 LOG_DEBUG(
"core debug step mode disabled");
2088 int handle_breakpoints)
2107 LOG_DEBUG(
"Target steps one instruction from PC=0x%" PRIx32,
2111 if (handle_breakpoints) {
2175 uint32_t value, dc_ctrl_value;
2185 dc_ctrl_value = value;
2204 uint32_t value, slc_ctrl_value;
2214 slc_ctrl_value = value;
2224 LOG_DEBUG(
"Waiting for invalidation end.");
2253 uint32_t value, dc_ctrl_value;
2254 bool has_to_set_dc_ctrl_im;
2268 has_to_set_dc_ctrl_im = (dc_ctrl_value &
DC_CTRL_IM) == 0;
2269 if (has_to_set_dc_ctrl_im) {
2279 if (has_to_set_dc_ctrl_im)
2332 .target_request_data =
NULL,
2342 .soft_reset_halt =
NULL,
2348 .checksum_memory =
NULL,
2349 .blank_check_memory =
NULL,
2352 .add_context_breakpoint =
NULL,
2353 .add_hybrid_breakpoint =
NULL,
2359 .run_algorithm =
NULL,
2360 .start_algorithm =
NULL,
2361 .wait_algorithm =
NULL,
2371 .read_phys_memory =
NULL,
2372 .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....
static int arc_enable_breakpoints(struct target *target)
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_single_step_core(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_enable_watchpoints(struct target *target)
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_exit_debug(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 int first, unsigned int 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 int first, unsigned int 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_for_each_entry_safe_reverse(p, n, h, field)
#define list_first_entry(ptr, type, member)
static void list_add_tail(struct list_head *new, struct list_head *head)
static int list_empty(const struct list_head *head)
#define list_for_each_entry_safe(p, n, h, field)
#define list_for_each_entry(p, h, field)
static void INIT_LIST_HEAD(struct list_head *list)
void alive_sleep(uint64_t ms)
#define LOG_WARNING(expr ...)
#define LOG_TARGET_ERROR(target, fmt_str,...)
#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
unsigned 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)
void target_free_all_working_areas(struct target *target)
int target_halt(struct target *target)
void target_buffer_set_u32(struct target *target, uint8_t *buffer, uint32_t value)
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)
const char * target_state_name(const struct target *t)
Return the name of this targets current state.
int target_read_u16(struct target *target, target_addr_t address, uint16_t *value)
bool target_has_event_action(const struct target *target, enum target_event event)
Returns true only if the target has a handler for the specified event.
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
static bool target_was_examined(const struct target *target)
#define ERROR_TARGET_UNALIGNED_ACCESS
@ TARGET_EVENT_DEBUG_RESUMED
@ TARGET_EVENT_DEBUG_HALTED
@ TARGET_EVENT_RESET_ASSERT
static const char * target_name(const 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.
#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)