26 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
"r8",
27 "r9",
"r10",
"r11",
"r12",
"sp",
"lr",
"pc",
"sr"
120 LOG_DEBUG(
"write core reg %i value 0x%" PRIx32
"", num, reg_value);
168 struct reg *reg_list = calloc(num_regs,
sizeof(
struct reg));
174 cache->
name =
"avr32 registers";
181 for (i = 0; i < num_regs; i++) {
186 reg_list[i].
size = 32;
187 reg_list[i].
value = calloc(1, 4);
188 reg_list[i].
dirty =
false;
189 reg_list[i].
valid =
false;
269 LOG_WARNING(
"target was in unknown state when halt was requested");
273 LOG_ERROR(
"can't request a halt while in reset if nSRST pulls nTRST");
304 target_addr_t address,
int handle_breakpoints,
int debug_execution)
316 if (!debug_execution) {
336 if (handle_breakpoints) {
343 avr32_ap7k_single_step_core(
target);
351 avr32_ap7k_enable_interrupts(
target, !debug_execution);
372 if (!debug_execution) {
375 LOG_DEBUG(
"target resumed at 0x%" PRIx32
"", resume_pc);
379 LOG_DEBUG(
"target debug resumed at 0x%" PRIx32
"", resume_pc);
442 if (((
size == 4) && (address & 0x3u)) || ((
size == 2) && (address & 0x1u)))
448 (uint32_t *)(
void *)
buffer);
452 (uint16_t *)(
void *)
buffer);
482 if (((
size == 4) && (address & 0x3u)) || ((
size == 2) && (address & 0x1u)))
488 (uint32_t *)(
void *)
buffer);
492 (uint16_t *)(
void *)
buffer);
532 LOG_INFO(
"device id: %08" PRIx32, devid);
551 LOG_USER(
"target halted due to %s, pc: 0x%8.8" PRIx32
"",
566 *reg_list = malloc(
sizeof(
struct reg *) * (*reg_list_size));
569 (*reg_list)[i] = &mips32->core_cache->reg_list[i];
573 (*reg_list)[i] = &avr32_ap7k_gdb_dummy_fp_reg;
582 .
name =
"avr32_ap7k",
struct target_type avr32_ap7k_target
static int avr32_ap7k_deassert_reset(struct target *target)
static int avr32_ap7k_target_create(struct target *target, Jim_Interp *interp)
static int avr32_ap7k_debug_entry(struct target *target)
static const struct avr32_core_reg avr32_core_reg_list_arch_info[AVR32NUMCOREREGS]
static int avr32_ap7k_examine(struct target *target)
static int avr32_ap7k_poll(struct target *target)
static int avr32_ap7k_save_context(struct target *target)
static int avr32_ap7k_restore_context(struct target *target)
static int avr32_ap7k_arch_state(struct target *target)
static struct reg_cache * avr32_build_reg_cache(struct target *target)
static int avr32_ap7k_read_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, uint8_t *buffer)
static int avr32_ap7k_assert_reset(struct target *target)
static int avr32_ap7k_resume(struct target *target, int current, target_addr_t address, int handle_breakpoints, int debug_execution)
static const struct reg_arch_type avr32_reg_type
static int avr32_ap7k_step(struct target *target, int current, target_addr_t address, int handle_breakpoints)
static int avr32_ap7k_halt(struct target *target)
static int avr32_read_core_reg(struct target *target, int num)
static int avr32_ap7k_add_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int avr32_ap7k_remove_breakpoint(struct target *target, struct breakpoint *breakpoint)
static int avr32_ap7k_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int *reg_list_size, enum target_register_class reg_class)
static const char *const avr32_core_reg_list[]
static int avr32_ap7k_init_target(struct command_context *cmd_ctx, struct target *target)
static int avr32_ap7k_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int avr32_set_core_reg(struct reg *reg, uint8_t *buf)
static int avr32_get_core_reg(struct reg *reg)
static int avr32_ap7k_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
static int avr32_write_core_reg(struct target *target, int num)
static int avr32_ap7k_write_memory(struct target *target, target_addr_t address, uint32_t size, uint32_t count, const uint8_t *buffer)
#define AP7K_COMMON_MAGIC
static struct avr32_ap7k_common * target_to_ap7k(struct target *target)
int avr32_jtag_exec(struct avr32_jtag *jtag_info, uint32_t inst)
int avr32_ocd_setbits(struct avr32_jtag *jtag, int reg, uint32_t bits)
int avr32_ocd_clearbits(struct avr32_jtag *jtag, int reg, uint32_t bits)
int avr32_jtag_nexus_read(struct avr32_jtag *jtag_info, uint32_t addr, uint32_t *value)
#define AVR32_OCDREG_DINST
int avr32_jtag_read_memory32(struct avr32_jtag *jtag_info, uint32_t addr, int count, uint32_t *buffer)
int avr32_jtag_write_memory32(struct avr32_jtag *jtag_info, uint32_t addr, int count, const uint32_t *buffer)
int avr32_jtag_read_memory16(struct avr32_jtag *jtag_info, uint32_t addr, int count, uint16_t *buffer)
int avr32_jtag_write_memory16(struct avr32_jtag *jtag_info, uint32_t addr, int count, const uint16_t *buffer)
int avr32_jtag_read_memory8(struct avr32_jtag *jtag_info, uint32_t addr, int count, uint8_t *buffer)
int avr32_jtag_write_memory8(struct avr32_jtag *jtag_info, uint32_t addr, int count, const uint8_t *buffer)
int avr32_jtag_read_regs(struct avr32_jtag *jtag_info, uint32_t *regs)
int avr32_jtag_write_regs(struct avr32_jtag *jtag_info, uint32_t *regs)
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)
#define ERROR_COMMAND_SYNTAX_ERROR
enum reset_types jtag_get_reset_config(void)
The JTAG interface can be implemented with a software or hardware fifo.
#define LOG_USER(expr ...)
#define LOG_WARNING(expr ...)
#define LOG_TARGET_ERROR(target, fmt_str,...)
#define LOG_ERROR(expr ...)
#define LOG_INFO(expr ...)
#define LOG_DEBUG(expr ...)
int mips_ejtag_exit_debug(struct mips_ejtag *ejtag_info)
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).
size_t size
Size of the control block search area.
struct reg_cache * core_cache
uint32_t core_regs[AVR32NUMCOREREGS]
unsigned int common_magic
struct avr32_ap7k_common * avr32_common
int(* get)(struct reg *reg)
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
struct reg_cache * reg_cache
int target_call_event_callbacks(struct target *target, enum target_event event)
void target_free_all_working_areas(struct target *target)
const char * target_state_name(const struct target *t)
Return the name of this targets current state.
const char * debug_reason_name(const struct target *t)
#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
static void target_set_examined(struct target *target)
Sets the examined flag for the given target.
#define ERROR_TARGET_FAILURE