xref: /linux/arch/arm64/kernel/smccc-call.S (revision 02680c23d7b3febe45ea3d4f9818c2b2dc89020a)
1/* SPDX-License-Identifier: GPL-2.0-only */
2/*
3 * Copyright (c) 2015, Linaro Limited
4 */
5#include <linux/linkage.h>
6#include <linux/arm-smccc.h>
7
8#include <asm/asm-offsets.h>
9#include <asm/assembler.h>
10
11	.macro SMCCC instr
12	\instr	#0
13	ldr	x4, [sp]
14	stp	x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]
15	stp	x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]
16	ldr	x4, [sp, #8]
17	cbz	x4, 1f /* no quirk structure */
18	ldr	x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]
19	cmp	x9, #ARM_SMCCC_QUIRK_QCOM_A6
20	b.ne	1f
21	str	x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]
221:	ret
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 */
31SYM_FUNC_START(__arm_smccc_smc)
32	SMCCC	smc
33SYM_FUNC_END(__arm_smccc_smc)
34EXPORT_SYMBOL(__arm_smccc_smc)
35
36/*
37 * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
38 *		  unsigned long a3, unsigned long a4, unsigned long a5,
39 *		  unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
40 *		  struct arm_smccc_quirk *quirk)
41 */
42SYM_FUNC_START(__arm_smccc_hvc)
43	SMCCC	hvc
44SYM_FUNC_END(__arm_smccc_hvc)
45EXPORT_SYMBOL(__arm_smccc_hvc)
46