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:
Øyvind Rønningstad 2021-06-01 15:23:51 +02:00 committed by Ioannis Glaropoulos
commit 382bbacb0a
4 changed files with 94 additions and 43 deletions

View 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_ */