Remove misleading typedef and redundant suffix from struct armv7m_common.
int armv7m_restore_context(target_t *target)
{
int i;
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
LOG_DEBUG(" ");
int retval;
armv7m_core_reg_t *armv7m_reg = reg->arch_info;
target_t *target = armv7m_reg->target;
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
if (target->state != TARGET_HALTED)
{
uint32_t reg_value;
int retval;
armv7m_core_reg_t * armv7m_core_reg;
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
if ((num < 0) || (num >= ARMV7M_NUM_REGS))
return ERROR_INVALID_ARGUMENTS;
int retval;
uint32_t reg_value;
armv7m_core_reg_t *armv7m_core_reg;
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
if ((num < 0) || (num >= ARMV7M_NUM_REGS))
return ERROR_INVALID_ARGUMENTS;
/** Invalidates cache of core registers set up by armv7m_build_reg_cache(). */
int armv7m_invalidate_core_regs(target_t *target)
{
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
int i;
for (i = 0; i < armv7m->core_cache->num_regs; i++)
*/
int armv7m_get_gdb_reg_list(target_t *target, reg_t **reg_list[], int *reg_list_size)
{
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
int i;
*reg_list_size = 26;
}
/* run to exit point. return error if exit point was not reached. */
-static int armv7m_run_and_wait(struct target_s *target, uint32_t entry_point, int timeout_ms, uint32_t exit_point, armv7m_common_t *armv7m)
+static int armv7m_run_and_wait(struct target_s *target, uint32_t entry_point, int timeout_ms, uint32_t exit_point, struct armv7m_common *armv7m)
{
uint32_t pc;
int retval;
uint32_t entry_point, uint32_t exit_point,
int timeout_ms, void *arch_info)
{
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
armv7m_algorithm_t *armv7m_algorithm_info = arch_info;
enum armv7m_mode core_mode = armv7m->core_mode;
int retval = ERROR_OK;
/** Logs summary of ARMv7-M state for a halted target. */
int armv7m_arch_state(struct target_s *target)
{
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
uint32_t ctrl, sp;
ctrl = buf_get_u32(armv7m->core_cache->reg_list[ARMV7M_CONTROL].value, 0, 32);
/** Builds cache of architecturally defined registers. */
reg_cache_t *armv7m_build_reg_cache(target_t *target)
{
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
int num_regs = ARMV7M_NUM_REGS;
reg_cache_t **cache_p = register_get_last_cache_p(&target->reg_cache);
reg_cache_t *cache = malloc(sizeof(reg_cache_t));
}
/** Sets up target as a generic ARMv7-M core */
-int armv7m_init_arch_info(target_t *target, armv7m_common_t *armv7m)
+int armv7m_init_arch_info(target_t *target, struct armv7m_common *armv7m)
{
/* register arch-specific functions */
COMMAND_HANDLER(handle_dap_baseaddr_command)
{
target_t *target = get_current_target(cmd_ctx);
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
uint32_t apsel, apselsave, baseaddr;
int retval;
COMMAND_HANDLER(handle_dap_apid_command)
{
target_t *target = get_current_target(cmd_ctx);
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
return CALL_COMMAND_HANDLER(dap_apid_command, swjdp);
COMMAND_HANDLER(handle_dap_apsel_command)
{
target_t *target = get_current_target(cmd_ctx);
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
return CALL_COMMAND_HANDLER(dap_apsel_command, swjdp);
COMMAND_HANDLER(handle_dap_memaccess_command)
{
target_t *target = get_current_target(cmd_ctx);
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
return CALL_COMMAND_HANDLER(dap_memaccess_command, swjdp);
COMMAND_HANDLER(handle_dap_info_command)
{
target_t *target = get_current_target(cmd_ctx);
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
uint32_t apsel;
#define ARMV7M_COMMON_MAGIC 0x2A452A45
-typedef struct armv7m_common_s
+struct armv7m_common
{
int common_magic;
reg_cache_t *core_cache;
void (*pre_restore_context)(target_t *target);
void (*post_restore_context)(target_t *target);
-} armv7m_common_t;
+};
-static inline struct armv7m_common_s *
+static inline struct armv7m_common *
target_to_armv7m(struct target_s *target)
{
return target->arch_info;
uint32_t num;
enum armv7m_regtype type;
target_t *target;
- armv7m_common_t *armv7m_common;
+ struct armv7m_common *armv7m_common;
} armv7m_core_reg_t;
reg_cache_t *armv7m_build_reg_cache(target_t *target);
reg_t **reg_list[], int *reg_list_size);
int armv7m_register_commands(struct command_context_s *cmd_ctx);
-int armv7m_init_arch_info(target_t *target, armv7m_common_t *armv7m);
+int armv7m_init_arch_info(target_t *target, struct armv7m_common *armv7m);
int armv7m_run_algorithm(struct target_s *target,
int num_mem_params, struct mem_param *mem_params,
static int cortex_m3_examine_exception_reason(target_t *target)
{
uint32_t shcsr, except_sr, cfsr = -1, except_ar = -1;
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
mem_ap_read_u32(swjdp, NVIC_SHCSR, &shcsr);
uint32_t xPSR;
int retval;
struct cortex_m3_common_s *cortex_m3 = target_to_cm3(target);
- struct armv7m_common_s *armv7m = &cortex_m3->armv7m;
+ struct armv7m_common *armv7m = &cortex_m3->armv7m;
struct swjdp_common *swjdp = &armv7m->swjdp_info;
LOG_DEBUG(" ");
static int cortex_m3_resume(struct target_s *target, int current,
uint32_t address, int handle_breakpoints, int debug_execution)
{
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
breakpoint_t *breakpoint = NULL;
uint32_t resume_pc;
uint32_t address, int handle_breakpoints)
{
struct cortex_m3_common_s *cortex_m3 = target_to_cm3(target);
- struct armv7m_common_s *armv7m = &cortex_m3->armv7m;
+ struct armv7m_common *armv7m = &cortex_m3->armv7m;
struct swjdp_common *swjdp = &armv7m->swjdp_info;
breakpoint_t *breakpoint = NULL;
enum armv7m_regtype type, uint32_t num, uint32_t * value)
{
int retval;
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
/* NOTE: we "know" here that the register identifiers used
{
int retval;
uint32_t reg;
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
#ifdef ARMV7_GDB_HACKS
static int cortex_m3_read_memory(struct target_s *target, uint32_t address,
uint32_t size, uint32_t count, uint8_t *buffer)
{
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
int retval;
static int cortex_m3_write_memory(struct target_s *target, uint32_t address,
uint32_t size, uint32_t count, uint8_t *buffer)
{
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
int retval;
static int cortex_m3_target_request_data(target_t *target,
uint32_t size, uint8_t *buffer)
{
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
uint8_t data;
uint8_t ctrl;
target_t *target = priv;
if (!target_was_examined(target))
return ERROR_OK;
- struct armv7m_common_s *armv7m = target_to_armv7m(target);
+ struct armv7m_common *armv7m = target_to_armv7m(target);
struct swjdp_common *swjdp = &armv7m->swjdp_info;
if (!target->dbg_msg_enabled)
cortex_m3_common_t *cortex_m3, struct jtag_tap *tap)
{
int retval;
- struct armv7m_common_s *armv7m = &cortex_m3->armv7m;
+ struct armv7m_common *armv7m = &cortex_m3->armv7m;
armv7m_init_arch_info(target, armv7m);
{
target_t *target = get_current_target(cmd_ctx);
struct cortex_m3_common_s *cortex_m3 = target_to_cm3(target);
- struct armv7m_common_s *armv7m = &cortex_m3->armv7m;
+ struct armv7m_common *armv7m = &cortex_m3->armv7m;
struct swjdp_common *swjdp = &armv7m->swjdp_info;
uint32_t demcr = 0;
int retval;
cortex_m3_dwt_comparator_t *dwt_comparator_list;
struct reg_cache_s *dwt_cache;
- armv7m_common_t armv7m;
+ struct armv7m_common armv7m;
} cortex_m3_common_t;
static inline struct cortex_m3_common_s *