.valid = 1,
.size = 96,
.arch_info = NULL,
- .arch_type = 0,
};
static uint8_t armv7m_gdb_dummy_fps_value[4];
.valid = 1,
.size = 32,
.arch_info = NULL,
- .arch_type = 0,
};
#ifdef ARMV7_GDB_HACKS
.valid = 1,
.size = 32,
.arch_info = NULL,
- .arch_type = 0,
};
#endif
#define ARMV7M_NUM_REGS ARRAY_SIZE(armv7m_regs)
-static int armv7m_core_reg_arch_type = -1;
-
/**
* Restores target context using the cache of core registers set up
* by armv7m_build_reg_cache(), calling optional core-specific hooks.
return ERROR_OK;
}
+static const struct reg_arch_type armv7m_reg_type = {
+ .get = armv7m_get_core_reg,
+ .set = armv7m_set_core_reg,
+};
/** Builds cache of architecturally defined registers. */
struct reg_cache *armv7m_build_reg_cache(struct target *target)
struct armv7m_core_reg *arch_info = calloc(num_regs, sizeof(struct armv7m_core_reg));
int i;
- if (armv7m_core_reg_arch_type == -1)
- {
- armv7m_core_reg_arch_type = register_reg_arch_type(armv7m_get_core_reg, armv7m_set_core_reg);
- }
-
register_init_dummy(&armv7m_gdb_dummy_fps_reg);
#ifdef ARMV7_GDB_HACKS
register_init_dummy(&armv7m_gdb_dummy_cpsr_reg);
reg_list[i].value = calloc(1, 4);
reg_list[i].dirty = 0;
reg_list[i].valid = 0;
- reg_list[i].arch_type = armv7m_core_reg_arch_type;
+ reg_list[i].type = &armv7m_reg_type;
reg_list[i].arch_info = &arch_info[i];
}