xref: /openbmc/linux/arch/arm64/kernel/entry-fpsimd.S (revision 4daedf7a)
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 */
19SYM_FUNC_START(fpsimd_save_state)
20	fpsimd_save x0, 8
21	ret
22SYM_FUNC_END(fpsimd_save_state)
23
24/*
25 * Load the FP registers.
26 *
27 * x0 - pointer to struct fpsimd_state
28 */
29SYM_FUNC_START(fpsimd_load_state)
30	fpsimd_restore x0, 8
31	ret
32SYM_FUNC_END(fpsimd_load_state)
33
34#ifdef CONFIG_ARM64_SVE
35SYM_FUNC_START(sve_save_state)
36	sve_save 0, x1, 2
37	ret
38SYM_FUNC_END(sve_save_state)
39
40SYM_FUNC_START(sve_load_state)
41	sve_load 0, x1, x2, 3, x4
42	ret
43SYM_FUNC_END(sve_load_state)
44
45SYM_FUNC_START(sve_get_vl)
46	_sve_rdvl	0, 1
47	ret
48SYM_FUNC_END(sve_get_vl)
49#endif /* CONFIG_ARM64_SVE */
50