···6868 disable if zero.6969- arm,prefetch-offset : Override prefetch offset value. Valid values are7070 0-7, 15, 23, and 31.7171-- arm,shared-override : The default behavior of the pl310 cache controller with7272- respect to the shareable attribute is to transform "normal memory7373- non-cacheable transactions" into "cacheable no allocate" (for reads) or7474- "write through no write allocate" (for writes).7171+- arm,shared-override : The default behavior of the L220 or PL310 cache7272+ controllers with respect to the shareable attribute is to transform "normal7373+ memory non-cacheable transactions" into "cacheable no allocate" (for reads)7474+ or "write through no write allocate" (for writes).7575 On systems where this may cause DMA buffer corruption, this property must be7676 specified to indicate that such transforms are precluded.7777+- arm,parity-enable : enable parity checking on the L2 cache (L220 or PL310).7878+- arm,parity-disable : disable parity checking on the L2 cache (L220 or PL310).7979+- arm,outer-sync-disable : disable the outer sync operation on the L2 cache.8080+ Some core tiles, especially ARM PB11MPCore have a faulty L220 cache that8181+ will randomly hang unless outer sync operations are disabled.7782- prefetch-data : Data prefetch. Value: <0> (forcibly disable), <1>7883 (forcibly enable), property absent (retain settings set by firmware)7984- prefetch-instr : Instruction prefetch. Value: <0> (forcibly disable),
+25-5
arch/arm/Kconfig
···3333 select HARDIRQS_SW_RESEND3434 select HAVE_ARCH_AUDITSYSCALL if (AEABI && !OABI_COMPAT)3535 select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v63636- select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE323737- select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE323636+ select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU3737+ select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU3838 select HAVE_ARCH_SECCOMP_FILTER if (AEABI && !OABI_COMPAT)3939 select HAVE_ARCH_TRACEHOOK4040+ select HAVE_ARM_SMCCC if CPU_V74041 select HAVE_BPF_JIT4142 select HAVE_CC_STACKPROTECTOR4243 select HAVE_CONTEXT_TRACKING···4645 select HAVE_DMA_API_DEBUG4746 select HAVE_DMA_ATTRS4847 select HAVE_DMA_CONTIGUOUS if MMU4949- select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE324848+ select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 && MMU5049 select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU5150 select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL)5251 select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL)···800799 bool "Dummy Virtual Machine" if ARCH_MULTI_V7801800 select ARM_AMBA802801 select ARM_GIC802802+ select ARM_GIC_V2M if PCI_MSI803803 select ARM_GIC_V3804804 select ARM_PSCI805805 select HAVE_ARM_ARCH_TIMER···1424142214251423config BL_SWITCHER14261424 bool "big.LITTLE switcher support"14271427- depends on BIG_LITTLE && MCPM && HOTPLUG_CPU14251425+ depends on BIG_LITTLE && MCPM && HOTPLUG_CPU && ARM_GIC14281426 select ARM_CPU_SUSPEND14291427 select CPU_PM14301428 help···1483148114841482config ARM_PSCI14851483 bool "Support for the ARM Power State Coordination Interface (PSCI)"14861486- depends on CPU_V714841484+ depends on HAVE_ARM_SMCCC14871485 select ARM_PSCI_FW14881486 help14891487 Say Y here if you want Linux to communicate with system firmware···1605160316061604config ARM_ASM_UNIFIED16071605 bool16061606+16071607+config ARM_PATCH_IDIV16081608+ bool "Runtime patch udiv/sdiv instructions into __aeabi_{u}idiv()"16091609+ depends on CPU_32v7 && !XIP_KERNEL16101610+ default y16111611+ help16121612+ The ARM compiler inserts calls to __aeabi_idiv() and16131613+ __aeabi_uidiv() when it needs to perform division on signed16141614+ and unsigned integers. Some v7 CPUs have support for the sdiv16151615+ and udiv instructions that can be used to implement those16161616+ functions.16171617+16181618+ Enabling this option allows the kernel to modify itself to16191619+ replace the first two instructions of these library functions16201620+ with the sdiv or udiv plus "bx lr" instructions when the CPU16211621+ it is running on supports them. Typically this will be faster16221622+ and less power intensive than running the original library16231623+ code to do integer division.1608162416091625config AEABI16101626 bool "Use the ARM EABI to compile the kernel"
+1-4
arch/arm/include/asm/bug.h
···55#include <linux/types.h>66#include <asm/opcodes.h>7788-#ifdef CONFIG_BUG99-108/*119 * Use a suitable undefined instruction to use for ARM/Thumb2 bug handling.1210 * We need to be careful not to conflict with those used by other modules and···4547 unreachable(); \4648} while (0)47494848-#else /* not CONFIG_DEBUG_BUGVERBOSE */5050+#else49515052#define __BUG(__file, __line, __value) \5153do { \···5557#endif /* CONFIG_DEBUG_BUGVERBOSE */56585759#define HAVE_ARCH_BUG5858-#endif /* CONFIG_BUG */59606061#include <asm-generic/bug.h>6162
+1-1
arch/arm/include/asm/cpuidle.h
···3030struct device_node;31313232struct cpuidle_ops {3333- int (*suspend)(int cpu, unsigned long arg);3333+ int (*suspend)(unsigned long arg);3434 int (*init)(struct device_node *, int cpu);3535};3636
···11-#ifdef CONFIG_ATAGS_PROC22-extern void save_atags(struct tag *tags);33-#else44-static inline void save_atags(struct tag *tags) { }55-#endif66-71void convert_to_tag_list(struct tag *tags);8293#ifdef CONFIG_ATAGS
+1-1
arch/arm/kernel/cpuidle.c
···5656 int cpu = smp_processor_id();57575858 if (cpuidle_ops[cpu].suspend)5959- ret = cpuidle_ops[cpu].suspend(cpu, index);5959+ ret = cpuidle_ops[cpu].suspend(index);60606161 return ret;6262}
+1-1
arch/arm/kernel/entry-v7m.S
···8888 @ execute the pending work, including reschedule8989 get_thread_info tsk9090 mov why, #09191- b ret_to_user9191+ b ret_to_user_from_irq9292ENDPROC(__pendsv_entry)93939494/*
···11-/*22- * This program is free software; you can redistribute it and/or modify33- * it under the terms of the GNU General Public License version 2 as44- * published by the Free Software Foundation.55- *66- * This program is distributed in the hope that it will be useful,77- * but WITHOUT ANY WARRANTY; without even the implied warranty of88- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the99- * GNU General Public License for more details.1010- *1111- * Copyright (C) 2015 ARM Limited1212- *1313- * Author: Mark Rutland <mark.rutland@arm.com>1414- */1515-1616-#include <linux/linkage.h>1717-1818-#include <asm/opcodes-sec.h>1919-#include <asm/opcodes-virt.h>2020-2121-/* int __invoke_psci_fn_hvc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) */2222-ENTRY(__invoke_psci_fn_hvc)2323- __HVC(0)2424- bx lr2525-ENDPROC(__invoke_psci_fn_hvc)2626-2727-/* int __invoke_psci_fn_smc(u32 function_id, u32 arg0, u32 arg1, u32 arg2) */2828-ENTRY(__invoke_psci_fn_smc)2929- __SMC(0)3030- bx lr3131-ENDPROC(__invoke_psci_fn_smc)
···11+/*22+ * Copyright (c) 2015, Linaro Limited33+ *44+ * This software is licensed under the terms of the GNU General Public55+ * License version 2, as published by the Free Software Foundation, and66+ * may be copied, distributed, and modified under those terms.77+ *88+ * This program is distributed in the hope that it will be useful,99+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1010+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1111+ * GNU General Public License for more details.1212+ *1313+ */1414+#include <linux/linkage.h>1515+1616+#include <asm/opcodes-sec.h>1717+#include <asm/opcodes-virt.h>1818+#include <asm/unwind.h>1919+2020+ /*2121+ * Wrap c macros in asm macros to delay expansion until after the2222+ * SMCCC asm macro is expanded.2323+ */2424+ .macro SMCCC_SMC2525+ __SMC(0)2626+ .endm2727+2828+ .macro SMCCC_HVC2929+ __HVC(0)3030+ .endm3131+3232+ .macro SMCCC instr3333+UNWIND( .fnstart)3434+ mov r12, sp3535+ push {r4-r7}3636+UNWIND( .save {r4-r7})3737+ ldm r12, {r4-r7}3838+ \instr3939+ pop {r4-r7}4040+ ldr r12, [sp, #(4 * 4)]4141+ stm r12, {r0-r3}4242+ bx lr4343+UNWIND( .fnend)4444+ .endm4545+4646+/*4747+ * void smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,4848+ * unsigned long a3, unsigned long a4, unsigned long a5,4949+ * unsigned long a6, unsigned long a7, struct arm_smccc_res *res)5050+ */5151+ENTRY(arm_smccc_smc)5252+ SMCCC SMCCC_SMC5353+ENDPROC(arm_smccc_smc)5454+5555+/*5656+ * void smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,5757+ * unsigned long a3, unsigned long a4, unsigned long a5,5858+ * unsigned long a6, unsigned long a7, struct arm_smccc_res *res)5959+ */6060+ENTRY(arm_smccc_hvc)6161+ SMCCC SMCCC_HVC6262+ENDPROC(arm_smccc_hvc)
+7-10
arch/arm/kernel/smp.c
···6969 IPI_TIMER,7070 IPI_RESCHEDULE,7171 IPI_CALL_FUNC,7272- IPI_CALL_FUNC_SINGLE,7372 IPI_CPU_STOP,7473 IPI_IRQ_WORK,7574 IPI_COMPLETION,7676- IPI_CPU_BACKTRACE = 15,7575+ IPI_CPU_BACKTRACE,7676+ /*7777+ * SGI8-15 can be reserved by secure firmware, and thus may7878+ * not be usable by the kernel. Please keep the above limited7979+ * to at most 8 entries.8080+ */7781};78827983static DECLARE_COMPLETION(cpu_running);···479475 S(IPI_TIMER, "Timer broadcast interrupts"),480476 S(IPI_RESCHEDULE, "Rescheduling interrupts"),481477 S(IPI_CALL_FUNC, "Function call interrupts"),482482- S(IPI_CALL_FUNC_SINGLE, "Single function call interrupts"),483478 S(IPI_CPU_STOP, "CPU stop interrupts"),484479 S(IPI_IRQ_WORK, "IRQ work interrupts"),485480 S(IPI_COMPLETION, "completion interrupts"),···528525529526void arch_send_call_function_single_ipi(int cpu)530527{531531- smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC_SINGLE);528528+ smp_cross_call(cpumask_of(cpu), IPI_CALL_FUNC);532529}533530534531#ifdef CONFIG_IRQ_WORK···620617 case IPI_CALL_FUNC:621618 irq_enter();622619 generic_smp_call_function_interrupt();623623- irq_exit();624624- break;625625-626626- case IPI_CALL_FUNC_SINGLE:627627- irq_enter();628628- generic_smp_call_function_single_interrupt();629620 irq_exit();630621 break;631622
···1616#include <linux/of_platform.h>1717#include <linux/irqdomain.h>18181919+#include <asm/setup.h>1920#include <asm/mach/arch.h>20212122#include "common.h"···7776 NULL,7877};79787979+/* Legacy userspace on Nokia N900 needs ATAGS exported in /proc/atags,8080+ * save them while the data is still not overwritten8181+ */8282+static void __init rx51_reserve(void)8383+{8484+ save_atags((const struct tag *)(PAGE_OFFSET + 0x100));8585+ omap_reserve();8686+}8787+8088DT_MACHINE_START(OMAP3_N900_DT, "Nokia RX-51 board")8181- .reserve = omap_reserve,8989+ .reserve = rx51_reserve,8290 .map_io = omap3_map_io,8391 .init_early = omap3430_init_early,8492 .init_machine = omap_generic_init,
+30-3
arch/arm/mm/cache-l2x0.c
···790790};791791792792static int __init __l2c_init(const struct l2c_init_data *data,793793- u32 aux_val, u32 aux_mask, u32 cache_id)793793+ u32 aux_val, u32 aux_mask, u32 cache_id, bool nosync)794794{795795 struct outer_cache_fns fns;796796 unsigned way_size_bits, ways;···866866 fns.configure = outer_cache.configure;867867 if (data->fixup)868868 data->fixup(l2x0_base, cache_id, &fns);869869+ if (nosync) {870870+ pr_info("L2C: disabling outer sync\n");871871+ fns.sync = NULL;872872+ }869873870874 /*871875 * Check if l2x0 controller is already enabled. If we are booting···929925 if (data->save)930926 data->save(l2x0_base);931927932932- __l2c_init(data, aux_val, aux_mask, cache_id);928928+ __l2c_init(data, aux_val, aux_mask, cache_id, false);933929}934930935931#ifdef CONFIG_OF···10641060 val |= (dirty - 1) << L2X0_AUX_CTRL_DIRTY_LATENCY_SHIFT;10651061 }1066106210631063+ if (of_property_read_bool(np, "arm,parity-enable")) {10641064+ mask &= ~L2C_AUX_CTRL_PARITY_ENABLE;10651065+ val |= L2C_AUX_CTRL_PARITY_ENABLE;10661066+ } else if (of_property_read_bool(np, "arm,parity-disable")) {10671067+ mask &= ~L2C_AUX_CTRL_PARITY_ENABLE;10681068+ }10691069+10701070+ if (of_property_read_bool(np, "arm,shared-override")) {10711071+ mask &= ~L2C_AUX_CTRL_SHARED_OVERRIDE;10721072+ val |= L2C_AUX_CTRL_SHARED_OVERRIDE;10731073+ }10741074+10671075 ret = l2x0_cache_size_of_parse(np, aux_val, aux_mask, &assoc, SZ_256K);10681076 if (ret)10691077 return;···11901174 if (of_property_read_bool(np, "arm,shared-override")) {11911175 *aux_val |= L2C_AUX_CTRL_SHARED_OVERRIDE;11921176 *aux_mask &= ~L2C_AUX_CTRL_SHARED_OVERRIDE;11771177+ }11781178+11791179+ if (of_property_read_bool(np, "arm,parity-enable")) {11801180+ *aux_val |= L2C_AUX_CTRL_PARITY_ENABLE;11811181+ *aux_mask &= ~L2C_AUX_CTRL_PARITY_ENABLE;11821182+ } else if (of_property_read_bool(np, "arm,parity-disable")) {11831183+ *aux_val &= ~L2C_AUX_CTRL_PARITY_ENABLE;11841184+ *aux_mask &= ~L2C_AUX_CTRL_PARITY_ENABLE;11931185 }1194118611951187 prefetch = l2x0_saved_regs.prefetch_ctrl;···17281704 struct resource res;17291705 u32 cache_id, old_aux;17301706 u32 cache_level = 2;17071707+ bool nosync = false;1731170817321709 np = of_find_matching_node(NULL, l2x0_ids);17331710 if (!np)···17671742 if (cache_level != 2)17681743 pr_err("L2C: device tree specifies invalid cache level\n");1769174417451745+ nosync = of_property_read_bool(np, "arm,outer-sync-disable");17461746+17701747 /* Read back current (default) hardware configuration */17711748 if (data->save)17721749 data->save(l2x0_base);···17831756 else17841757 cache_id = readl_relaxed(l2x0_base + L2X0_CACHE_ID);1785175817861786- return __l2c_init(data, aux_val, aux_mask, cache_id);17591759+ return __l2c_init(data, aux_val, aux_mask, cache_id, nosync);17871760}17881761#endif
+1-12
arch/arm/mm/cache-uniphier.c
···377377 { /* sentinel */ }378378};379379380380-static struct device_node * __init uniphier_cache_get_next_level_node(381381- struct device_node *np)382382-{383383- u32 phandle;384384-385385- if (of_property_read_u32(np, "next-level-cache", &phandle))386386- return NULL;387387-388388- return of_find_node_by_phandle(phandle);389389-}390390-391380static int __init __uniphier_cache_init(struct device_node *np,392381 unsigned int *cache_level)393382{···480491 * next level cache fails because we want to continue with available481492 * cache levels.482493 */483483- next_np = uniphier_cache_get_next_level_node(np);494494+ next_np = of_find_next_cache_node(np);484495 if (next_np) {485496 (*cache_level)++;486497 ret = __uniphier_cache_init(next_np, cache_level);
+1-1
arch/arm/mm/mmu.c
···572572 * in the Short-descriptor translation table format descriptors.573573 */574574 if (cpu_arch == CPU_ARCH_ARMv7 &&575575- (read_cpuid_ext(CPUID_EXT_MMFR0) & 0xF) == 4) {575575+ (read_cpuid_ext(CPUID_EXT_MMFR0) & 0xF) >= 4) {576576 user_pmd_table |= PMD_PXNTABLE;577577 }578578#endif
···11-/*22- * This program is free software; you can redistribute it and/or modify33- * it under the terms of the GNU General Public License version 2 as44- * published by the Free Software Foundation.55- *66- * This program is distributed in the hope that it will be useful,77- * but WITHOUT ANY WARRANTY; without even the implied warranty of88- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the99- * GNU General Public License for more details.1010- *1111- * Copyright (C) 2015 ARM Limited1212- *1313- * Author: Will Deacon <will.deacon@arm.com>1414- */1515-1616-#include <linux/linkage.h>1717-1818-/* int __invoke_psci_fn_hvc(u64 function_id, u64 arg0, u64 arg1, u64 arg2) */1919-ENTRY(__invoke_psci_fn_hvc)2020- hvc #02121- ret2222-ENDPROC(__invoke_psci_fn_hvc)2323-2424-/* int __invoke_psci_fn_smc(u64 function_id, u64 arg0, u64 arg1, u64 arg2) */2525-ENTRY(__invoke_psci_fn_smc)2626- smc #02727- ret2828-ENDPROC(__invoke_psci_fn_smc)
+43
arch/arm64/kernel/smccc-call.S
···11+/*22+ * Copyright (c) 2015, Linaro Limited33+ *44+ * This program is free software; you can redistribute it and/or modify55+ * it under the terms of the GNU General Public License Version 2 as66+ * published by the Free Software Foundation.77+ *88+ * This program is distributed in the hope that it will be useful,99+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1010+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1111+ * GNU General Public License for more details.1212+ *1313+ */1414+#include <linux/linkage.h>1515+#include <asm/asm-offsets.h>1616+1717+ .macro SMCCC instr1818+ .cfi_startproc1919+ \instr #02020+ ldr x4, [sp]2121+ stp x0, x1, [x4, #ARM_SMCCC_RES_X0_OFFS]2222+ stp x2, x3, [x4, #ARM_SMCCC_RES_X2_OFFS]2323+ ret2424+ .cfi_endproc2525+ .endm2626+2727+/*2828+ * void arm_smccc_smc(unsigned long a0, unsigned long a1, unsigned long a2,2929+ * unsigned long a3, unsigned long a4, unsigned long a5,3030+ * unsigned long a6, unsigned long a7, struct arm_smccc_res *res)3131+ */3232+ENTRY(arm_smccc_smc)3333+ SMCCC smc3434+ENDPROC(arm_smccc_smc)3535+3636+/*3737+ * void arm_smccc_hvc(unsigned long a0, unsigned long a1, unsigned long a2,3838+ * unsigned long a3, unsigned long a4, unsigned long a5,3939+ * unsigned long a6, unsigned long a7, struct arm_smccc_res *res)4040+ */4141+ENTRY(arm_smccc_hvc)4242+ SMCCC hvc4343+ENDPROC(arm_smccc_hvc)
···13131414#define pr_fmt(fmt) "psci: " fmt15151616+#include <linux/arm-smccc.h>1617#include <linux/errno.h>1718#include <linux/linkage.h>1819#include <linux/of.h>···59586059typedef unsigned long (psci_fn)(unsigned long, unsigned long,6160 unsigned long, unsigned long);6262-asmlinkage psci_fn __invoke_psci_fn_hvc;6363-asmlinkage psci_fn __invoke_psci_fn_smc;6461static psci_fn *invoke_psci_fn;65626663enum psci_function {···104105 PSCI_0_2_POWER_STATE_MASK;105106106107 return !(state & ~valid_mask);108108+}109109+110110+static unsigned long __invoke_psci_fn_hvc(unsigned long function_id,111111+ unsigned long arg0, unsigned long arg1,112112+ unsigned long arg2)113113+{114114+ struct arm_smccc_res res;115115+116116+ arm_smccc_hvc(function_id, arg0, arg1, arg2, 0, 0, 0, 0, &res);117117+ return res.a0;118118+}119119+120120+static unsigned long __invoke_psci_fn_smc(unsigned long function_id,121121+ unsigned long arg0, unsigned long arg1,122122+ unsigned long arg2)123123+{124124+ struct arm_smccc_res res;125125+126126+ arm_smccc_smc(function_id, arg0, arg1, arg2, 0, 0, 0, 0, &res);127127+ return res.a0;107128}108129109130static int psci_to_linux_errno(int errno)
+5-5
drivers/soc/qcom/spm.c
···116116117117static DEFINE_PER_CPU(struct spm_driver_data *, cpu_spm_drv);118118119119-typedef int (*idle_fn)(int);119119+typedef int (*idle_fn)(void);120120static DEFINE_PER_CPU(idle_fn*, qcom_idle_ops);121121122122static inline void spm_register_write(struct spm_driver_data *drv,···179179 return -1;180180}181181182182-static int qcom_cpu_spc(int cpu)182182+static int qcom_cpu_spc(void)183183{184184 int ret;185185- struct spm_driver_data *drv = per_cpu(cpu_spm_drv, cpu);185185+ struct spm_driver_data *drv = __this_cpu_read(cpu_spm_drv);186186187187 spm_set_low_power_mode(drv, PM_SLEEP_MODE_SPC);188188 ret = cpu_suspend(0, qcom_pm_collapse);···197197 return ret;198198}199199200200-static int qcom_idle_enter(int cpu, unsigned long index)200200+static int qcom_idle_enter(unsigned long index)201201{202202- return per_cpu(qcom_idle_ops, cpu)[index](cpu);202202+ return __this_cpu_read(qcom_idle_ops)[index]();203203}204204205205static const struct of_device_id qcom_idle_state_match[] __initconst = {
+104
include/linux/arm-smccc.h
···11+/*22+ * Copyright (c) 2015, Linaro Limited33+ *44+ * This software is licensed under the terms of the GNU General Public55+ * License version 2, as published by the Free Software Foundation, and66+ * may be copied, distributed, and modified under those terms.77+ *88+ * This program is distributed in the hope that it will be useful,99+ * but WITHOUT ANY WARRANTY; without even the implied warranty of1010+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the1111+ * GNU General Public License for more details.1212+ *1313+ */1414+#ifndef __LINUX_ARM_SMCCC_H1515+#define __LINUX_ARM_SMCCC_H1616+1717+#include <linux/linkage.h>1818+#include <linux/types.h>1919+2020+/*2121+ * This file provides common defines for ARM SMC Calling Convention as2222+ * specified in2323+ * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html2424+ */2525+2626+#define ARM_SMCCC_STD_CALL 02727+#define ARM_SMCCC_FAST_CALL 12828+#define ARM_SMCCC_TYPE_SHIFT 312929+3030+#define ARM_SMCCC_SMC_32 03131+#define ARM_SMCCC_SMC_64 13232+#define ARM_SMCCC_CALL_CONV_SHIFT 303333+3434+#define ARM_SMCCC_OWNER_MASK 0x3F3535+#define ARM_SMCCC_OWNER_SHIFT 243636+3737+#define ARM_SMCCC_FUNC_MASK 0xFFFF3838+3939+#define ARM_SMCCC_IS_FAST_CALL(smc_val) \4040+ ((smc_val) & (ARM_SMCCC_FAST_CALL << ARM_SMCCC_TYPE_SHIFT))4141+#define ARM_SMCCC_IS_64(smc_val) \4242+ ((smc_val) & (ARM_SMCCC_SMC_64 << ARM_SMCCC_CALL_CONV_SHIFT))4343+#define ARM_SMCCC_FUNC_NUM(smc_val) ((smc_val) & ARM_SMCCC_FUNC_MASK)4444+#define ARM_SMCCC_OWNER_NUM(smc_val) \4545+ (((smc_val) >> ARM_SMCCC_OWNER_SHIFT) & ARM_SMCCC_OWNER_MASK)4646+4747+#define ARM_SMCCC_CALL_VAL(type, calling_convention, owner, func_num) \4848+ (((type) << ARM_SMCCC_TYPE_SHIFT) | \4949+ ((calling_convention) << ARM_SMCCC_CALL_CONV_SHIFT) | \5050+ (((owner) & ARM_SMCCC_OWNER_MASK) << ARM_SMCCC_OWNER_SHIFT) | \5151+ ((func_num) & ARM_SMCCC_FUNC_MASK))5252+5353+#define ARM_SMCCC_OWNER_ARCH 05454+#define ARM_SMCCC_OWNER_CPU 15555+#define ARM_SMCCC_OWNER_SIP 25656+#define ARM_SMCCC_OWNER_OEM 35757+#define ARM_SMCCC_OWNER_STANDARD 45858+#define ARM_SMCCC_OWNER_TRUSTED_APP 485959+#define ARM_SMCCC_OWNER_TRUSTED_APP_END 496060+#define ARM_SMCCC_OWNER_TRUSTED_OS 506161+#define ARM_SMCCC_OWNER_TRUSTED_OS_END 636262+6363+/**6464+ * struct arm_smccc_res - Result from SMC/HVC call6565+ * @a0-a3 result values from registers 0 to 36666+ */6767+struct arm_smccc_res {6868+ unsigned long a0;6969+ unsigned long a1;7070+ unsigned long a2;7171+ unsigned long a3;7272+};7373+7474+/**7575+ * arm_smccc_smc() - make SMC calls7676+ * @a0-a7: arguments passed in registers 0 to 77777+ * @res: result values from registers 0 to 37878+ *7979+ * This function is used to make SMC calls following SMC Calling Convention.8080+ * The content of the supplied param are copied to registers 0 to 7 prior8181+ * to the SMC instruction. The return values are updated with the content8282+ * from register 0 to 3 on return from the SMC instruction.8383+ */8484+asmlinkage void arm_smccc_smc(unsigned long a0, unsigned long a1,8585+ unsigned long a2, unsigned long a3, unsigned long a4,8686+ unsigned long a5, unsigned long a6, unsigned long a7,8787+ struct arm_smccc_res *res);8888+8989+/**9090+ * arm_smccc_hvc() - make HVC calls9191+ * @a0-a7: arguments passed in registers 0 to 79292+ * @res: result values from registers 0 to 39393+ *9494+ * This function is used to make HVC calls following SMC Calling9595+ * Convention. The content of the supplied param are copied to registers 09696+ * to 7 prior to the HVC instruction. The return values are updated with9797+ * the content from register 0 to 3 on return from the HVC instruction.9898+ */9999+asmlinkage void arm_smccc_hvc(unsigned long a0, unsigned long a1,100100+ unsigned long a2, unsigned long a3, unsigned long a4,101101+ unsigned long a5, unsigned long a6, unsigned long a7,102102+ struct arm_smccc_res *res);103103+104104+#endif /*__LINUX_ARM_SMCCC_H*/