arm/armv[7|8]m: compare of hardware fp registers should skip REG_FP_RESERVED

Fix fpu test break

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2022-04-21 12:12:46 +08:00 committed by Masayuki Ishikawa
parent 64e4c9ca02
commit 875c5dac75
4 changed files with 8 additions and 4 deletions

View File

@ -53,7 +53,10 @@ bool up_fpucmp(const void *saveregs1, const void *saveregs2)
const uint32_t *regs1 = saveregs1;
const uint32_t *regs2 = saveregs2;
return memcmp(&regs1[REG_S0], &regs2[REG_S0], 4 * HW_FPU_REGS) == 0 &&
/* compare of hardware fp registers should skip REG_FP_RESERVED */
return memcmp(&regs1[REG_S0], &regs2[REG_S0],
4 * (HW_FPU_REGS - 1)) == 0 &&
memcmp(&regs1[REG_S16], &regs2[REG_S16], 4 * SW_FPU_REGS) == 0;
}
#endif /* CONFIG_ARCH_FPU */

View File

@ -146,7 +146,6 @@ void up_initial_state(struct tcb_s *tcb)
#ifdef CONFIG_ARCH_FPU
xcp->regs[REG_FPSCR] = 0; /* REVISIT: Initial FPSCR should be configurable */
xcp->regs[REG_FP_RESERVED] = 0;
#endif /* CONFIG_ARCH_FPU */
/* Enable or disable interrupts, based on user configuration */

View File

@ -53,7 +53,10 @@ bool up_fpucmp(const void *saveregs1, const void *saveregs2)
const uint32_t *regs1 = saveregs1;
const uint32_t *regs2 = saveregs2;
return memcmp(&regs1[REG_S0], &regs2[REG_S0], 4 * HW_FPU_REGS) == 0 &&
/* compare of hardware fp registers should skip REG_FP_RESERVED */
return memcmp(&regs1[REG_S0], &regs2[REG_S0],
4 * (HW_FPU_REGS - 1)) == 0 &&
memcmp(&regs1[REG_S16], &regs2[REG_S16], 4 * SW_FPU_REGS) == 0;
}
#endif /* CONFIG_ARCH_FPU */

View File

@ -152,7 +152,6 @@ void up_initial_state(struct tcb_s *tcb)
#ifdef CONFIG_ARCH_FPU
xcp->regs[REG_FPSCR] |= ARMV8M_FPSCR_LTPSIZE_NONE;
xcp->regs[REG_FP_RESERVED] = 0;
#endif /* CONFIG_ARCH_FPU */
/* Enable or disable interrupts, based on user configuration */