#ifndef __LINUX_ARM_SMCCC_H
#define __LINUX_ARM_SMCCC_H
#include <linux/args.h>
#include <linux/init.h>
#include <uapi/linux/const.h>
#define ARM_SMCCC_STD_CALL …
#define ARM_SMCCC_FAST_CALL …
#define ARM_SMCCC_TYPE_SHIFT …
#define ARM_SMCCC_SMC_32 …
#define ARM_SMCCC_SMC_64 …
#define ARM_SMCCC_CALL_CONV_SHIFT …
#define ARM_SMCCC_OWNER_MASK …
#define ARM_SMCCC_OWNER_SHIFT …
#define ARM_SMCCC_FUNC_MASK …
#define ARM_SMCCC_IS_FAST_CALL(smc_val) …
#define ARM_SMCCC_IS_64(smc_val) …
#define ARM_SMCCC_FUNC_NUM(smc_val) …
#define ARM_SMCCC_OWNER_NUM(smc_val) …
#define ARM_SMCCC_CALL_VAL(type, calling_convention, owner, func_num) …
#define ARM_SMCCC_OWNER_ARCH …
#define ARM_SMCCC_OWNER_CPU …
#define ARM_SMCCC_OWNER_SIP …
#define ARM_SMCCC_OWNER_OEM …
#define ARM_SMCCC_OWNER_STANDARD …
#define ARM_SMCCC_OWNER_STANDARD_HYP …
#define ARM_SMCCC_OWNER_VENDOR_HYP …
#define ARM_SMCCC_OWNER_TRUSTED_APP …
#define ARM_SMCCC_OWNER_TRUSTED_APP_END …
#define ARM_SMCCC_OWNER_TRUSTED_OS …
#define ARM_SMCCC_OWNER_TRUSTED_OS_END …
#define ARM_SMCCC_FUNC_QUERY_CALL_UID …
#define ARM_SMCCC_QUIRK_NONE …
#define ARM_SMCCC_QUIRK_QCOM_A6 …
#define ARM_SMCCC_VERSION_1_0 …
#define ARM_SMCCC_VERSION_1_1 …
#define ARM_SMCCC_VERSION_1_2 …
#define ARM_SMCCC_VERSION_1_3 …
#define ARM_SMCCC_1_3_SVE_HINT …
#define ARM_SMCCC_CALL_HINTS …
#define ARM_SMCCC_VERSION_FUNC_ID …
#define ARM_SMCCC_ARCH_FEATURES_FUNC_ID …
#define ARM_SMCCC_ARCH_SOC_ID …
#define ARM_SMCCC_ARCH_WORKAROUND_1 …
#define ARM_SMCCC_ARCH_WORKAROUND_2 …
#define ARM_SMCCC_ARCH_WORKAROUND_3 …
#define ARM_SMCCC_VENDOR_HYP_CALL_UID_FUNC_ID …
#define ARM_SMCCC_VENDOR_HYP_UID_KVM_REG_0 …
#define ARM_SMCCC_VENDOR_HYP_UID_KVM_REG_1 …
#define ARM_SMCCC_VENDOR_HYP_UID_KVM_REG_2 …
#define ARM_SMCCC_VENDOR_HYP_UID_KVM_REG_3 …
#define ARM_SMCCC_KVM_FUNC_FEATURES …
#define ARM_SMCCC_KVM_FUNC_PTP …
#define ARM_SMCCC_KVM_FUNC_HYP_MEMINFO …
#define ARM_SMCCC_KVM_FUNC_MEM_SHARE …
#define ARM_SMCCC_KVM_FUNC_MEM_UNSHARE …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_5 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_6 …
#define ARM_SMCCC_KVM_FUNC_MMIO_GUARD …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_8 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_9 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_10 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_11 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_12 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_13 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_14 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_15 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_16 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_17 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_18 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_19 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_20 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_21 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_22 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_23 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_24 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_25 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_26 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_27 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_28 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_29 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_30 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_31 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_32 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_33 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_34 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_35 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_36 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_37 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_38 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_39 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_40 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_41 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_42 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_43 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_44 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_45 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_46 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_47 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_48 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_49 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_50 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_51 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_52 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_53 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_54 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_55 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_56 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_57 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_58 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_59 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_60 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_61 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_62 …
#define ARM_SMCCC_KVM_FUNC_PKVM_RESV_63 …
#define ARM_SMCCC_KVM_FUNC_FEATURES_2 …
#define ARM_SMCCC_KVM_NUM_FUNCS …
#define ARM_SMCCC_VENDOR_HYP_KVM_FEATURES_FUNC_ID …
#define SMCCC_ARCH_WORKAROUND_RET_UNAFFECTED …
#define ARM_SMCCC_VENDOR_HYP_KVM_PTP_FUNC_ID …
#define ARM_SMCCC_VENDOR_HYP_KVM_HYP_MEMINFO_FUNC_ID …
#define ARM_SMCCC_VENDOR_HYP_KVM_MEM_SHARE_FUNC_ID …
#define ARM_SMCCC_VENDOR_HYP_KVM_MEM_UNSHARE_FUNC_ID …
#define ARM_SMCCC_VENDOR_HYP_KVM_MMIO_GUARD_FUNC_ID …
#define KVM_PTP_VIRT_COUNTER …
#define KVM_PTP_PHYS_COUNTER …
#define ARM_SMCCC_HV_PV_TIME_FEATURES …
#define ARM_SMCCC_HV_PV_TIME_ST …
#define ARM_SMCCC_TRNG_VERSION …
#define ARM_SMCCC_TRNG_FEATURES …
#define ARM_SMCCC_TRNG_GET_UUID …
#define ARM_SMCCC_TRNG_RND32 …
#define ARM_SMCCC_TRNG_RND64 …
#define SMCCC_RET_SUCCESS …
#define SMCCC_RET_NOT_SUPPORTED …
#define SMCCC_RET_NOT_REQUIRED …
#define SMCCC_RET_INVALID_PARAMETER …
#ifndef __ASSEMBLY__
#include <linux/linkage.h>
#include <linux/types.h>
enum arm_smccc_conduit { … };
enum arm_smccc_conduit arm_smccc_1_1_get_conduit(void);
u32 arm_smccc_get_version(void);
void __init arm_smccc_version_init(u32 version, enum arm_smccc_conduit conduit);
extern u64 smccc_has_sve_hint;
s32 arm_smccc_get_soc_id_version(void);
s32 arm_smccc_get_soc_id_revision(void);
struct arm_smccc_res { … };
#ifdef CONFIG_ARM64
struct arm_smccc_1_2_regs {
unsigned long a0;
unsigned long a1;
unsigned long a2;
unsigned long a3;
unsigned long a4;
unsigned long a5;
unsigned long a6;
unsigned long a7;
unsigned long a8;
unsigned long a9;
unsigned long a10;
unsigned long a11;
unsigned long a12;
unsigned long a13;
unsigned long a14;
unsigned long a15;
unsigned long a16;
unsigned long a17;
};
asmlinkage void arm_smccc_1_2_hvc(const struct arm_smccc_1_2_regs *args,
struct arm_smccc_1_2_regs *res);
asmlinkage void arm_smccc_1_2_smc(const struct arm_smccc_1_2_regs *args,
struct arm_smccc_1_2_regs *res);
#endif
struct arm_smccc_quirk { … };
asmlinkage unsigned long __arm_smccc_sve_check(unsigned long x0);
#ifdef CONFIG_HAVE_ARM_SMCCC
asmlinkage 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, struct arm_smccc_quirk *quirk);
#else
static inline 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, struct arm_smccc_quirk *quirk)
{ … }
#endif
asmlinkage 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, struct arm_smccc_quirk *quirk);
#define arm_smccc_smc(...) …
#define arm_smccc_smc_quirk(...) …
#define arm_smccc_hvc(...) …
#define arm_smccc_hvc_quirk(...) …
#ifdef CONFIG_ARM64
#define SMCCC_SMC_INST …
#define SMCCC_HVC_INST …
#elif defined(CONFIG_ARM)
#include <asm/opcodes-sec.h>
#include <asm/opcodes-virt.h>
#define SMCCC_SMC_INST …
#define SMCCC_HVC_INST …
#endif
#if defined(CONFIG_ARM64_SVE) && !defined(__KVM_NVHE_HYPERVISOR__)
#define SMCCC_SVE_CHECK …
#define smccc_sve_clobbers …
#else
#define SMCCC_SVE_CHECK
#define smccc_sve_clobbers
#endif
#define __constraint_read_2 …
#define __constraint_read_3 …
#define __constraint_read_4 …
#define __constraint_read_5 …
#define __constraint_read_6 …
#define __constraint_read_7 …
#define __constraint_read_8 …
#define __constraint_read_9 …
#define __declare_arg_2(a0, res) …
#define __declare_arg_3(a0, a1, res) …
#define __declare_arg_4(a0, a1, a2, res) …
#define __declare_arg_5(a0, a1, a2, a3, res) …
#define __declare_arg_6(a0, a1, a2, a3, a4, res) …
#define __declare_arg_7(a0, a1, a2, a3, a4, a5, res) …
#define __declare_arg_8(a0, a1, a2, a3, a4, a5, a6, res) …
#define __declare_arg_9(a0, a1, a2, a3, a4, a5, a6, a7, res) …
#define __arm_smccc_1_1(inst, ...) …
#define arm_smccc_1_1_smc(...) …
#define arm_smccc_1_1_hvc(...) …
#define __fail_smccc_1_1(...) …
#define arm_smccc_1_1_invoke(...) …
#endif
#endif