Merge tag 'sched-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux/fpc-iii.git] / arch / arm64 / kernel / entry-fpsimd.S
blob2ca395c25448f45f29e55ca67992d3ebd491aeb4
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  */
9 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12 #include <asm/fpsimdmacros.h>
15  * Save the FP registers.
16  *
17  * x0 - pointer to struct fpsimd_state
18  */
19 SYM_FUNC_START(fpsimd_save_state)
20         fpsimd_save x0, 8
21         ret
22 SYM_FUNC_END(fpsimd_save_state)
25  * Load the FP registers.
26  *
27  * x0 - pointer to struct fpsimd_state
28  */
29 SYM_FUNC_START(fpsimd_load_state)
30         fpsimd_restore x0, 8
31         ret
32 SYM_FUNC_END(fpsimd_load_state)
34 #ifdef CONFIG_ARM64_SVE
36 SYM_FUNC_START(sve_save_state)
37         sve_save 0, x1, 2
38         ret
39 SYM_FUNC_END(sve_save_state)
41 SYM_FUNC_START(sve_load_state)
42         sve_load 0, x1, x2, 3, x4
43         ret
44 SYM_FUNC_END(sve_load_state)
46 SYM_FUNC_START(sve_get_vl)
47         _sve_rdvl       0, 1
48         ret
49 SYM_FUNC_END(sve_get_vl)
52  * Load SVE state from FPSIMD state.
53  *
54  * x0 = pointer to struct fpsimd_state
55  * x1 = VQ - 1
56  *
57  * Each SVE vector will be loaded with the first 128-bits taken from FPSIMD
58  * and the rest zeroed. All the other SVE registers will be zeroed.
59  */
60 SYM_FUNC_START(sve_load_from_fpsimd_state)
61                 sve_load_vq     x1, x2, x3
62                 fpsimd_restore  x0, 8
63  _for n, 0, 15, _sve_pfalse     \n
64                 _sve_wrffr      0
65                 ret
66 SYM_FUNC_END(sve_load_from_fpsimd_state)
68 /* Zero all SVE registers but the first 128-bits of each vector */
69 SYM_FUNC_START(sve_flush_live)
70         sve_flush
71         ret
72 SYM_FUNC_END(sve_flush_live)
74 #endif /* CONFIG_ARM64_SVE */