Catalin Marinas | 53631b5 | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 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> |
Marc Zyngier | cfc5180 | 2012-11-12 13:24:27 +0000 | [diff] [blame] | 23 | #include <asm/fpsimdmacros.h> |
Catalin Marinas | 53631b5 | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 24 | |
| 25 | /* |
| 26 | * Save the FP registers. |
| 27 | * |
| 28 | * x0 - pointer to struct fpsimd_state |
| 29 | */ |
| 30 | ENTRY(fpsimd_save_state) |
Marc Zyngier | cfc5180 | 2012-11-12 13:24:27 +0000 | [diff] [blame] | 31 | fpsimd_save x0, 8 |
Catalin Marinas | 53631b5 | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 32 | ret |
| 33 | ENDPROC(fpsimd_save_state) |
| 34 | |
| 35 | /* |
| 36 | * Load the FP registers. |
| 37 | * |
| 38 | * x0 - pointer to struct fpsimd_state |
| 39 | */ |
| 40 | ENTRY(fpsimd_load_state) |
Marc Zyngier | cfc5180 | 2012-11-12 13:24:27 +0000 | [diff] [blame] | 41 | fpsimd_restore x0, 8 |
Catalin Marinas | 53631b5 | 2012-03-05 11:49:32 +0000 | [diff] [blame] | 42 | ret |
| 43 | ENDPROC(fpsimd_load_state) |
Dave Martin | 1fc5dce7 | 2017-10-31 15:51:01 +0000 | [diff] [blame] | 44 | |
| 45 | #ifdef CONFIG_ARM64_SVE |
| 46 | ENTRY(sve_save_state) |
| 47 | sve_save 0, x1, 2 |
| 48 | ret |
| 49 | ENDPROC(sve_save_state) |
| 50 | |
| 51 | ENTRY(sve_load_state) |
| 52 | sve_load 0, x1, x2, 3 |
| 53 | ret |
| 54 | ENDPROC(sve_load_state) |
| 55 | |
| 56 | ENTRY(sve_get_vl) |
| 57 | _sve_rdvl 0, 1 |
| 58 | ret |
| 59 | ENDPROC(sve_get_vl) |
| 60 | #endif /* CONFIG_ARM64_SVE */ |