blob: 6d98b3f6e1a9f64c2a7b045f7bf029e53a8de4b5 [file] [log] [blame]
/*
* Copyright (c) 2015, Linaro Limited
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License Version 2 as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*/
#include <linux/linkage.h>
#include <asm/asm-offsets.h>
#include <generated/uapi/linux/version.h>
#define ARM_SMCCC_RES_X0_OFFS 0
#define ARM_SMCCC_RES_X2_OFFS 16
.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]
ret
.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,
* unsigned long a6, unsigned long a7, struct arm_smccc_res *res)
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 43)
SYM_FUNC_START(__arm_smccc_smc)
SMCCC smc
SYM_FUNC_END(__arm_smccc_smc)
#else
ENTRY(arm_smccc_smc)
SMCCC smc
ENDPROC(arm_smccc_smc)
#endif
/*
* void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,
* unsigned long a3, unsigned long a4, unsigned long a5,
* unsigned long a6, unsigned long a7, struct arm_smccc_res *res)
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 43)
SYM_FUNC_START(__arm_smccc_hvc)
SMCCC hvc
SYM_FUNC_END(__arm_smccc_hvc)
#else
ENTRY(arm_smccc_hvc)
SMCCC hvc
ENDPROC(arm_smccc_hvc)
#endif