From a5b9fa30cebd91082f9fea93d7ef33812910da6a Mon Sep 17 00:00:00 2001 From: Sergey Temerkhanov Date: Wed, 14 Oct 2015 09:55:46 -0700 Subject: armv8: Add Secure Monitor/Hypervisor Call (SMC/HVC) infrastructure This commit adds functions issuing calls to secure monitor or hypervisore. This allows using services such as Power State Coordination Interface (PSCI) provided by firmware, e.g. ARM Trusted Firmware (ATF) The SMC call can destroy all registers declared temporary by the calling conventions. The clobber list is "x0..x17" because of this Signed-off-by: Sergey Temerkhanov Signed-off-by: Corey Minyard Signed-off-by: Radha Mohan Chintakuntla Reviewed-by: Simon Glass Tested-by: Mateusz Kulikowski --- arch/arm/include/asm/system.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'arch/arm/include/asm') diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 393e7afcdd..67cbbc2610 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -1,6 +1,9 @@ #ifndef __ASM_ARM_SYSTEM_H #define __ASM_ARM_SYSTEM_H +#include +#include + #ifdef CONFIG_ARM64 /* @@ -105,6 +108,24 @@ void smp_kick_all_cpus(void); void flush_l3_cache(void); +/* + *Issue a hypervisor call in accordance with ARM "SMC Calling convention", + * DEN0028A + * + * @args: input and output arguments + * + */ +void hvc_call(struct pt_regs *args); + +/* + *Issue a secure monitor call in accordance with ARM "SMC Calling convention", + * DEN0028A + * + * @args: input and output arguments + * + */ +void smc_call(struct pt_regs *args); + #endif /* __ASSEMBLY__ */ #else /* CONFIG_ARM64 */ -- cgit