2019-05-27 14:55:21 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
2016-01-04 22:44:32 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2015, Linaro Limited
|
|
|
|
*/
|
|
|
|
#include <linux/linkage.h>
|
2017-02-02 01:28:28 +08:00
|
|
|
#include <linux/arm-smccc.h>
|
2018-12-08 02:08:18 +08:00
|
|
|
|
2016-01-04 22:44:32 +08:00
|
|
|
#include <asm/asm-offsets.h>
|
2018-12-08 02:08:18 +08:00
|
|
|
#include <asm/assembler.h>
|
2016-01-04 22:44:32 +08:00
|
|
|
|
|
|
|
.macro SMCCC instr
|
|
|
|
.cfi_startproc
|
|
|
|
\instr #0
|
|
|
|
ldr x4, [sp]
|
|
|
|
stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]
|
|
|
|
stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]
|
2017-02-02 01:28:28 +08:00
|
|
|
ldr x4, [sp, #8]
|
|
|
|
cbz x4, 1f /* no quirk structure */
|
|
|
|
ldr x9, [x4, #ARM_SMCCC_QUIRK_ID_OFFS]
|
|
|
|
cmp x9, #ARM_SMCCC_QUIRK_QCOM_A6
|
|
|
|
b.ne 1f
|
|
|
|
str x6, [x4, ARM_SMCCC_QUIRK_STATE_OFFS]
|
|
|
|
1: ret
|
2016-01-04 22:44:32 +08:00
|
|
|
.cfi_endproc
|
|
|
|
.endm
|
|
|
|
|
|
|
|
/*
|
|
|
|
* void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,
|
|
|
|
* unsigned long a3, unsigned long a4, unsigned long a5,
|
2017-02-02 01:28:27 +08:00
|
|
|
* unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
|
|
|
|
* struct arm_smccc_quirk *quirk)
|
2016-01-04 22:44:32 +08:00
|
|
|
*/
|
2020-05-01 19:54:29 +08:00
|
|
|
SYM_FUNC_START(__arm_smccc_smc)
|
2016-01-04 22:44:32 +08:00
|
|
|
SMCCC smc
|
2020-05-01 19:54:29 +08:00
|
|
|
SYM_FUNC_END(__arm_smccc_smc)
|
2018-12-08 02:08:18 +08:00
|
|
|
EXPORT_SYMBOL(__arm_smccc_smc)
|
2016-01-04 22:44:32 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
|
|
|
|
* unsigned long a3, unsigned long a4, unsigned long a5,
|
2017-02-02 01:28:27 +08:00
|
|
|
* unsigned long a6, unsigned long a7, struct arm_smccc_res *res,
|
|
|
|
* struct arm_smccc_quirk *quirk)
|
2016-01-04 22:44:32 +08:00
|
|
|
*/
|
2020-05-01 19:54:29 +08:00
|
|
|
SYM_FUNC_START(__arm_smccc_hvc)
|
2016-01-04 22:44:32 +08:00
|
|
|
SMCCC hvc
|
2020-05-01 19:54:29 +08:00
|
|
|
SYM_FUNC_END(__arm_smccc_hvc)
|
2018-12-08 02:08:18 +08:00
|
|
|
EXPORT_SYMBOL(__arm_smccc_hvc)
|