blob: 16c9e298b4542c62d79f933bbff2307e89420d09 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0 */
Masahiro Yamadac2da86f2017-04-14 11:10:22 +09002/*
3 * Copyright (c) 2015, Linaro Limited
Masahiro Yamadac2da86f2017-04-14 11:10:22 +09004 */
5#include <linux/linkage.h>
6#include <linux/arm-smccc.h>
Masahiro Yamadac54bcf62017-04-14 11:10:23 +09007#include <generated/asm-offsets.h>
Masahiro Yamadac2da86f2017-04-14 11:10:22 +09008
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]
211: 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 */
31ENTRY(__arm_smccc_smc)
32 SMCCC smc
33ENDPROC(__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 */
41ENTRY(__arm_smccc_hvc)
42 SMCCC hvc
43ENDPROC(__arm_smccc_hvc)