xref: /openbmc/linux/arch/arm64/kernel/entry-fpsimd.S (revision 6774def6)
1/*
2 * FP/SIMD state saving and restoring
3 *
4 * Copyright (C) 2012 ARM Ltd.
5 * Author: Catalin Marinas <catalin.marinas@arm.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <linux/linkage.h>
21
22#include <asm/assembler.h>
23#include <asm/fpsimdmacros.h>
24
25/*
26 * Save the FP registers.
27 *
28 * x0 - pointer to struct fpsimd_state
29 */
30ENTRY(fpsimd_save_state)
31	fpsimd_save x0, 8
32	ret
33ENDPROC(fpsimd_save_state)
34
35/*
36 * Load the FP registers.
37 *
38 * x0 - pointer to struct fpsimd_state
39 */
40ENTRY(fpsimd_load_state)
41	fpsimd_restore x0, 8
42	ret
43ENDPROC(fpsimd_load_state)
44
45#ifdef CONFIG_KERNEL_MODE_NEON
46
47/*
48 * Save the bottom n FP registers.
49 *
50 * x0 - pointer to struct fpsimd_partial_state
51 */
52ENTRY(fpsimd_save_partial_state)
53	fpsimd_save_partial x0, 1, 8, 9
54	ret
55ENDPROC(fpsimd_save_partial_state)
56
57/*
58 * Load the bottom n FP registers.
59 *
60 * x0 - pointer to struct fpsimd_partial_state
61 */
62ENTRY(fpsimd_load_partial_state)
63	fpsimd_restore_partial x0, 8, 9
64	ret
65ENDPROC(fpsimd_load_partial_state)
66
67#endif
68