Zephyr Project API  3.3.0
A Scalable Open Source RTOS
float_regs_arm_gcc.h
Go to the documentation of this file.
1
6/*
7 * Copyright (c) 2016, Wind River Systems, Inc.
8 *
9 * SPDX-License-Identifier: Apache-2.0
10 */
11
12#ifndef _FLOAT_REGS_ARM_GCC_H
13#define _FLOAT_REGS_ARM_GCC_H
14
15#if !defined(__GNUC__) \
16 || !(defined(CONFIG_ARMV7_M_ARMV8_M_FP) || defined(CONFIG_ARMV7_R_FP))
17#error __FILE__ goes only with ARM GCC
18#endif
19
20#include <zephyr/toolchain.h>
21#include "float_context.h"
22
40static inline void _load_all_float_registers(struct fp_register_set *regs)
41{
42 __asm__ volatile (
43 "vldmia %0, {s0-s15};\n\t"
44 "vldmia %1, {s16-s31};\n\t"
45 : : "r" (&regs->fp_volatile), "r" (&regs->fp_non_volatile)
46 );
47}
48
60static inline void _store_all_float_registers(struct fp_register_set *regs)
61{
62 __asm__ volatile (
63 "vstmia %0, {s0-s15};\n\t"
64 "vstmia %1, {s16-s31};\n\t"
65 : : "r" (&regs->fp_volatile), "r" (&regs->fp_non_volatile)
66 : "memory"
67 );
68}
69
83static inline void _load_then_store_all_float_registers(struct fp_register_set
84 *regs)
85{
86 _load_all_float_registers(regs);
87 _store_all_float_registers(regs);
88}
89#endif /* _FLOAT_REGS_ARM_GCC_H */
common definitions for the FPU sharing test application
Definition: float_context.h:177
struct fp_non_volatile_register_set fp_non_volatile
Definition: float_context.h:179
struct fp_volatile_register_set fp_volatile
Definition: float_context.h:178
Macros to abstract toolchain specific capabilities.