tfm: Put saving of FPU context into its own file so it can be reused
Also, this eases readability. The new API can be used any time all FP registers must be manually saved and restored for an operation. Signed-off-by: Øyvind Rønningstad <oyvind.ronningstad@nordicsemi.no>
This commit is contained in:
parent
1929c00643
commit
382bbacb0a
4 changed files with 94 additions and 43 deletions
20
include/arch/arm/aarch32/cortex_m/fpu.h
Normal file
20
include/arch/arm/aarch32/cortex_m/fpu.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Nordic Semiconductor ASA
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_CORTEX_M_FPU_H_
|
||||
#define ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_CORTEX_M_FPU_H_
|
||||
|
||||
struct fpu_ctx_full {
|
||||
uint32_t caller_saved[16];
|
||||
uint32_t callee_saved[16];
|
||||
uint32_t fpscr;
|
||||
bool ctx_saved;
|
||||
};
|
||||
|
||||
void z_arm_save_fp_context(struct fpu_ctx_full *buffer);
|
||||
void z_arm_restore_fp_context(const struct fpu_ctx_full *buffer);
|
||||
|
||||
#endif /* ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_CORTEX_M_FPU_H_ */
|
Loading…
Add table
Add a link
Reference in a new issue