arch: arm: aarch32: Create a fpu stack frame
Grouping the FPU registers together will make adding FPU support for Cortex-A/R easier later. It provides the ability to get the sizeof and offsetof FPU registers easier. Signed-off-by: Bradley Bolen <bbolen@lexmark.com>
This commit is contained in:
parent
3f7162fc07
commit
7c1e399179
4 changed files with 23 additions and 14 deletions
|
@ -25,15 +25,15 @@ static void esf_dump(const z_arch_esf_t *esf)
|
||||||
esf->basic.a4, esf->basic.ip, esf->basic.lr);
|
esf->basic.a4, esf->basic.ip, esf->basic.lr);
|
||||||
LOG_ERR(" xpsr: 0x%08x", esf->basic.xpsr);
|
LOG_ERR(" xpsr: 0x%08x", esf->basic.xpsr);
|
||||||
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
||||||
for (int i = 0; i < ARRAY_SIZE(esf->s); i += 4) {
|
for (int i = 0; i < ARRAY_SIZE(esf->fpu.s); i += 4) {
|
||||||
LOG_ERR("s[%2d]: 0x%08x s[%2d]: 0x%08x"
|
LOG_ERR("s[%2d]: 0x%08x s[%2d]: 0x%08x"
|
||||||
" s[%2d]: 0x%08x s[%2d]: 0x%08x",
|
" s[%2d]: 0x%08x s[%2d]: 0x%08x",
|
||||||
i, (uint32_t)esf->s[i],
|
i, (uint32_t)esf->fpu.s[i],
|
||||||
i + 1, (uint32_t)esf->s[i + 1],
|
i + 1, (uint32_t)esf->fpu.s[i + 1],
|
||||||
i + 2, (uint32_t)esf->s[i + 2],
|
i + 2, (uint32_t)esf->fpu.s[i + 2],
|
||||||
i + 3, (uint32_t)esf->s[i + 3]);
|
i + 3, (uint32_t)esf->fpu.s[i + 3]);
|
||||||
}
|
}
|
||||||
LOG_ERR("fpscr: 0x%08x", esf->fpscr);
|
LOG_ERR("fpscr: 0x%08x", esf->fpu.fpscr);
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_EXTRA_EXCEPTION_INFO)
|
#if defined(CONFIG_EXTRA_EXCEPTION_INFO)
|
||||||
const struct _callee_saved *callee = esf->extra_info.callee;
|
const struct _callee_saved *callee = esf->extra_info.callee;
|
||||||
|
|
|
@ -61,8 +61,10 @@ GEN_OFFSET_SYM(_basic_sf_t, xpsr);
|
||||||
GEN_ABSOLUTE_SYM(___basic_sf_t_SIZEOF, sizeof(_basic_sf_t));
|
GEN_ABSOLUTE_SYM(___basic_sf_t_SIZEOF, sizeof(_basic_sf_t));
|
||||||
|
|
||||||
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
||||||
GEN_OFFSET_SYM(_esf_t, s);
|
GEN_OFFSET_SYM(_fpu_sf_t, s);
|
||||||
GEN_OFFSET_SYM(_esf_t, fpscr);
|
GEN_OFFSET_SYM(_fpu_sf_t, fpscr);
|
||||||
|
|
||||||
|
GEN_ABSOLUTE_SYM(___fpu_t_SIZEOF, sizeof(_fpu_sf_t));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GEN_ABSOLUTE_SYM(___esf_t_SIZEOF, sizeof(_esf_t));
|
GEN_ABSOLUTE_SYM(___esf_t_SIZEOF, sizeof(_esf_t));
|
||||||
|
|
|
@ -44,6 +44,9 @@ extern "C" {
|
||||||
|
|
||||||
typedef struct __esf _esf_t;
|
typedef struct __esf _esf_t;
|
||||||
typedef struct __basic_sf _basic_sf_t;
|
typedef struct __basic_sf _basic_sf_t;
|
||||||
|
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
||||||
|
typedef struct __fpu_sf _fpu_sf_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_ARM_MPU
|
#ifdef CONFIG_ARM_MPU
|
||||||
struct z_arm_mpu_partition {
|
struct z_arm_mpu_partition {
|
||||||
|
|
|
@ -69,6 +69,14 @@ GTEXT(z_arm_exc_exit);
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
||||||
|
struct __fpu_sf {
|
||||||
|
float s[16];
|
||||||
|
uint32_t fpscr;
|
||||||
|
uint32_t undefined;
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Additional register state that is not stacked by hardware on exception
|
/* Additional register state that is not stacked by hardware on exception
|
||||||
* entry.
|
* entry.
|
||||||
*
|
*
|
||||||
|
@ -97,9 +105,7 @@ struct __esf {
|
||||||
uint32_t xpsr;
|
uint32_t xpsr;
|
||||||
} basic;
|
} basic;
|
||||||
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
||||||
float s[16];
|
struct __fpu_sf fpu;
|
||||||
uint32_t fpscr;
|
|
||||||
uint32_t undefined;
|
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_EXTRA_EXCEPTION_INFO)
|
#if defined(CONFIG_EXTRA_EXCEPTION_INFO)
|
||||||
struct __extra_esf_info extra_info;
|
struct __extra_esf_info extra_info;
|
||||||
|
@ -113,9 +119,7 @@ struct __esf {
|
||||||
struct __extra_esf_info extra_info;
|
struct __extra_esf_info extra_info;
|
||||||
#endif
|
#endif
|
||||||
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
#if defined(CONFIG_FPU) && defined(CONFIG_FPU_SHARING)
|
||||||
float s[16];
|
struct __fpu_sf fpu;
|
||||||
uint32_t fpscr;
|
|
||||||
uint32_t undefined;
|
|
||||||
#endif
|
#endif
|
||||||
struct __basic_sf {
|
struct __basic_sf {
|
||||||
sys_define_gpr_with_alias(a1, r0);
|
sys_define_gpr_with_alias(a1, r0);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue