xref: /linux/arch/arm64/kernel/entry-fpsimd.S (revision 4be5e8648b0c287aefc6ac3f3a0b12c696054f43)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * FP/SIMD state saving and restoring
4 *
5 * Copyright (C) 2012 ARM Ltd.
6 * Author: Catalin Marinas <catalin.marinas@arm.com>
7 */
8
9#include <linux/linkage.h>
10
11#include <asm/assembler.h>
12#include <asm/fpsimdmacros.h>
13
14/*
15 * Save the FP registers.
16 *
17 * x0 - pointer to struct fpsimd_state
18 */
19ENTRY(fpsimd_save_state)
20	fpsimd_save x0, 8
21	ret
22ENDPROC(fpsimd_save_state)
23
24/*
25 * Load the FP registers.
26 *
27 * x0 - pointer to struct fpsimd_state
28 */
29ENTRY(fpsimd_load_state)
30	fpsimd_restore x0, 8
31	ret
32ENDPROC(fpsimd_load_state)
33
34#ifdef CONFIG_ARM64_SVE
35ENTRY(sve_save_state)
36	sve_save 0, x1, 2
37	ret
38ENDPROC(sve_save_state)
39
40ENTRY(sve_load_state)
41	sve_load 0, x1, x2, 3, x4
42	ret
43ENDPROC(sve_load_state)
44
45ENTRY(sve_get_vl)
46	_sve_rdvl	0, 1
47	ret
48ENDPROC(sve_get_vl)
49#endif /* CONFIG_ARM64_SVE */
50