2 * Copyright (c) 2015, Linaro Limited
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 #include <linux/linkage.h>
15 #include <linux/arm-smccc.h>
17 #include <asm/asm-offsets.h>
18 #include <asm/opcodes-sec.h>
19 #include <asm/opcodes-virt.h>
20 #include <asm/unwind.h>
23 * Wrap c macros in asm macros to delay expansion until after the
24 * SMCCC asm macro is expanded.
38 UNWIND( .save {r4-r7})
43 beq 1f // No quirk structure
44 ldr r5, [r4, #ARM_SMCCC_QUIRK_ID_OFFS]
45 cmp r5, #ARM_SMCCC_QUIRK_QCOM_A6
46 bne 1f // No quirk present
47 str r6, [r4, #ARM_SMCCC_QUIRK_STATE_OFFS]
49 ldr r12, [sp, #(4 * 4)]
56 * void smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
57 * unsigned long a3, unsigned long a4, unsigned long a5,
58 * unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
59 * struct arm_smccc_quirk *quirk)
61 ENTRY(__arm_smccc_smc)
63 ENDPROC(__arm_smccc_smc)
66 * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
67 * unsigned long a3, unsigned long a4, unsigned long a5,
68 * unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
69 * struct arm_smccc_quirk *quirk)
71 ENTRY(__arm_smccc_hvc)
73 ENDPROC(__arm_smccc_hvc)