cortex_m: mark FPU register as non-existent instead of playing with num_regs
Change-Id: Iac7c5bfbb95c8d9a8c6d65104d138692a44eca78 Signed-off-by: Tarek BOCHKATI <tarek.bouchkati@gmail.com> Reviewed-on: http://openocd.zylin.com/6015 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
parent
fd40d09676
commit
ef0da79448
|
@ -164,7 +164,12 @@ enum {
|
|||
/* Floating-point status register */
|
||||
ARMV7M_FPSCR,
|
||||
|
||||
/* for convenience add registers' block delimiters */
|
||||
ARMV7M_LAST_REG,
|
||||
ARMV7M_CORE_FIRST_REG = ARMV7M_R0,
|
||||
ARMV7M_CORE_LAST_REG = ARMV7M_xPSR,
|
||||
ARMV7M_FPU_FIRST_REG = ARMV7M_D0,
|
||||
ARMV7M_FPU_LAST_REG = ARMV7M_FPSCR,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
@ -174,8 +179,7 @@ enum {
|
|||
FPV5_DP,
|
||||
};
|
||||
|
||||
#define ARMV7M_NUM_CORE_REGS (ARMV7M_xPSR + 1)
|
||||
#define ARMV7M_NUM_CORE_REGS_NOFP (ARMV7M_CONTROL + 1)
|
||||
#define ARMV7M_NUM_CORE_REGS (ARMV7M_CORE_LAST_REG - ARMV7M_CORE_FIRST_REG + 1)
|
||||
|
||||
#define ARMV7M_COMMON_MAGIC 0x2A452A45
|
||||
|
||||
|
|
|
@ -2038,19 +2038,11 @@ int cortex_m_examine(struct target *target)
|
|||
armv7m->arm.is_armv6m = true;
|
||||
}
|
||||
|
||||
if (armv7m->fp_feature == FP_NONE &&
|
||||
armv7m->arm.core_cache->num_regs > ARMV7M_NUM_CORE_REGS_NOFP) {
|
||||
/* free unavailable FPU registers */
|
||||
size_t idx;
|
||||
/* Check for FPU, otherwise mark FPU register as non-existent */
|
||||
if (armv7m->fp_feature == FP_NONE)
|
||||
for (size_t idx = ARMV7M_FPU_FIRST_REG; idx <= ARMV7M_FPU_LAST_REG; idx++)
|
||||
armv7m->arm.core_cache->reg_list[idx].exist = false;
|
||||
|
||||
for (idx = ARMV7M_NUM_CORE_REGS_NOFP;
|
||||
idx < armv7m->arm.core_cache->num_regs;
|
||||
idx++) {
|
||||
free(armv7m->arm.core_cache->reg_list[idx].feature);
|
||||
free(armv7m->arm.core_cache->reg_list[idx].reg_data_type);
|
||||
}
|
||||
armv7m->arm.core_cache->num_regs = ARMV7M_NUM_CORE_REGS_NOFP;
|
||||
}
|
||||
|
||||
if (!armv7m->stlink) {
|
||||
if (i == 3 || i == 4)
|
||||
|
|
Loading…
Reference in New Issue