Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Masahiro Yamada | a93297e | 2017-04-14 11:10:22 +0900 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2015, Linaro Limited |
Masahiro Yamada | a93297e | 2017-04-14 11:10:22 +0900 | [diff] [blame] | 4 | */ |
| 5 | #include <linux/linkage.h> |
| 6 | #include <linux/arm-smccc.h> |
Masahiro Yamada | e8ead73 | 2017-04-14 11:10:23 +0900 | [diff] [blame] | 7 | #include <generated/asm-offsets.h> |
Masahiro Yamada | a93297e | 2017-04-14 11:10:22 +0900 | [diff] [blame] | 8 | |
| 9 | .macro SMCCC instr |
| 10 | .cfi_startproc |
| 11 | \instr #0 |
| 12 | ldr x4, [sp] |
| 13 | stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS] |
| 14 | stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS] |
| 15 | ldr x4, [sp, #8] |
| 16 | cbz x4, 1f /* no quirk structure */ |
| 17 | ldr x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS] |
| 18 | cmp x9, #ARM_SMCCC_QUIRK_QCOM_A6 |
| 19 | b.ne 1f |
| 20 | str x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS] |
| 21 | 1: ret |
| 22 | .cfi_endproc |
| 23 | .endm |
| 24 | |
| 25 | /* |
| 26 | * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2, |
| 27 | * unsigned long a3, unsigned long a4, unsigned long a5, |
| 28 | * unsigned long a6, unsigned long a7, struct arm_smccc_res *res, |
| 29 | * struct arm_smccc_quirk *quirk) |
| 30 | */ |
| 31 | ENTRY(__arm_smccc_smc) |
| 32 | SMCCC smc |
| 33 | ENDPROC(__arm_smccc_smc) |
| 34 | |
| 35 | /* |
| 36 | * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2, |
| 37 | * unsigned long a3, unsigned long a4, unsigned long a5, |
| 38 | * unsigned long a6, unsigned long a7, struct arm_smccc_res *res, |
| 39 | * struct arm_smccc_quirk *quirk) |
| 40 | */ |
| 41 | ENTRY(__arm_smccc_hvc) |
| 42 | SMCCC hvc |
| 43 | ENDPROC(__arm_smccc_hvc) |