Zephyr API Documentation  2.7.0-rc2
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__) || !defined(CONFIG_ARMV7_M_ARMV8_M_FP)
16#error __FILE__ goes only with Cortex-M GCC
17#endif
18
19#include <toolchain.h>
20#include "float_context.h"
21
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
61static inline void _store_all_float_registers(struct fp_register_set *regs)
62{
63 __asm__ volatile (
64 "vstmia %0, {s0-s15};\n\t"
65 "vstmia %1, {s16-s31};\n\t"
66 : : "r" (&regs->fp_volatile), "r" (&regs->fp_non_volatile)
67 : "memory"
68 );
69}
70
85static inline void _load_then_store_all_float_registers(struct fp_register_set
86 *regs)
87{
88 _load_all_float_registers(regs);
89 _store_all_float_registers(regs);
90}
91#endif /* _FLOAT_REGS_ARM_GCC_H */
common definitions for the FPU sharing test application
Definition: float_context.h:164
struct fp_non_volatile_register_set fp_non_volatile
Definition: float_context.h:166
struct fp_volatile_register_set fp_volatile
Definition: float_context.h:165
Macros to abstract toolchain specific capabilities.