Initial empty repository
authorLei Qian <lei.qian@amlogic.com>
Fri, 21 Sep 2018 05:52:47 +0000 (13:52 +0800)
committerLei Qian <lei.qian@amlogic.com>
Fri, 21 Sep 2018 05:52:47 +0000 (13:52 +0800)
48 files changed:
Android.mk [new file with mode: 0755]
Kconfig [new file with mode: 0755]
Makefile [new file with mode: 0755]
Module.symvers [new file with mode: 0644]
build_gx.sh [new file with mode: 0755]
include/linux/arm-smccc.h [new file with mode: 0755]
include/linux/tee.h [new file with mode: 0755]
include/linux/tee_drv.h [new file with mode: 0755]
modules.order [new file with mode: 0644]
optee.ko [new file with mode: 0644]
optee.mod.c [new file with mode: 0644]
optee.mod.o [new file with mode: 0644]
optee.o [new file with mode: 0644]
optee/.call.o.cmd [new file with mode: 0644]
optee/.core.o.cmd [new file with mode: 0644]
optee/.optee_armtz.ko.cmd [new file with mode: 0644]
optee/.optee_armtz.mod.o.cmd [new file with mode: 0644]
optee/.optee_armtz.o.cmd [new file with mode: 0644]
optee/.rpc.o.cmd [new file with mode: 0644]
optee/.smccc-call.o.cmd [new file with mode: 0644]
optee/.supp.o.cmd [new file with mode: 0644]
optee/Kconfig [new file with mode: 0755]
optee/Makefile [new file with mode: 0755]
optee/call.c [new file with mode: 0644]
optee/call.o [new file with mode: 0644]
optee/core.c [new file with mode: 0644]
optee/core.o [new file with mode: 0644]
optee/modules.order [new file with mode: 0644]
optee/optee_armtz.ko [new file with mode: 0644]
optee/optee_armtz.mod.c [new file with mode: 0644]
optee/optee_armtz.mod.o [new file with mode: 0644]
optee/optee_armtz.o [new file with mode: 0644]
optee/optee_msg.h [new file with mode: 0755]
optee/optee_private.h [new file with mode: 0755]
optee/optee_smc.h [new file with mode: 0755]
optee/rpc.c [new file with mode: 0644]
optee/rpc.o [new file with mode: 0644]
optee/smccc-call.S [new file with mode: 0755]
optee/smccc-call.o [new file with mode: 0644]
optee/supp.c [new file with mode: 0755]
optee/supp.o [new file with mode: 0644]
tee_core.c [new file with mode: 0755]
tee_core.o [new file with mode: 0644]
tee_private.h [new file with mode: 0755]
tee_shm.c [new file with mode: 0755]
tee_shm.o [new file with mode: 0644]
tee_shm_pool.c [new file with mode: 0644]
tee_shm_pool.o [new file with mode: 0644]

diff --git a/Android.mk b/Android.mk
new file mode 100755 (executable)
index 0000000..576419f
--- /dev/null
@@ -0,0 +1,51 @@
+LOCAL_PATH := $(call my-dir)
+ifeq ($(BOARD_KERNEL_VERSION), 4.9)
+KERNEL_DIR := kernel/common_4.9
+else ifeq ($(BOARD_KERNEL_VERSION), 3.14)
+KERNEL_DIR := kernel/common_3.14
+else
+KERNEL_DIR := common
+endif
+KERNEL_OUT_DIR := out/target/product/$(TARGET_BOOTLOADER_BOARD_NAME)/obj/KERNEL_OBJ
+KERNEL_ARCH := arm64
+PREFIX_CROSS_COMPILE := aarch64-linux-gnu-
+KERNEL_CONFIG=meson64_defconfig
+
+include $(CLEAR_VARS)
+$(info $(shell if [ ! -d $(KERNEL_OUT_DIR) ]; then mkdir -p $(KERNEL_OUT_DIR); fi))
+
+$(info $(shell if [ ! -e $(KERNEL_OUT_DIR)/include/generated/autoconf.h ]; then $(MAKE) -C $(KERNEL_DIR) O=../$(KERNEL_OUT_DIR) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(PREFIX_CROSS_COMPILE) $(KERNEL_CONFIG); fi))
+
+$(info $(shell if [ ! -e $(KERNEL_OUT_DIR)/include/generated/autoconf.h ]; then $(MAKE) -C $(KERNEL_DIR) O=../$(KERNEL_OUT_DIR) ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(PREFIX_CROSS_COMPILE) modules_prepare; fi))
+
+$(info $(shell $(MAKE) -C $(shell pwd)/$(KERNEL_OUT_DIR) M=$(shell pwd)/$(BOARD_AML_VENDOR_PATH)/tdk/linuxdriver/ ARCH=$(KERNEL_ARCH) CROSS_COMPILE=$(PREFIX_CROSS_COMPILE) modules))
+
+$(info $(shell mkdir -p $(PRODUCT_OUT)/obj/lib))
+$(info $(shell cp -vf $(LOCAL_PATH)/optee/optee_armtz.ko $(PRODUCT_OUT)/obj/lib))
+$(info $(shell cp -vf $(LOCAL_PATH)/optee.ko $(PRODUCT_OUT)/obj/lib))
+
+armtz_ko_file := $(wildcard $(LOCAL_PATH)/optee/*.ko)
+armtz_ko_file := $(patsubst $(LOCAL_PATH)/optee/%,%,$(armtz_ko_file))
+
+core_ko_file := $(wildcard $(LOCAL_PATH)/*.ko)
+core_ko_file := $(patsubst $(LOCAL_PATH)/%,%,$(core_ko_file))
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := optee_armtz
+LOCAL_SRC_FILES := optee/$(armtz_ko_file)
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE_SUFFIX := .ko
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib
+LOCAL_STRIP_MODULE := false
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := optee
+LOCAL_SRC_FILES := $(core_ko_file)
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := SHARED_LIBRARIES
+LOCAL_MODULE_SUFFIX := .ko
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/lib
+LOCAL_STRIP_MODULE := false
+include $(BUILD_PREBUILT)
diff --git a/Kconfig b/Kconfig
new file mode 100755 (executable)
index 0000000..2330a4e
--- /dev/null
+++ b/Kconfig
@@ -0,0 +1,18 @@
+# Generic Trusted Execution Environment Configuration
+config TEE
+       tristate "Trusted Execution Environment support"
+       select DMA_SHARED_BUFFER
+       select GENERIC_ALLOCATOR
+       help
+         This implements a generic interface towards a Trusted Execution
+         Environment (TEE).
+
+if TEE
+
+menu "TEE drivers"
+
+source "drivers/tee/optee/Kconfig"
+
+endmenu
+
+endif
diff --git a/Makefile b/Makefile
new file mode 100755 (executable)
index 0000000..f94a071
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,10 @@
+ccflags-y+=-Werror
+ccflags-y+=-I$(M)/include/linux
+ccflags-y+=-I$(M)/include
+
+obj-m += optee.o
+obj-y += optee/
+
+optee-objs := tee_core.o \
+             tee_shm.o \
+             tee_shm_pool.o
diff --git a/Module.symvers b/Module.symvers
new file mode 100644 (file)
index 0000000..5d6a2a9
--- /dev/null
@@ -0,0 +1,22 @@
+0x89eb90b8     tee_shm_free    /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x3a1ee744     tee_get_drvdata /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x583850f2     tee_client_invoke_func  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x4c5a9474     tee_shm_get_va  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x64dd992e     tee_shm_get_pa  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x3b16fec1     tee_shm_get_id  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0xfed4b4a3     tee_shm_pa2va   /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x8bc0ad8f     tee_shm_register_fd     /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0xb825500a     tee_shm_pool_free       /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0xe04e1fe1     tee_client_open_context /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x2464be37     tee_device_register     /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x5980900a     tee_shm_put     /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x47897b88     tee_client_close_context        /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x28ab93ee     tee_client_open_session /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x09529f94     tee_device_alloc        /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x475dd1fb     tee_shm_get_from_id     /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0xe29e245a     tee_client_get_version  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x5ef21393     tee_client_close_session        /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0xb84e3e9c     tee_shm_alloc   /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x453da992     tee_shm_pool_alloc_res_mem      /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x7cbb7be8     tee_device_unregister   /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
+0x0d10caa2     tee_shm_va2pa   /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee   EXPORT_SYMBOL_GPL
diff --git a/build_gx.sh b/build_gx.sh
new file mode 100755 (executable)
index 0000000..53bb93d
--- /dev/null
@@ -0,0 +1,67 @@
+#!/bin/bash
+
+LOCAL_PATH=`pwd`
+KERNEL_CONFIG=meson64_defconfig
+export ARCH=arm64
+export CROSS_COMPILE=aarch64-linux-gnu-
+
+if [ "$KERNEL_SRC_DIR" = "" ]; then
+       KERNEL_SRC_DIR=/mnt/fileroot/peifu/kernel-m8
+fi
+if [ "$KERNEL_OUT_DIR" = "" ]; then
+       KERNEL_OUT_DIR=/mnt/fileroot/peifu/kernel-m8/out
+fi
+
+show_help()
+{
+       echo "*** Please export KERNEL_SRC_DIR and KERNEL_OUT_DIR before building."
+       echo "e.g."
+       echo "    export KERNEL_SRC_DIR=/mnt/fileroot/peifu/kernel"
+       echo "    export KERNEL_OUT_DIR=/mnt/fileroot/peifu/kernel/out"
+       echo "    ./build_gx.sh"
+}
+
+show_path()
+{
+       echo "*** KERNEL_SRC_DIR=$KERNEL_SRC_DIR"
+       echo "*** KERNEL_OUT_DIR=$KERNEL_OUT_DIR"
+}
+
+do_build()
+{
+       if [ ! -d $KERNEL_SRC_DIR ]; then
+               echo "*** $KERNEL_SRC_DIR: No such directory!"
+               show_help;
+               exit;
+       fi
+       if [ ! -d $KERNEL_OUT_DIR ]; then
+               echo "*** $KERNEL_OUT_DIR not exist, create now\n"
+               mkdir -p $KERNEL_OUT_DIR
+       fi
+       if [ ! -e $KERNEL_OUT_DIR/include/generated/autoconf.h ]; then
+               make -C $KERNEL_SRC_DIR O=$KERNEL_OUT_DIR $KERNEL_CONFIG
+               make -C $KERNEL_SRC_DIR O=$KERNEL_OUT_DIR modules_prepare
+       fi
+       make -C $KERNEL_SRC_DIR O=$KERNEL_OUT_DIR M=$LOCAL_PATH modules
+}
+
+do_clean()
+{
+       if [ ! -d $KERNEL_SRC_DIR ]; then
+               echo "*** $KERNEL_SRC_DIR: No such directory!\n"
+               show_help;
+               exit;
+       fi
+       make -C $KERNEL_SRC_DIR O=$KERNEL_OUT_DIR M=$LOCAL_PATH clean
+}
+
+if [ "$1" = "help" ]; then
+       show_help;
+       exit;
+elif [ "$1" = "clean" ]; then
+       do_clean;
+       exit;
+else
+       show_path;
+       do_build;
+fi
diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h
new file mode 100755 (executable)
index 0000000..699c0d8
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2015, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+#ifndef __LINUX_ARM_SMCCC_H
+#define __LINUX_ARM_SMCCC_H
+
+#include <linux/linkage.h>
+#include <linux/types.h>
+
+/*
+ * This file provides common defines for ARM SMC Calling Convention as
+ * specified in
+ * http://infocenter.arm.com/help/topic/com.arm.doc.den0028a/index.html
+ */
+
+/* This constant is shifted by 31, make sure it's of an unsigned type */
+#define ARM_SMCCC_STD_CALL             0UL
+#define ARM_SMCCC_FAST_CALL            1UL
+#define ARM_SMCCC_TYPE_SHIFT           31
+
+#define ARM_SMCCC_SMC_32               0
+#define ARM_SMCCC_SMC_64               1
+#define ARM_SMCCC_CALL_CONV_SHIFT      30
+
+#define ARM_SMCCC_OWNER_MASK           0x3F
+#define ARM_SMCCC_OWNER_SHIFT          24
+
+#define ARM_SMCCC_FUNC_MASK            0xFFFF
+
+#define ARM_SMCCC_IS_FAST_CALL(smc_val)        \
+       ((smc_val) & (ARM_SMCCC_FAST_CALL << ARM_SMCCC_TYPE_SHIFT))
+#define ARM_SMCCC_IS_64(smc_val) \
+       ((smc_val) & (ARM_SMCCC_SMC_64 << ARM_SMCCC_CALL_CONV_SHIFT))
+#define ARM_SMCCC_FUNC_NUM(smc_val)    ((smc_val) & ARM_SMCCC_FUNC_MASK)
+#define ARM_SMCCC_OWNER_NUM(smc_val) \
+       (((smc_val) >> ARM_SMCCC_OWNER_SHIFT) & ARM_SMCCC_OWNER_MASK)
+
+#define ARM_SMCCC_CALL_VAL(type, calling_convention, owner, func_num) \
+       (((type) << ARM_SMCCC_TYPE_SHIFT) | \
+       ((calling_convention) << ARM_SMCCC_CALL_CONV_SHIFT) | \
+       (((owner) & ARM_SMCCC_OWNER_MASK) << ARM_SMCCC_OWNER_SHIFT) | \
+       ((func_num) & ARM_SMCCC_FUNC_MASK))
+
+#define ARM_SMCCC_OWNER_ARCH           0
+#define ARM_SMCCC_OWNER_CPU            1
+#define ARM_SMCCC_OWNER_SIP            2
+#define ARM_SMCCC_OWNER_OEM            3
+#define ARM_SMCCC_OWNER_STANDARD       4
+#define ARM_SMCCC_OWNER_TRUSTED_APP    48
+#define ARM_SMCCC_OWNER_TRUSTED_APP_END        49
+#define ARM_SMCCC_OWNER_TRUSTED_OS     50
+#define ARM_SMCCC_OWNER_TRUSTED_OS_END 63
+
+/**
+ * struct arm_smccc_res - Result from SMC/HVC call
+ * @a0-a3 result values from registers 0 to 3
+ */
+struct arm_smccc_res {
+       unsigned long a0;
+       unsigned long a1;
+       unsigned long a2;
+       unsigned long a3;
+};
+
+/**
+ * arm_smccc_smc() - make SMC calls
+ * @a0-a7: arguments passed in registers 0 to 7
+ * @res: result values from registers 0 to 3
+ *
+ * This function is used to make SMC calls following SMC Calling Convention.
+ * The content of the supplied param are copied to registers 0 to 7 prior
+ * to the SMC instruction. The return values are updated with the content
+ * from register 0 to 3 on return from the SMC instruction.
+ */
+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);
+
+/**
+ * arm_smccc_hvc() - make HVC calls
+ * @a0-a7: arguments passed in registers 0 to 7
+ * @res: result values from registers 0 to 3
+ *
+ * This function is used to make HVC calls following SMC Calling
+ * Convention.  The content of the supplied param are copied to registers 0
+ * to 7 prior to the HVC instruction. The return values are updated with
+ * the content from register 0 to 3 on return from the HVC instruction.
+ */
+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);
+
+#endif /*__LINUX_ARM_SMCCC_H*/
diff --git a/include/linux/tee.h b/include/linux/tee.h
new file mode 100755 (executable)
index 0000000..31f7127
--- /dev/null
@@ -0,0 +1,383 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef __TEE_H
+#define __TEE_H
+
+#include <linux/ioctl.h>
+#include <linux/types.h>
+
+/*
+ * This file describes the API provided by a TEE driver to user space.
+ *
+ * Each TEE driver defines a TEE specific protocol which is used for the
+ * data passed back and forth using TEE_IOC_CMD.
+ */
+
+/* Helpers to make the ioctl defines */
+#define TEE_IOC_MAGIC  0xa4
+#define TEE_IOC_BASE   0
+
+/* Flags relating to shared memory */
+#define TEE_IOCTL_SHM_MAPPED   0x1     /* memory mapped in normal world */
+#define TEE_IOCTL_SHM_DMA_BUF  0x2     /* dma-buf handle on shared memory */
+
+#define TEE_MAX_ARG_SIZE       1024
+
+#define TEE_GEN_CAP_GP         (1 << 0)/* GlobalPlatform compliant TEE */
+#define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */
+
+/*
+ * TEE Implementation ID
+ */
+#define TEE_IMPL_ID_OPTEE      1
+
+/*
+ * OP-TEE specific capabilities
+ */
+#define TEE_OPTEE_CAP_TZ       (1 << 0)
+
+/**
+ * struct tee_ioctl_version_data - TEE version
+ * @impl_id:   [out] TEE implementation id
+ * @impl_caps: [out] Implementation specific capabilities
+ * @gen_caps:  [out] Generic capabilities, defined by TEE_GEN_CAPS_* above
+ *
+ * Identifies the TEE implementation, @impl_id is one of TEE_IMPL_ID_* above.
+ * @impl_caps is implementation specific, for example TEE_OPTEE_CAP_*
+ * is valid when @impl_id == TEE_IMPL_ID_OPTEE.
+ */
+struct tee_ioctl_version_data {
+       __u32 impl_id;
+       __u32 impl_caps;
+       __u32 gen_caps;
+};
+
+/**
+ * TEE_IOC_VERSION - query version of TEE
+ *
+ * Takes a tee_ioctl_version_data struct and returns with the TEE version
+ * data filled in.
+ */
+#define TEE_IOC_VERSION                _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 0, \
+                                    struct tee_ioctl_version_data)
+
+/**
+ * struct tee_ioctl_shm_alloc_data - Shared memory allocate argument
+ * @size:      [in/out] Size of shared memory to allocate
+ * @flags:     [in/out] Flags to/from allocation.
+ * @id:                [out] Identifier of the shared memory
+ *
+ * The flags field should currently be zero as input. Updated by the call
+ * with actual flags as defined by TEE_IOCTL_SHM_* above.
+ * This structure is used as argument for TEE_IOC_SHM_ALLOC below.
+ */
+struct tee_ioctl_shm_alloc_data {
+       __u64 size;
+       __u32 flags;
+       __s32 id;
+};
+
+/**
+ * TEE_IOC_SHM_ALLOC - allocate shared memory
+ *
+ * Allocates shared memory between the user space process and secure OS.
+ *
+ * Returns a file descriptor on success or < 0 on failure
+ *
+ * The returned file descriptor is used to map the shared memory into user
+ * space. The shared memory is freed when the descriptor is closed and the
+ * memory is unmapped.
+ */
+#define TEE_IOC_SHM_ALLOC      _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 1, \
+                                    struct tee_ioctl_shm_alloc_data)
+
+/**
+ * struct tee_ioctl_shm_register_fd_data - Shared memory registering argument
+ * @fd:                [in] file descriptor identifying the shared memory
+ * @size:      [out] Size of shared memory to allocate
+ * @flags:     [in] Flags to/from allocation.
+ * @id:                [out] Identifier of the shared memory
+ *
+ * The flags field should currently be zero as input. Updated by the call
+ * with actual flags as defined by TEE_IOCTL_SHM_* above.
+ * This structure is used as argument for TEE_IOC_SHM_ALLOC below.
+ */
+struct tee_ioctl_shm_register_fd_data {
+       __s64 fd;
+       __u64 size;
+       __u32 flags;
+       __s32 id;
+} __aligned(8);
+
+/**
+ * TEE_IOC_SHM_REGISTER_FD - register a shared memory from a file descriptor
+ *
+ * Returns a file descriptor on success or < 0 on failure
+ *
+ * The returned file descriptor refers to the shared memory object in kernel
+ * land. The shared memory is freed when the descriptor is closed.
+ */
+#define TEE_IOC_SHM_REGISTER_FD        _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 8, \
+                                    struct tee_ioctl_shm_register_fd_data)
+
+/**
+ * struct tee_ioctl_buf_data - Variable sized buffer
+ * @buf_ptr:   [in] A __user pointer to a buffer
+ * @buf_len:   [in] Length of the buffer above
+ *
+ * Used as argument for TEE_IOC_OPEN_SESSION, TEE_IOC_INVOKE,
+ * TEE_IOC_SUPPL_RECV, and TEE_IOC_SUPPL_SEND below.
+ */
+struct tee_ioctl_buf_data {
+       __u64 buf_ptr;
+       __u64 buf_len;
+};
+
+/*
+ * Attributes for struct tee_ioctl_param, selects field in the union
+ */
+#define TEE_IOCTL_PARAM_ATTR_TYPE_NONE         0       /* parameter not used */
+
+/*
+ * These defines value parameters (struct tee_ioctl_param_value)
+ */
+#define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT  1
+#define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT 2
+#define TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT  3       /* input and output */
+
+/*
+ * These defines shared memory reference parameters (struct
+ * tee_ioctl_param_memref)
+ */
+#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT 5
+#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT        6
+#define TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT 7       /* input and output */
+
+/*
+ * Mask for the type part of the attribute, leaves room for more types
+ */
+#define TEE_IOCTL_PARAM_ATTR_TYPE_MASK         0xff
+
+/* Meta parameter carrying extra information about the message. */
+#define TEE_IOCTL_PARAM_ATTR_META              0x100
+
+/* Mask of all known attr bits */
+#define TEE_IOCTL_PARAM_ATTR_MASK \
+       (TEE_IOCTL_PARAM_ATTR_TYPE_MASK | TEE_IOCTL_PARAM_ATTR_META)
+
+/*
+ * Matches TEEC_LOGIN_* in GP TEE Client API
+ * Are only defined for GP compliant TEEs
+ */
+#define TEE_IOCTL_LOGIN_PUBLIC                 0
+#define TEE_IOCTL_LOGIN_USER                   1
+#define TEE_IOCTL_LOGIN_GROUP                  2
+#define TEE_IOCTL_LOGIN_APPLICATION            4
+#define TEE_IOCTL_LOGIN_USER_APPLICATION       5
+#define TEE_IOCTL_LOGIN_GROUP_APPLICATION      6
+
+/**
+ * struct tee_ioctl_param - parameter
+ * @attr: attributes
+ * @a: if a memref, offset into the shared memory object, else a value parameter
+ * @b: if a memref, size of the buffer, else a value parameter
+ * @c: if a memref, shared memory identifier, else a value parameter
+ *
+ * @attr & TEE_PARAM_ATTR_TYPE_MASK indicates if memref or value is used in
+ * the union. TEE_PARAM_ATTR_TYPE_VALUE_* indicates value and
+ * TEE_PARAM_ATTR_TYPE_MEMREF_* indicates memref. TEE_PARAM_ATTR_TYPE_NONE
+ * indicates that none of the members are used.
+ *
+ * Shared memory is allocated with TEE_IOC_SHM_ALLOC which returns an
+ * identifier representing the shared memory object. A memref can reference
+ * a part of a shared memory by specifying an offset (@a) and size (@b) of
+ * the object. To supply the entire shared memory object set the offset
+ * (@a) to 0 and size (@b) to the previously returned size of the object.
+ */
+struct tee_ioctl_param {
+       __u64 attr;
+       __u64 a;
+       __u64 b;
+       __u64 c;
+};
+
+#define TEE_IOCTL_UUID_LEN             16
+
+/**
+ * struct tee_ioctl_open_session_arg - Open session argument
+ * @uuid:      [in] UUID of the Trusted Application
+ * @clnt_uuid: [in] UUID of client
+ * @clnt_login:        [in] Login class of client, TEE_IOCTL_LOGIN_* above
+ * @cancel_id: [in] Cancellation id, a unique value to identify this request
+ * @session:   [out] Session id
+ * @ret:       [out] return value
+ * @ret_origin [out] origin of the return value
+ * @num_params [in] number of parameters following this struct
+ */
+struct tee_ioctl_open_session_arg {
+       __u8 uuid[TEE_IOCTL_UUID_LEN];
+       __u8 clnt_uuid[TEE_IOCTL_UUID_LEN];
+       __u32 clnt_login;
+       __u32 cancel_id;
+       __u32 session;
+       __u32 ret;
+       __u32 ret_origin;
+       __u32 num_params;
+       /* num_params tells the actual number of element in params */
+       struct tee_ioctl_param params[];
+};
+
+/**
+ * TEE_IOC_OPEN_SESSION - opens a session to a Trusted Application
+ *
+ * Takes a struct tee_ioctl_buf_data which contains a struct
+ * tee_ioctl_open_session_arg followed by any array of struct
+ * tee_ioctl_param
+ */
+#define TEE_IOC_OPEN_SESSION   _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 2, \
+                                    struct tee_ioctl_buf_data)
+
+/**
+ * struct tee_ioctl_invoke_func_arg - Invokes a function in a Trusted
+ * Application
+ * @func:      [in] Trusted Application function, specific to the TA
+ * @session:   [in] Session id
+ * @cancel_id: [in] Cancellation id, a unique value to identify this request
+ * @ret:       [out] return value
+ * @ret_origin [out] origin of the return value
+ * @num_params [in] number of parameters following this struct
+ */
+struct tee_ioctl_invoke_arg {
+       __u32 func;
+       __u32 session;
+       __u32 cancel_id;
+       __u32 ret;
+       __u32 ret_origin;
+       __u32 num_params;
+       /* num_params tells the actual number of element in params */
+       struct tee_ioctl_param params[];
+};
+
+/**
+ * TEE_IOC_INVOKE - Invokes a function in a Trusted Application
+ *
+ * Takes a struct tee_ioctl_buf_data which contains a struct
+ * tee_invoke_func_arg followed by any array of struct tee_param
+ */
+#define TEE_IOC_INVOKE         _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 3, \
+                                    struct tee_ioctl_buf_data)
+
+/**
+ * struct tee_ioctl_cancel_arg - Cancels an open session or invoke ioctl
+ * @cancel_id: [in] Cancellation id, a unique value to identify this request
+ * @session:   [in] Session id, if the session is opened, else set to 0
+ */
+struct tee_ioctl_cancel_arg {
+       __u32 cancel_id;
+       __u32 session;
+};
+
+/**
+ * TEE_IOC_CANCEL - Cancels an open session or invoke
+ */
+#define TEE_IOC_CANCEL         _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 4, \
+                                    struct tee_ioctl_cancel_arg)
+
+/**
+ * struct tee_ioctl_close_session_arg - Closes an open session
+ * @session:   [in] Session id
+ */
+struct tee_ioctl_close_session_arg {
+       __u32 session;
+};
+
+/**
+ * TEE_IOC_CLOSE_SESSION - Closes a session
+ */
+#define TEE_IOC_CLOSE_SESSION  _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 5, \
+                                    struct tee_ioctl_close_session_arg)
+
+/**
+ * struct tee_iocl_supp_recv_arg - Receive a request for a supplicant function
+ * @func:      [in] supplicant function
+ * @num_params [in/out] number of parameters following this struct
+ *
+ * @num_params is the number of params that tee-supplicant has room to
+ * receive when input, @num_params is the number of actual params
+ * tee-supplicant receives when output.
+ */
+struct tee_iocl_supp_recv_arg {
+       __u32 func;
+       __u32 num_params;
+       /* num_params tells the actual number of element in params */
+       struct tee_ioctl_param params[];
+};
+
+/**
+ * TEE_IOC_SUPPL_RECV - Receive a request for a supplicant function
+ *
+ * Takes a struct tee_ioctl_buf_data which contains a struct
+ * tee_iocl_supp_recv_arg followed by any array of struct tee_param
+ */
+#define TEE_IOC_SUPPL_RECV     _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 6, \
+                                    struct tee_ioctl_buf_data)
+
+/**
+ * struct tee_iocl_supp_send_arg - Send a response to a received request
+ * @ret:       [out] return value
+ * @num_params [in] number of parameters following this struct
+ */
+struct tee_iocl_supp_send_arg {
+       __u32 ret;
+       __u32 num_params;
+       /* num_params tells the actual number of element in params */
+       struct tee_ioctl_param params[];
+};
+
+/**
+ * TEE_IOC_SUPPL_SEND - Receive a request for a supplicant function
+ *
+ * Takes a struct tee_ioctl_buf_data which contains a struct
+ * tee_iocl_supp_send_arg followed by any array of struct tee_param
+ */
+#define TEE_IOC_SUPPL_SEND     _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \
+                                    struct tee_ioctl_buf_data)
+
+/*
+ * Five syscalls are used when communicating with the TEE driver.
+ * open(): opens the device associated with the driver
+ * ioctl(): as described above operating on the file descriptor from open()
+ * close(): two cases
+ *   - closes the device file descriptor
+ *   - closes a file descriptor connected to allocated shared memory
+ * mmap(): maps shared memory into user space using information from struct
+ *        tee_ioctl_shm_alloc_data
+ * munmap(): unmaps previously shared memory
+ */
+
+#endif /*__TEE_H*/
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
new file mode 100755 (executable)
index 0000000..401c014
--- /dev/null
@@ -0,0 +1,320 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+
+#ifndef __TEE_DRV_H
+#define __TEE_DRV_H
+
+#include <linux/types.h>
+#include <linux/idr.h>
+#include <linux/list.h>
+#include "tee.h"
+
+/*
+ * The file describes the API provided by the generic TEE driver to the
+ * specific TEE driver.
+ */
+
+#define TEE_SHM_MAPPED         BIT(0)  /* Memory mapped by the kernel */
+#define TEE_SHM_DMA_BUF                BIT(1)  /* Memory with dma-buf handle */
+#define TEE_SHM_EXT_DMA_BUF    BIT(2)  /* Memory with dma-buf handle */
+
+struct tee_device;
+struct tee_shm;
+struct tee_shm_pool;
+
+/**
+ * struct tee_context - driver specific context on file pointer data
+ * @teedev:    pointer to this drivers struct tee_device
+ * @list_shm:  List of shared memory object owned by this context
+ * @data:      driver specific context data, managed by the driver
+ */
+struct tee_context {
+       struct tee_device *teedev;
+       struct list_head list_shm;
+       void *data;
+};
+
+struct tee_param_memref {
+       size_t shm_offs;
+       size_t size;
+       struct tee_shm *shm;
+};
+
+struct tee_param_value {
+       u64 a;
+       u64 b;
+       u64 c;
+};
+
+struct tee_param {
+       u64 attr;
+       union {
+               struct tee_param_memref memref;
+               struct tee_param_value value;
+       } u;
+};
+
+/**
+ * struct tee_driver_ops - driver operations vtable
+ * @get_version:       returns version of driver
+ * @open:              called when the device file is opened
+ * @release:           release this open file
+ * @open_session:      open a new session
+ * @close_session:     close a session
+ * @invoke_func:       invoke a trusted function
+ * @cancel_req:                request cancel of an ongoing invoke or open
+ * @supp_revc:         called for supplicant to get a command
+ * @supp_send:         called for supplicant to send a response
+ */
+struct tee_driver_ops {
+       void (*get_version)(struct tee_device *teedev,
+                           struct tee_ioctl_version_data *vers);
+       int (*open)(struct tee_context *ctx);
+       void (*release)(struct tee_context *ctx);
+       int (*open_session)(struct tee_context *ctx,
+                           struct tee_ioctl_open_session_arg *arg,
+                           struct tee_param *param);
+       int (*close_session)(struct tee_context *ctx, u32 session);
+       int (*invoke_func)(struct tee_context *ctx,
+                          struct tee_ioctl_invoke_arg *arg,
+                          struct tee_param *param);
+       int (*cancel_req)(struct tee_context *ctx, u32 cancel_id, u32 session);
+       int (*supp_recv)(struct tee_context *ctx, u32 *func, u32 *num_params,
+                        struct tee_param *param);
+       int (*supp_send)(struct tee_context *ctx, u32 ret, u32 num_params,
+                        struct tee_param *param);
+};
+
+/**
+ * struct tee_desc - Describes the TEE driver to the subsystem
+ * @name:      name of driver
+ * @ops:       driver operations vtable
+ * @owner:     module providing the driver
+ * @flags:     Extra properties of driver, defined by TEE_DESC_* below
+ */
+#define TEE_DESC_PRIVILEGED    0x1
+struct tee_desc {
+       const char *name;
+       const struct tee_driver_ops *ops;
+       struct module *owner;
+       u32 flags;
+};
+
+/**
+ * tee_device_alloc() - Allocate a new struct tee_device instance
+ * @teedesc:   Descriptor for this driver
+ * @dev:       Parent device for this device
+ * @pool:      Shared memory pool, NULL if not used
+ * @driver_data: Private driver data for this device
+ *
+ * Allocates a new struct tee_device instance. The device is
+ * removed by tee_device_unregister().
+ *
+ * @returns a pointer to a 'struct tee_device' or an ERR_PTR on failure
+ */
+struct tee_device *tee_device_alloc(const struct tee_desc *teedesc,
+                                   struct device *dev,
+                                   struct tee_shm_pool *pool,
+                                   void *driver_data);
+
+/**
+ * tee_device_register() - Registers a TEE device
+ * @teedev:    Device to register
+ *
+ * tee_device_unregister() need to be called to remove the @teedev if
+ * this function fails.
+ *
+ * @returns < 0 on failure
+ */
+int tee_device_register(struct tee_device *teedev);
+
+/**
+ * tee_device_unregister() - Removes a TEE device
+ * @teedev:    Device to unregister
+ *
+ * This function should be called to remove the @teedev even if
+ * tee_device_register() hasn't been called yet. Does nothing if
+ * @teedev is NULL.
+ */
+void tee_device_unregister(struct tee_device *teedev);
+
+/**
+ * struct tee_shm_pool_mem_info - holds information needed to create a shared
+ * memory pool
+ * @vaddr:     Virtual address of start of pool
+ * @paddr:     Physical address of start of pool
+ * @size:      Size in bytes of the pool
+ */
+struct tee_shm_pool_mem_info {
+       unsigned long vaddr;
+       phys_addr_t paddr;
+       size_t size;
+};
+
+/**
+ * tee_shm_pool_alloc_res_mem() - Create a shared memory pool from reserved
+ * memory range
+ * @priv_info:  Information for driver private shared memory pool
+ * @dmabuf_info: Information for dma-buf shared memory pool
+ *
+ * Start and end of pools will must be page aligned.
+ *
+ * Allocation with the flag TEE_SHM_DMA_BUF set will use the range supplied
+ * in @dmabuf, others will use the range provided by @priv.
+ *
+ * @returns pointer to a 'struct tee_shm_pool' or an ERR_PTR on failure.
+ */
+struct tee_shm_pool *
+tee_shm_pool_alloc_res_mem(struct tee_shm_pool_mem_info *priv_info,
+                          struct tee_shm_pool_mem_info *dmabuf_info);
+
+/**
+ * tee_shm_pool_free() - Free a shared memory pool
+ * @pool:      The shared memory pool to free
+ *
+ * The must be no remaining shared memory allocated from this pool when
+ * this function is called.
+ */
+void tee_shm_pool_free(struct tee_shm_pool *pool);
+
+/**
+ * tee_get_drvdata() - Return driver_data pointer
+ * @returns the driver_data pointer supplied to tee_register().
+ */
+void *tee_get_drvdata(struct tee_device *teedev);
+
+/**
+ * tee_shm_alloc() - Allocate shared memory
+ * @ctx:       Context that allocates the shared memory
+ * @size:      Requested size of shared memory
+ * @flags:     Flags setting properties for the requested shared memory.
+ *
+ * Memory allocated as global shared memory is automatically freed when the
+ * TEE file pointer is closed. The @flags field uses the bits defined by
+ * TEE_SHM_* above. TEE_SHM_MAPPED must currently always be set. If
+ * TEE_SHM_DMA_BUF global shared memory will be allocated and associated
+ * with a dma-buf handle, else driver private memory.
+ *
+ * @returns a pointer to 'struct tee_shm'
+ */
+struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags);
+
+/**
+ * tee_shm_register_fd() - Register shared memory from file descriptor
+ *
+ * @ctx:       Context that allocates the shared memory
+ * @fd:                shared memory file descriptor reference.
+ *
+ * @returns a pointer to 'struct tee_shm'
+ */
+struct tee_shm *tee_shm_register_fd(struct tee_context *ctx, int fd);
+
+/**
+ * tee_shm_free() - Free shared memory
+ * @shm:       Handle to shared memory to free
+ */
+void tee_shm_free(struct tee_shm *shm);
+
+/**
+ * tee_shm_put() - Decrease reference count on a shared memory handle
+ * @shm:       Shared memory handle
+ */
+void tee_shm_put(struct tee_shm *shm);
+
+/**
+ * tee_shm_va2pa() - Get physical address of a virtual address
+ * @shm:       Shared memory handle
+ * @va:                Virtual address to tranlsate
+ * @pa:                Returned physical address
+ * @returns 0 on success and < 0 on failure
+ */
+int tee_shm_va2pa(struct tee_shm *shm, void *va, phys_addr_t *pa);
+
+/**
+ * tee_shm_pa2va() - Get virtual address of a physical address
+ * @shm:       Shared memory handle
+ * @pa:                Physical address to tranlsate
+ * @va:                Returned virtual address
+ * @returns 0 on success and < 0 on failure
+ */
+int tee_shm_pa2va(struct tee_shm *shm, phys_addr_t pa, void **va);
+
+/**
+ * tee_shm_get_va() - Get virtual address of a shared memory plus an offset
+ * @shm:       Shared memory handle
+ * @offs:      Offset from start of this shared memory
+ * @returns virtual address of the shared memory + offs if offs is within
+ *     the bounds of this shared memory, else an ERR_PTR
+ */
+void *tee_shm_get_va(struct tee_shm *shm, size_t offs);
+
+/**
+ * tee_shm_get_pa() - Get physical address of a shared memory plus an offset
+ * @shm:       Shared memory handle
+ * @offs:      Offset from start of this shared memory
+ * @pa:                Physical address to return
+ * @returns 0 if offs is within the bounds of this shared memory, else an
+ *     error code.
+ */
+int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa);
+
+/**
+ * tee_shm_get_id() - Get id of a shared memory object
+ * @shm:       Shared memory handle
+ * @returns id
+ */
+int tee_shm_get_id(struct tee_shm *shm);
+
+/**
+ * tee_shm_get_from_id() - Find shared memory object and increase reference
+ * count
+ * @ctx:       Context owning the shared memory
+ * @id:                Id of shared memory object
+ * @returns a pointer to 'struct tee_shm' on success or an ERR_PTR on failure
+ */
+struct tee_shm *tee_shm_get_from_id(struct tee_context *ctx, int id);
+
+static inline bool tee_param_is_memref(struct tee_param *param)
+{
+       switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
+       case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
+       case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
+       case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
+               return true;
+       default:
+               return false;
+       }
+}
+
+struct tee_context *tee_client_open_context(struct tee_context *start,
+                       int (*match)(struct tee_ioctl_version_data *,
+                               const void *),
+                       const void *data, struct tee_ioctl_version_data *vers);
+
+void tee_client_close_context(struct tee_context *ctx);
+
+void tee_client_get_version(struct tee_context *ctx,
+                       struct tee_ioctl_version_data *vers);
+
+int tee_client_open_session(struct tee_context *ctx,
+                       struct tee_ioctl_open_session_arg *arg,
+                       struct tee_param *param);
+
+int tee_client_close_session(struct tee_context *ctx, u32 session);
+
+int tee_client_invoke_func(struct tee_context *ctx,
+                       struct tee_ioctl_invoke_arg *arg,
+                       struct tee_param *param);
+
+#endif /*__TEE_DRV_H*/
diff --git a/modules.order b/modules.order
new file mode 100644 (file)
index 0000000..98f3ebe
--- /dev/null
@@ -0,0 +1,2 @@
+kernel//mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.ko
+kernel//mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee.ko
diff --git a/optee.ko b/optee.ko
new file mode 100644 (file)
index 0000000..a6d0ee0
Binary files /dev/null and b/optee.ko differ
diff --git a/optee.mod.c b/optee.mod.c
new file mode 100644 (file)
index 0000000..7f54012
--- /dev/null
@@ -0,0 +1,97 @@
+#include <linux/module.h>
+#include <linux/vermagic.h>
+#include <linux/compiler.h>
+
+MODULE_INFO(vermagic, VERMAGIC_STRING);
+
+__visible struct module __this_module
+__attribute__((section(".gnu.linkonce.this_module"))) = {
+       .name = KBUILD_MODNAME,
+       .init = init_module,
+#ifdef CONFIG_MODULE_UNLOAD
+       .exit = cleanup_module,
+#endif
+       .arch = MODULE_ARCH_INIT,
+};
+
+#ifdef RETPOLINE
+MODULE_INFO(retpoline, "Y");
+#endif
+
+static const struct modversion_info ____versions[]
+__used
+__attribute__((section("__versions"))) = {
+       { 0x4730f430, __VMLINUX_SYMBOL_STR(module_layout) },
+       { 0x29e0a6e5, __VMLINUX_SYMBOL_STR(class_find_device) },
+       { 0x8e9dfe81, __VMLINUX_SYMBOL_STR(cdev_del) },
+       { 0xf644c769, __VMLINUX_SYMBOL_STR(kmalloc_caches) },
+       { 0xd2b09ce5, __VMLINUX_SYMBOL_STR(__kmalloc) },
+       { 0x9ad88ec0, __VMLINUX_SYMBOL_STR(cdev_init) },
+       { 0x1fdc7df2, __VMLINUX_SYMBOL_STR(_mcount) },
+       { 0xf33847d3, __VMLINUX_SYMBOL_STR(_raw_spin_unlock) },
+       { 0x67135917, __VMLINUX_SYMBOL_STR(gen_pool_virt_to_phys) },
+       { 0x1b1e1088, __VMLINUX_SYMBOL_STR(sg_nents) },
+       { 0x12c1ac27, __VMLINUX_SYMBOL_STR(dma_buf_detach) },
+       { 0xb70789e, __VMLINUX_SYMBOL_STR(__might_fault) },
+       { 0x84bc974b, __VMLINUX_SYMBOL_STR(__arch_copy_from_user) },
+       { 0xb7b8bb11, __VMLINUX_SYMBOL_STR(mutex_unlock) },
+       { 0x7485e15e, __VMLINUX_SYMBOL_STR(unregister_chrdev_region) },
+       { 0xa87cf413, __VMLINUX_SYMBOL_STR(clear_bit) },
+       { 0x54d64690, __VMLINUX_SYMBOL_STR(sysfs_remove_group) },
+       { 0xcac48425, __VMLINUX_SYMBOL_STR(gen_pool_alloc) },
+       { 0x24980a54, __VMLINUX_SYMBOL_STR(gen_pool_best_fit) },
+       { 0xab40cca9, __VMLINUX_SYMBOL_STR(__init_waitqueue_head) },
+       { 0xf9dde891, __VMLINUX_SYMBOL_STR(wait_for_completion) },
+       { 0xb2845834, __VMLINUX_SYMBOL_STR(gen_pool_add_virt) },
+       { 0xdcb764ad, __VMLINUX_SYMBOL_STR(memset) },
+       { 0x20906cd5, __VMLINUX_SYMBOL_STR(idr_destroy) },
+       { 0x8c71e07d, __VMLINUX_SYMBOL_STR(device_del) },
+       { 0x3e089534, __VMLINUX_SYMBOL_STR(dev_err) },
+       { 0x27ae16cc, __VMLINUX_SYMBOL_STR(__mutex_init) },
+       { 0x27e1a049, __VMLINUX_SYMBOL_STR(printk) },
+       { 0x67d3c146, __VMLINUX_SYMBOL_STR(sysfs_create_group) },
+       { 0xe533b67, __VMLINUX_SYMBOL_STR(dma_buf_fd) },
+       { 0x479c3c86, __VMLINUX_SYMBOL_STR(find_next_zero_bit) },
+       { 0x20a35d8b, __VMLINUX_SYMBOL_STR(dma_buf_put) },
+       { 0xfe414cfc, __VMLINUX_SYMBOL_STR(dma_buf_get) },
+       { 0x778bff44, __VMLINUX_SYMBOL_STR(mutex_lock) },
+       { 0xa850dafc, __VMLINUX_SYMBOL_STR(idr_alloc) },
+       { 0x23fd6482, __VMLINUX_SYMBOL_STR(device_add) },
+       { 0xf6851529, __VMLINUX_SYMBOL_STR(dma_buf_unmap_attachment) },
+       { 0xb4fc735b, __VMLINUX_SYMBOL_STR(idr_remove) },
+       { 0x97efa109, __VMLINUX_SYMBOL_STR(cdev_add) },
+       { 0xaacc3134, __VMLINUX_SYMBOL_STR(idr_find_slowpath) },
+       { 0xa5cc8a1f, __VMLINUX_SYMBOL_STR(dma_buf_map_attachment) },
+       { 0x1e7e6c41, __VMLINUX_SYMBOL_STR(dma_buf_export) },
+       { 0x44c1982d, __VMLINUX_SYMBOL_STR(put_device) },
+       { 0xb35dea8f, __VMLINUX_SYMBOL_STR(__arch_copy_to_user) },
+       { 0xdb7305a1, __VMLINUX_SYMBOL_STR(__stack_chk_fail) },
+       { 0xd68452ac, __VMLINUX_SYMBOL_STR(gen_pool_destroy) },
+       { 0x8008793c, __VMLINUX_SYMBOL_STR(kmem_cache_alloc_trace) },
+       { 0x5cd885d5, __VMLINUX_SYMBOL_STR(_raw_spin_lock) },
+       { 0xf79bfad5, __VMLINUX_SYMBOL_STR(dma_buf_attach) },
+       { 0x3c1a5a3, __VMLINUX_SYMBOL_STR(gen_pool_set_algo) },
+       { 0x37a0cba, __VMLINUX_SYMBOL_STR(kfree) },
+       { 0xcd553752, __VMLINUX_SYMBOL_STR(remap_pfn_range) },
+       { 0xae8c4d0c, __VMLINUX_SYMBOL_STR(set_bit) },
+       { 0xdeec8e1f, __VMLINUX_SYMBOL_STR(device_initialize) },
+       { 0x4ca9669f, __VMLINUX_SYMBOL_STR(scnprintf) },
+       { 0x5d19d02, __VMLINUX_SYMBOL_STR(class_destroy) },
+       { 0x8f678b07, __VMLINUX_SYMBOL_STR(__stack_chk_guard) },
+       { 0x3dc135f6, __VMLINUX_SYMBOL_STR(gen_pool_create) },
+       { 0xbdbc13a1, __VMLINUX_SYMBOL_STR(complete) },
+       { 0x28318305, __VMLINUX_SYMBOL_STR(snprintf) },
+       { 0x29c76ba8, __VMLINUX_SYMBOL_STR(dev_set_name) },
+       { 0x6f5ec7ec, __VMLINUX_SYMBOL_STR(idr_init) },
+       { 0xb84d8fdb, __VMLINUX_SYMBOL_STR(gen_pool_free) },
+       { 0xbcd5209e, __VMLINUX_SYMBOL_STR(__class_create) },
+       { 0x29537c9e, __VMLINUX_SYMBOL_STR(alloc_chrdev_region) },
+};
+
+static const char __module_depends[]
+__used
+__attribute__((section(".modinfo"))) =
+"depends=";
+
+
+MODULE_INFO(srcversion, "FA34CEEBF8F62643C245DAA");
diff --git a/optee.mod.o b/optee.mod.o
new file mode 100644 (file)
index 0000000..67e865c
Binary files /dev/null and b/optee.mod.o differ
diff --git a/optee.o b/optee.o
new file mode 100644 (file)
index 0000000..44a12c7
Binary files /dev/null and b/optee.o differ
diff --git a/optee/.call.o.cmd b/optee/.call.o.cmd
new file mode 100644 (file)
index 0000000..1cb2cbd
--- /dev/null
@@ -0,0 +1,727 @@
+cmd_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/call.o := aarch64-linux-gnu-gcc -Wp,-MD,/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.call.o.d  -nostdinc -isystem /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include -I./arch/arm64/include/generated/uapi -I./arch/arm64/include/generated  -I/mnt/fileroot/lei.qian/p-amlogic/common/include -I./include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi -I/mnt/fileroot/lei.qian/p-amlogic/common/include/uapi -I./include/generated/uapi -include /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kconfig.h -I/mnt/fileroot/lei.qian/p-amlogic/common//mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -Werror -std=gnu89 -fno-PIE -fno-PIE -mgeneral-regs-only -fno-asynchronous-unwind-tables -fno-pic -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include  -DMODULE -mcmodel=large  -DKBUILD_BASENAME='"call"'  -DKBUILD_MODNAME='"optee_armtz"' -c -o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.tmp_call.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/call.c
+
+source_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/call.o := /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/call.c
+
+deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/call.o := \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/arm-smccc.h \
+    $(wildcard include/config/arm64.h) \
+    $(wildcard include/config/arm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/const.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler.h \
+    $(wildcard include/config/sparse/rcu/pointer.h) \
+    $(wildcard include/config/trace/branch/profiling.h) \
+    $(wildcard include/config/profile/all/branches.h) \
+    $(wildcard include/config/kasan.h) \
+    $(wildcard include/config/enable/must/check.h) \
+    $(wildcard include/config/enable/warn/deprecated.h) \
+    $(wildcard include/config/kprobes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler-gcc.h \
+    $(wildcard include/config/arch/supports/optimized/inlining.h) \
+    $(wildcard include/config/optimize/inlining.h) \
+    $(wildcard include/config/gcov/kernel.h) \
+    $(wildcard include/config/stack/validation.h) \
+    $(wildcard include/config/arch/use/builtin/bswap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/types.h \
+  arch/arm64/include/generated/asm/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitsperlong.h \
+    $(wildcard include/config/64bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringify.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/export.h \
+    $(wildcard include/config/have/underscore/symbol/prefix.h) \
+    $(wildcard include/config/modules.h) \
+    $(wildcard include/config/modversions.h) \
+    $(wildcard include/config/trim/unused/ksyms.h) \
+    $(wildcard include/config/unused/symbols.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/types.h \
+    $(wildcard include/config/have/uid16.h) \
+    $(wildcard include/config/uid16.h) \
+    $(wildcard include/config/lbdaf.h) \
+    $(wildcard include/config/arch/dma/addr/t/64bit.h) \
+    $(wildcard include/config/phys/addr/t/64bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/device.h \
+    $(wildcard include/config/debug/devres.h) \
+    $(wildcard include/config/generic/msi/irq/domain.h) \
+    $(wildcard include/config/pinctrl.h) \
+    $(wildcard include/config/generic/msi/irq.h) \
+    $(wildcard include/config/numa.h) \
+    $(wildcard include/config/dma/cma.h) \
+    $(wildcard include/config/pm/sleep.h) \
+    $(wildcard include/config/of.h) \
+    $(wildcard include/config/devtmpfs.h) \
+    $(wildcard include/config/printk.h) \
+    $(wildcard include/config/dynamic/debug.h) \
+    $(wildcard include/config/sysfs/deprecated.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ioport.h \
+    $(wildcard include/config/memory/hotremove.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject.h \
+    $(wildcard include/config/uevent/helper.h) \
+    $(wildcard include/config/debug/kobject/release.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list.h \
+    $(wildcard include/config/debug/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/poison.h \
+    $(wildcard include/config/illegal/pointer/value.h) \
+    $(wildcard include/config/page/poisoning/zero.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/const.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernel.h \
+    $(wildcard include/config/preempt/voluntary.h) \
+    $(wildcard include/config/debug/atomic/sleep.h) \
+    $(wildcard include/config/mmu.h) \
+    $(wildcard include/config/prove/locking.h) \
+    $(wildcard include/config/panic/timeout.h) \
+    $(wildcard include/config/tracing.h) \
+    $(wildcard include/config/ftrace/mcount/record.h) \
+  /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/lib/gcc/aarch64-linux-gnu/4.9.2/include/stdarg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/barrier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/barrier.h \
+    $(wildcard include/config/smp.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/ffz.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/fls64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/find.h \
+    $(wildcard include/config/generic/find/first/bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/arch_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/const_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/lock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/non-atomic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/le.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/byteorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/swab.h \
+  arch/arm64/include/generated/asm/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/generic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/log2.h \
+    $(wildcard include/config/arch/has/ilog2/u32.h) \
+    $(wildcard include/config/arch/has/ilog2/u64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/typecheck.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/printk.h \
+    $(wildcard include/config/message/loglevel/default.h) \
+    $(wildcard include/config/early/printk.h) \
+    $(wildcard include/config/printk/nmi.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/init.h \
+    $(wildcard include/config/debug/rodata.h) \
+    $(wildcard include/config/debug/set/module/ronx.h) \
+    $(wildcard include/config/lto/clang.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kern_levels.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cache.h \
+    $(wildcard include/config/arch/has/cache/line/size.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kernel.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysinfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cache.h \
+    $(wildcard include/config/amlogic/memory/extend.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cachetype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cputype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sysreg.h \
+    $(wildcard include/config/arm64/4k/pages.h) \
+    $(wildcard include/config/arm64/16k/pages.h) \
+    $(wildcard include/config/arm64/64k/pages.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/big/endian.h) \
+    $(wildcard include/config/cpu/endian/be8.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/../../arm/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/endian/be32.h) \
+    $(wildcard include/config/thumb2/kernel.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysfs.h \
+    $(wildcard include/config/debug/lock/alloc.h) \
+    $(wildcard include/config/sysfs.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernfs.h \
+    $(wildcard include/config/kernfs.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/err.h \
+  arch/arm64/include/generated/asm/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno-base.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mutex.h \
+    $(wildcard include/config/debug/mutexes.h) \
+    $(wildcard include/config/mutex/spin/on/owner.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/current.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_types.h \
+    $(wildcard include/config/generic/lockbreak.h) \
+    $(wildcard include/config/debug/spinlock.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/lockdep.h \
+    $(wildcard include/config/lockdep.h) \
+    $(wildcard include/config/lock/stat.h) \
+    $(wildcard include/config/trace/irqflags.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/atomic.h \
+    $(wildcard include/config/generic/atomic64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic.h \
+    $(wildcard include/config/arm64/lse/atomics.h) \
+    $(wildcard include/config/as/lse.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/lse.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic_ll_sc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cmpxchg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bug.h \
+    $(wildcard include/config/generic/bug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bug.h \
+    $(wildcard include/config/debug/bugverbose.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/brk-imm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bug.h \
+    $(wildcard include/config/bug.h) \
+    $(wildcard include/config/generic/bug/relative/pointers.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/atomic-long.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/processor.h \
+    $(wildcard include/config/compat.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/string.h \
+    $(wildcard include/config/binary/printf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/alternative.h \
+    $(wildcard include/config/arm64/uao.h) \
+    $(wildcard include/config/foo.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpucaps.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/insn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/fpsimd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hw_breakpoint.h \
+    $(wildcard include/config/have/hw/breakpoint.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpufeature.h \
+    $(wildcard include/config/arm64/sw/ttbr0/pan.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jump_label.h \
+    $(wildcard include/config/jump/label.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/jump_label.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/virt.h \
+    $(wildcard include/config/arm64/vhe.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-hwdef.h \
+    $(wildcard include/config/pgtable/levels.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/osq_lock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/idr.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcupdate.h \
+    $(wildcard include/config/tiny/rcu.h) \
+    $(wildcard include/config/tree/rcu.h) \
+    $(wildcard include/config/preempt/rcu.h) \
+    $(wildcard include/config/rcu/trace.h) \
+    $(wildcard include/config/preempt/count.h) \
+    $(wildcard include/config/rcu/stall/common.h) \
+    $(wildcard include/config/no/hz/full.h) \
+    $(wildcard include/config/rcu/nocb/cpu.h) \
+    $(wildcard include/config/tasks/rcu.h) \
+    $(wildcard include/config/debug/objects/rcu/head.h) \
+    $(wildcard include/config/hotplug/cpu.h) \
+    $(wildcard include/config/prove/rcu.h) \
+    $(wildcard include/config/preempt.h) \
+    $(wildcard include/config/rcu/boost.h) \
+    $(wildcard include/config/rcu/nocb/cpu/all.h) \
+    $(wildcard include/config/no/hz/full/sysidle.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/preempt.h \
+    $(wildcard include/config/debug/preempt.h) \
+    $(wildcard include/config/preempt/tracer.h) \
+    $(wildcard include/config/preempt/notifiers.h) \
+  arch/arm64/include/generated/asm/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/thread_info.h \
+    $(wildcard include/config/thread/info/in/task.h) \
+    $(wildcard include/config/debug/stack/usage.h) \
+    $(wildcard include/config/have/arch/within/stack/frames.h) \
+    $(wildcard include/config/hardened/usercopy.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/restart_block.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/thread_info.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stack_pointer.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/irqflags.h \
+    $(wildcard include/config/irqsoff/tracer.h) \
+    $(wildcard include/config/trace/irqflags/support.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/irqflags.h \
+    $(wildcard include/config/amlogic/debug/lockup.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/../drivers/amlogic/debug/irqflags_debug.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/amlogic/debug_lockup.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bottom_half.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_api_smp.h \
+    $(wildcard include/config/inline/spin/lock.h) \
+    $(wildcard include/config/inline/spin/lock/bh.h) \
+    $(wildcard include/config/inline/spin/lock/irq.h) \
+    $(wildcard include/config/inline/spin/lock/irqsave.h) \
+    $(wildcard include/config/inline/spin/trylock.h) \
+    $(wildcard include/config/inline/spin/trylock/bh.h) \
+    $(wildcard include/config/uninline/spin/unlock.h) \
+    $(wildcard include/config/inline/spin/unlock/bh.h) \
+    $(wildcard include/config/inline/spin/unlock/irq.h) \
+    $(wildcard include/config/inline/spin/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_api_smp.h \
+    $(wildcard include/config/inline/read/lock.h) \
+    $(wildcard include/config/inline/write/lock.h) \
+    $(wildcard include/config/inline/read/lock/bh.h) \
+    $(wildcard include/config/inline/write/lock/bh.h) \
+    $(wildcard include/config/inline/read/lock/irq.h) \
+    $(wildcard include/config/inline/write/lock/irq.h) \
+    $(wildcard include/config/inline/read/lock/irqsave.h) \
+    $(wildcard include/config/inline/write/lock/irqsave.h) \
+    $(wildcard include/config/inline/read/trylock.h) \
+    $(wildcard include/config/inline/write/trylock.h) \
+    $(wildcard include/config/inline/read/unlock.h) \
+    $(wildcard include/config/inline/write/unlock.h) \
+    $(wildcard include/config/inline/read/unlock/bh.h) \
+    $(wildcard include/config/inline/write/unlock/bh.h) \
+    $(wildcard include/config/inline/read/unlock/irq.h) \
+    $(wildcard include/config/inline/write/unlock/irq.h) \
+    $(wildcard include/config/inline/read/unlock/irqrestore.h) \
+    $(wildcard include/config/inline/write/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/threads.h \
+    $(wildcard include/config/nr/cpus.h) \
+    $(wildcard include/config/base/small.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cpumask.h \
+    $(wildcard include/config/cpumask/offstack.h) \
+    $(wildcard include/config/debug/per/cpu/maps.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitmap.h \
+    $(wildcard include/config/s390.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seqlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/completion.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/debugobjects.h \
+    $(wildcard include/config/debug/objects.h) \
+    $(wildcard include/config/debug/objects/free.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ktime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time.h \
+    $(wildcard include/config/arch/uses/gettimeoffset.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/math64.h \
+    $(wildcard include/config/arch/supports/int128.h) \
+  arch/arm64/include/generated/asm/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/time.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jiffies.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/param.h \
+    $(wildcard include/config/hz.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/arch_timer.h \
+    $(wildcard include/config/fsl/erratum/a008585.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/clocksource/arm_arch_timer.h \
+    $(wildcard include/config/arm/arch/timer.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timecounter.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/timex.h \
+  include/generated/timeconst.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timekeeping.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcutree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rbtree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject_ns.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/compat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched.h \
+    $(wildcard include/config/cpu/quiet.h) \
+    $(wildcard include/config/no/hz/common.h) \
+    $(wildcard include/config/sched/debug.h) \
+    $(wildcard include/config/lockup/detector.h) \
+    $(wildcard include/config/detect/hung/task.h) \
+    $(wildcard include/config/core/dump/default/elf/headers.h) \
+    $(wildcard include/config/virt/cpu/accounting/native.h) \
+    $(wildcard include/config/sched/autogroup.h) \
+    $(wildcard include/config/bsd/process/acct.h) \
+    $(wildcard include/config/taskstats.h) \
+    $(wildcard include/config/audit.h) \
+    $(wildcard include/config/inotify/user.h) \
+    $(wildcard include/config/fanotify.h) \
+    $(wildcard include/config/epoll.h) \
+    $(wildcard include/config/posix/mqueue.h) \
+    $(wildcard include/config/keys.h) \
+    $(wildcard include/config/perf/events.h) \
+    $(wildcard include/config/bpf/syscall.h) \
+    $(wildcard include/config/sched/info.h) \
+    $(wildcard include/config/task/delay/acct.h) \
+    $(wildcard include/config/schedstats.h) \
+    $(wildcard include/config/sched/smt.h) \
+    $(wildcard include/config/sched/mc.h) \
+    $(wildcard include/config/sched/walt.h) \
+    $(wildcard include/config/fair/group/sched.h) \
+    $(wildcard include/config/rt/group/sched.h) \
+    $(wildcard include/config/cgroup/sched.h) \
+    $(wildcard include/config/blk/dev/io/trace.h) \
+    $(wildcard include/config/memcg.h) \
+    $(wildcard include/config/slob.h) \
+    $(wildcard include/config/compat/brk.h) \
+    $(wildcard include/config/cgroups.h) \
+    $(wildcard include/config/cc/stackprotector.h) \
+    $(wildcard include/config/cpu/freq/times.h) \
+    $(wildcard include/config/virt/cpu/accounting/gen.h) \
+    $(wildcard include/config/sysvipc.h) \
+    $(wildcard include/config/auditsyscall.h) \
+    $(wildcard include/config/rt/mutexes.h) \
+    $(wildcard include/config/ubsan.h) \
+    $(wildcard include/config/block.h) \
+    $(wildcard include/config/task/xacct.h) \
+    $(wildcard include/config/cpusets.h) \
+    $(wildcard include/config/futex.h) \
+    $(wildcard include/config/numa/balancing.h) \
+    $(wildcard include/config/arch/want/batched/unmap/tlb/flush.h) \
+    $(wildcard include/config/fault/injection.h) \
+    $(wildcard include/config/latencytop.h) \
+    $(wildcard include/config/function/graph/tracer.h) \
+    $(wildcard include/config/kcov.h) \
+    $(wildcard include/config/uprobes.h) \
+    $(wildcard include/config/bcache.h) \
+    $(wildcard include/config/vmap/stack.h) \
+    $(wildcard include/config/arch/wants/dynamic/task/struct.h) \
+    $(wildcard include/config/have/unstable/sched/clock.h) \
+    $(wildcard include/config/irq/time/accounting.h) \
+    $(wildcard include/config/proc/fs.h) \
+    $(wildcard include/config/stack/growsup.h) \
+    $(wildcard include/config/have/copy/thread/tls.h) \
+    $(wildcard include/config/have/exit/thread.h) \
+    $(wildcard include/config/cpu/freq.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched/prio.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/capability.h \
+    $(wildcard include/config/multiuser.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/capability.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/plist.h \
+    $(wildcard include/config/debug/pi/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/nodemask.h \
+    $(wildcard include/config/highmem.h) \
+    $(wildcard include/config/movable/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/numa.h \
+    $(wildcard include/config/nodes/shift.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mm_types.h \
+    $(wildcard include/config/split/ptlock/cpus.h) \
+    $(wildcard include/config/arch/enable/split/pmd/ptlock.h) \
+    $(wildcard include/config/amlogic/page/trace.h) \
+    $(wildcard include/config/have/cmpxchg/double.h) \
+    $(wildcard include/config/have/aligned/struct/page.h) \
+    $(wildcard include/config/transparent/hugepage.h) \
+    $(wildcard include/config/kmemcheck.h) \
+    $(wildcard include/config/userfaultfd.h) \
+    $(wildcard include/config/aio.h) \
+    $(wildcard include/config/mmu/notifier.h) \
+    $(wildcard include/config/compaction.h) \
+    $(wildcard include/config/x86/intel/mpx.h) \
+    $(wildcard include/config/hugetlb/page.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwsem.h \
+    $(wildcard include/config/rwsem/spin/on/owner.h) \
+    $(wildcard include/config/rwsem/generic/spinlock.h) \
+  arch/arm64/include/generated/asm/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uprobes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/page-flags-layout.h \
+    $(wildcard include/config/sparsemem.h) \
+    $(wildcard include/config/sparsemem/vmemmap.h) \
+  include/generated/bounds.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sparsemem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/workqueue.h \
+    $(wildcard include/config/debug/objects/work.h) \
+    $(wildcard include/config/freezer.h) \
+    $(wildcard include/config/wq/watchdog.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timer.h \
+    $(wildcard include/config/timer/stats.h) \
+    $(wildcard include/config/debug/objects/timers.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysctl.h \
+    $(wildcard include/config/sysctl.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uidgid.h \
+    $(wildcard include/config/user/ns.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/highuid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/page.h \
+    $(wildcard include/config/arm64/page/shift.h) \
+    $(wildcard include/config/arm64/cont/shift.h) \
+    $(wildcard include/config/have/arch/pfn/valid.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/pgtable-nopud.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/memory.h \
+    $(wildcard include/config/arm64/va/bits.h) \
+    $(wildcard include/config/blk/dev/initrd.h) \
+  arch/arm64/include/generated/asm/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmdebug.h \
+    $(wildcard include/config/debug/vm.h) \
+    $(wildcard include/config/debug/virtual.h) \
+    $(wildcard include/config/debug/vm/pgflags.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/memory_model.h \
+    $(wildcard include/config/flatmem.h) \
+    $(wildcard include/config/discontigmem.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pfn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/getorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/mmu.h \
+    $(wildcard include/config/unmap/kernel/at/el0.h) \
+    $(wildcard include/config/harden/branch/predictor.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu.h \
+    $(wildcard include/config/need/per/cpu/embed/first/chunk.h) \
+    $(wildcard include/config/need/per/cpu/page/first/chunk.h) \
+    $(wildcard include/config/have/setup/per/cpu/area.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/smp.h \
+    $(wildcard include/config/amlogic/modify.h) \
+    $(wildcard include/config/up/late/init.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/llist.h \
+    $(wildcard include/config/arch/have/nmi/safe/cmpxchg.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/smp.h \
+    $(wildcard include/config/arm64/acpi/parking/protocol.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-defs.h \
+    $(wildcard include/config/page/table/isolation.h) \
+    $(wildcard include/config/debug/force/weak/per/cpu.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cputime.h \
+  arch/arm64/include/generated/asm/cputime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime.h \
+    $(wildcard include/config/virt/cpu/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime_jiffies.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ipc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/ipc.h \
+  arch/arm64/include/generated/asm/ipcbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/ipcbuf.h \
+  arch/arm64/include/generated/asm/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/shm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/shm.h \
+  arch/arm64/include/generated/asm/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/signal.h \
+    $(wildcard include/config/old/sigaction.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal-defs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/sigcontext.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/topology.h \
+    $(wildcard include/config/use/percpu/numa/node/id.h) \
+    $(wildcard include/config/have/memoryless/nodes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmzone.h \
+    $(wildcard include/config/force/max/zoneorder.h) \
+    $(wildcard include/config/cma.h) \
+    $(wildcard include/config/memory/isolation.h) \
+    $(wildcard include/config/zsmalloc.h) \
+    $(wildcard include/config/amlogic/cma.h) \
+    $(wildcard include/config/zone/dma.h) \
+    $(wildcard include/config/zone/dma32.h) \
+    $(wildcard include/config/zone/device.h) \
+    $(wildcard include/config/memory/hotplug.h) \
+    $(wildcard include/config/flat/node/mem/map.h) \
+    $(wildcard include/config/page/extension.h) \
+    $(wildcard include/config/no/bootmem.h) \
+    $(wildcard include/config/deferred/struct/page/init.h) \
+    $(wildcard include/config/have/memory/present.h) \
+    $(wildcard include/config/need/node/memmap/size.h) \
+    $(wildcard include/config/have/memblock/node/map.h) \
+    $(wildcard include/config/need/multiple/nodes.h) \
+    $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
+    $(wildcard include/config/sparsemem/extreme.h) \
+    $(wildcard include/config/holes/in/zone.h) \
+    $(wildcard include/config/arch/has/holes/memorymodel.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pageblock-flags.h \
+    $(wildcard include/config/hugetlb/page/size/variable.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/memory_hotplug.h \
+    $(wildcard include/config/have/arch/nodedata/extension.h) \
+    $(wildcard include/config/have/bootmem/info/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/notifier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/srcu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seccomp.h \
+    $(wildcard include/config/seccomp.h) \
+    $(wildcard include/config/have/arch/seccomp/filter.h) \
+    $(wildcard include/config/seccomp/filter.h) \
+    $(wildcard include/config/checkpoint/restore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rculist.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rtmutex.h \
+    $(wildcard include/config/debug/rt/mutexes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/resource.h \
+  arch/arm64/include/generated/asm/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/hrtimer.h \
+    $(wildcard include/config/high/res/timers.h) \
+    $(wildcard include/config/time/low/res.h) \
+    $(wildcard include/config/timerfd.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timerqueue.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/task_io_accounting.h \
+    $(wildcard include/config/task/io/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/latencytop.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cred.h \
+    $(wildcard include/config/debug/credentials.h) \
+    $(wildcard include/config/security.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/key.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/assoc_array.h \
+    $(wildcard include/config/associative/array.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/selinux.h \
+    $(wildcard include/config/security/selinux.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/gfp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/magic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup-defs.h \
+    $(wildcard include/config/sock/cgroup/data.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/limits.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-refcount.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcu_sync.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bpf-cgroup.h \
+    $(wildcard include/config/cgroup/bpf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf_common.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup_subsys.h \
+    $(wildcard include/config/cgroup/cpuacct.h) \
+    $(wildcard include/config/cgroup/schedtune.h) \
+    $(wildcard include/config/blk/cgroup.h) \
+    $(wildcard include/config/cgroup/device.h) \
+    $(wildcard include/config/cgroup/freezer.h) \
+    $(wildcard include/config/cgroup/net/classid.h) \
+    $(wildcard include/config/cgroup/perf.h) \
+    $(wildcard include/config/cgroup/net/prio.h) \
+    $(wildcard include/config/cgroup/hugetlb.h) \
+    $(wildcard include/config/cgroup/pids.h) \
+    $(wildcard include/config/cgroup/debug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kref.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/klist.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/devinfo.h \
+    $(wildcard include/config/pm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/consumer.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seq_file.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/fs.h \
+    $(wildcard include/config/fs/posix/acl.h) \
+    $(wildcard include/config/cgroup/writeback.h) \
+    $(wildcard include/config/ima.h) \
+    $(wildcard include/config/fsnotify.h) \
+    $(wildcard include/config/fs/encryption.h) \
+    $(wildcard include/config/file/locking.h) \
+    $(wildcard include/config/quota.h) \
+    $(wildcard include/config/fs/dax.h) \
+    $(wildcard include/config/mandatory/file/locking.h) \
+    $(wildcard include/config/migration.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kdev_t.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kdev_t.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dcache.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rculist_bl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list_bl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bit_spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/lockref.h \
+    $(wildcard include/config/arch/use/cmpxchg/lockref.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringhash.h \
+    $(wildcard include/config/dcache/word/access.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/hash.h \
+    $(wildcard include/config/have/arch/hash.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/path.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list_lru.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/shrinker.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/radix-tree.h \
+    $(wildcard include/config/radix/tree/multiorder.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/semaphore.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fiemap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/migrate_mode.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/blk_types.h \
+    $(wildcard include/config/blk/dev/integrity.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/delayed_call.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/ioctl.h \
+  arch/arm64/include/generated/asm/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/quota.h \
+    $(wildcard include/config/quota/netlink/interface.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu_counter.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/dqblk_xfs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_v1.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_v2.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_qtree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/projid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/quota.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/nfs_fs_i.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/pinctrl-state.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pm.h \
+    $(wildcard include/config/vt/console/sleep.h) \
+    $(wildcard include/config/amlogic/usb.h) \
+    $(wildcard include/config/pm/clk.h) \
+    $(wildcard include/config/pm/generic/domains.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ratelimit.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/device.h \
+    $(wildcard include/config/iommu/api.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pm_wakeup.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/slab.h \
+    $(wildcard include/config/debug/slab.h) \
+    $(wildcard include/config/failslab.h) \
+    $(wildcard include/config/have/hardened/usercopy/allocator.h) \
+    $(wildcard include/config/slab.h) \
+    $(wildcard include/config/slub.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kmemleak.h \
+    $(wildcard include/config/debug/kmemleak.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kasan.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux/tee_drv.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux/tee.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uaccess.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/uaccess.h \
+    $(wildcard include/config/arm64/pan.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/kernel-pgtable.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable.h \
+    $(wildcard include/config/arm64/hw/afdbm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/proc-fns.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-prot.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/fixmap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/boot.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/fixmap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/pgtable.h \
+    $(wildcard include/config/have/arch/soft/dirty.h) \
+    $(wildcard include/config/have/arch/huge/vmap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kasan-checks.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/compiler.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_private.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_msg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_smc.h \
+
+/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/call.o: $(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/call.o)
+
+$(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/call.o):
diff --git a/optee/.core.o.cmd b/optee/.core.o.cmd
new file mode 100644 (file)
index 0000000..3706f89
--- /dev/null
@@ -0,0 +1,809 @@
+cmd_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/core.o := aarch64-linux-gnu-gcc -Wp,-MD,/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.core.o.d  -nostdinc -isystem /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include -I./arch/arm64/include/generated/uapi -I./arch/arm64/include/generated  -I/mnt/fileroot/lei.qian/p-amlogic/common/include -I./include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi -I/mnt/fileroot/lei.qian/p-amlogic/common/include/uapi -I./include/generated/uapi -include /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kconfig.h -I/mnt/fileroot/lei.qian/p-amlogic/common//mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -Werror -std=gnu89 -fno-PIE -fno-PIE -mgeneral-regs-only -fno-asynchronous-unwind-tables -fno-pic -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include  -DMODULE -mcmodel=large  -DKBUILD_BASENAME='"core"'  -DKBUILD_MODNAME='"optee_armtz"' -c -o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.tmp_core.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/core.c
+
+source_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/core.o := /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/core.c
+
+deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/core.o := \
+    $(wildcard include/config/smp.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/arm-smccc.h \
+    $(wildcard include/config/arm64.h) \
+    $(wildcard include/config/arm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/const.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler.h \
+    $(wildcard include/config/sparse/rcu/pointer.h) \
+    $(wildcard include/config/trace/branch/profiling.h) \
+    $(wildcard include/config/profile/all/branches.h) \
+    $(wildcard include/config/kasan.h) \
+    $(wildcard include/config/enable/must/check.h) \
+    $(wildcard include/config/enable/warn/deprecated.h) \
+    $(wildcard include/config/kprobes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler-gcc.h \
+    $(wildcard include/config/arch/supports/optimized/inlining.h) \
+    $(wildcard include/config/optimize/inlining.h) \
+    $(wildcard include/config/gcov/kernel.h) \
+    $(wildcard include/config/stack/validation.h) \
+    $(wildcard include/config/arch/use/builtin/bswap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/types.h \
+  arch/arm64/include/generated/asm/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitsperlong.h \
+    $(wildcard include/config/64bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringify.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/export.h \
+    $(wildcard include/config/have/underscore/symbol/prefix.h) \
+    $(wildcard include/config/modules.h) \
+    $(wildcard include/config/modversions.h) \
+    $(wildcard include/config/trim/unused/ksyms.h) \
+    $(wildcard include/config/unused/symbols.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/types.h \
+    $(wildcard include/config/have/uid16.h) \
+    $(wildcard include/config/uid16.h) \
+    $(wildcard include/config/lbdaf.h) \
+    $(wildcard include/config/arch/dma/addr/t/64bit.h) \
+    $(wildcard include/config/phys/addr/t/64bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/errno.h \
+  arch/arm64/include/generated/asm/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno-base.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/io.h \
+    $(wildcard include/config/mmu.h) \
+    $(wildcard include/config/have/arch/huge/vmap.h) \
+    $(wildcard include/config/has/ioport/map.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/init.h \
+    $(wildcard include/config/debug/rodata.h) \
+    $(wildcard include/config/debug/set/module/ronx.h) \
+    $(wildcard include/config/lto/clang.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bug.h \
+    $(wildcard include/config/generic/bug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bug.h \
+    $(wildcard include/config/debug/bugverbose.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/brk-imm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bug.h \
+    $(wildcard include/config/bug.h) \
+    $(wildcard include/config/generic/bug/relative/pointers.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernel.h \
+    $(wildcard include/config/preempt/voluntary.h) \
+    $(wildcard include/config/debug/atomic/sleep.h) \
+    $(wildcard include/config/prove/locking.h) \
+    $(wildcard include/config/panic/timeout.h) \
+    $(wildcard include/config/tracing.h) \
+    $(wildcard include/config/ftrace/mcount/record.h) \
+  /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/lib/gcc/aarch64-linux-gnu/4.9.2/include/stdarg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/barrier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/barrier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/ffz.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/fls64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/find.h \
+    $(wildcard include/config/generic/find/first/bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/arch_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/const_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/lock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/non-atomic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/le.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/byteorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/swab.h \
+  arch/arm64/include/generated/asm/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/generic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/log2.h \
+    $(wildcard include/config/arch/has/ilog2/u32.h) \
+    $(wildcard include/config/arch/has/ilog2/u64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/typecheck.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/printk.h \
+    $(wildcard include/config/message/loglevel/default.h) \
+    $(wildcard include/config/early/printk.h) \
+    $(wildcard include/config/printk/nmi.h) \
+    $(wildcard include/config/printk.h) \
+    $(wildcard include/config/dynamic/debug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kern_levels.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cache.h \
+    $(wildcard include/config/arch/has/cache/line/size.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kernel.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysinfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cache.h \
+    $(wildcard include/config/amlogic/memory/extend.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cachetype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cputype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sysreg.h \
+    $(wildcard include/config/arm64/4k/pages.h) \
+    $(wildcard include/config/arm64/16k/pages.h) \
+    $(wildcard include/config/arm64/64k/pages.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/big/endian.h) \
+    $(wildcard include/config/cpu/endian/be8.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/../../arm/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/endian/be32.h) \
+    $(wildcard include/config/thumb2/kernel.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/err.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/io.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/blk_types.h \
+    $(wildcard include/config/block.h) \
+    $(wildcard include/config/blk/cgroup.h) \
+    $(wildcard include/config/blk/dev/integrity.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/memory.h \
+    $(wildcard include/config/arm64/va/bits.h) \
+    $(wildcard include/config/blk/dev/initrd.h) \
+    $(wildcard include/config/sparsemem/vmemmap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/const.h \
+  arch/arm64/include/generated/asm/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmdebug.h \
+    $(wildcard include/config/debug/vm.h) \
+    $(wildcard include/config/debug/virtual.h) \
+    $(wildcard include/config/debug/vm/pgflags.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/memory_model.h \
+    $(wildcard include/config/flatmem.h) \
+    $(wildcard include/config/discontigmem.h) \
+    $(wildcard include/config/sparsemem.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pfn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable.h \
+    $(wildcard include/config/arm64/hw/afdbm.h) \
+    $(wildcard include/config/numa/balancing.h) \
+    $(wildcard include/config/transparent/hugepage.h) \
+    $(wildcard include/config/pgtable/levels.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/proc-fns.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/page.h \
+    $(wildcard include/config/arm64/page/shift.h) \
+    $(wildcard include/config/arm64/cont/shift.h) \
+    $(wildcard include/config/have/arch/pfn/valid.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/pgtable-nopud.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/getorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-hwdef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-prot.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/fixmap.h \
+    $(wildcard include/config/unmap/kernel/at/el0.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/boot.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/fixmap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/pgtable.h \
+    $(wildcard include/config/have/arch/soft/dirty.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mm_types.h \
+    $(wildcard include/config/split/ptlock/cpus.h) \
+    $(wildcard include/config/arch/enable/split/pmd/ptlock.h) \
+    $(wildcard include/config/amlogic/page/trace.h) \
+    $(wildcard include/config/have/cmpxchg/double.h) \
+    $(wildcard include/config/have/aligned/struct/page.h) \
+    $(wildcard include/config/memcg.h) \
+    $(wildcard include/config/kmemcheck.h) \
+    $(wildcard include/config/userfaultfd.h) \
+    $(wildcard include/config/numa.h) \
+    $(wildcard include/config/aio.h) \
+    $(wildcard include/config/mmu/notifier.h) \
+    $(wildcard include/config/cpumask/offstack.h) \
+    $(wildcard include/config/compaction.h) \
+    $(wildcard include/config/arch/want/batched/unmap/tlb/flush.h) \
+    $(wildcard include/config/x86/intel/mpx.h) \
+    $(wildcard include/config/hugetlb/page.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/threads.h \
+    $(wildcard include/config/nr/cpus.h) \
+    $(wildcard include/config/base/small.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list.h \
+    $(wildcard include/config/debug/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/poison.h \
+    $(wildcard include/config/illegal/pointer/value.h) \
+    $(wildcard include/config/page/poisoning/zero.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock.h \
+    $(wildcard include/config/debug/spinlock.h) \
+    $(wildcard include/config/generic/lockbreak.h) \
+    $(wildcard include/config/preempt.h) \
+    $(wildcard include/config/debug/lock/alloc.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/preempt.h \
+    $(wildcard include/config/preempt/count.h) \
+    $(wildcard include/config/debug/preempt.h) \
+    $(wildcard include/config/preempt/tracer.h) \
+    $(wildcard include/config/preempt/notifiers.h) \
+  arch/arm64/include/generated/asm/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/thread_info.h \
+    $(wildcard include/config/thread/info/in/task.h) \
+    $(wildcard include/config/debug/stack/usage.h) \
+    $(wildcard include/config/have/arch/within/stack/frames.h) \
+    $(wildcard include/config/hardened/usercopy.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/restart_block.h \
+    $(wildcard include/config/compat.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/current.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/thread_info.h \
+    $(wildcard include/config/arm64/sw/ttbr0/pan.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stack_pointer.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/irqflags.h \
+    $(wildcard include/config/trace/irqflags.h) \
+    $(wildcard include/config/irqsoff/tracer.h) \
+    $(wildcard include/config/trace/irqflags/support.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/irqflags.h \
+    $(wildcard include/config/amlogic/debug/lockup.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/../drivers/amlogic/debug/irqflags_debug.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/amlogic/debug_lockup.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bottom_half.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/lockdep.h \
+    $(wildcard include/config/lockdep.h) \
+    $(wildcard include/config/lock/stat.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/lse.h \
+    $(wildcard include/config/as/lse.h) \
+    $(wildcard include/config/arm64/lse/atomics.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/processor.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/string.h \
+    $(wildcard include/config/binary/printf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/alternative.h \
+    $(wildcard include/config/arm64/uao.h) \
+    $(wildcard include/config/foo.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpucaps.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/insn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/fpsimd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hw_breakpoint.h \
+    $(wildcard include/config/have/hw/breakpoint.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpufeature.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jump_label.h \
+    $(wildcard include/config/jump/label.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/jump_label.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/virt.h \
+    $(wildcard include/config/arm64/vhe.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_api_smp.h \
+    $(wildcard include/config/inline/spin/lock.h) \
+    $(wildcard include/config/inline/spin/lock/bh.h) \
+    $(wildcard include/config/inline/spin/lock/irq.h) \
+    $(wildcard include/config/inline/spin/lock/irqsave.h) \
+    $(wildcard include/config/inline/spin/trylock.h) \
+    $(wildcard include/config/inline/spin/trylock/bh.h) \
+    $(wildcard include/config/uninline/spin/unlock.h) \
+    $(wildcard include/config/inline/spin/unlock/bh.h) \
+    $(wildcard include/config/inline/spin/unlock/irq.h) \
+    $(wildcard include/config/inline/spin/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_api_smp.h \
+    $(wildcard include/config/inline/read/lock.h) \
+    $(wildcard include/config/inline/write/lock.h) \
+    $(wildcard include/config/inline/read/lock/bh.h) \
+    $(wildcard include/config/inline/write/lock/bh.h) \
+    $(wildcard include/config/inline/read/lock/irq.h) \
+    $(wildcard include/config/inline/write/lock/irq.h) \
+    $(wildcard include/config/inline/read/lock/irqsave.h) \
+    $(wildcard include/config/inline/write/lock/irqsave.h) \
+    $(wildcard include/config/inline/read/trylock.h) \
+    $(wildcard include/config/inline/write/trylock.h) \
+    $(wildcard include/config/inline/read/unlock.h) \
+    $(wildcard include/config/inline/write/unlock.h) \
+    $(wildcard include/config/inline/read/unlock/bh.h) \
+    $(wildcard include/config/inline/write/unlock/bh.h) \
+    $(wildcard include/config/inline/read/unlock/irq.h) \
+    $(wildcard include/config/inline/write/unlock/irq.h) \
+    $(wildcard include/config/inline/read/unlock/irqrestore.h) \
+    $(wildcard include/config/inline/write/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/atomic.h \
+    $(wildcard include/config/generic/atomic64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic_ll_sc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cmpxchg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/atomic-long.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rbtree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcupdate.h \
+    $(wildcard include/config/tiny/rcu.h) \
+    $(wildcard include/config/tree/rcu.h) \
+    $(wildcard include/config/preempt/rcu.h) \
+    $(wildcard include/config/rcu/trace.h) \
+    $(wildcard include/config/rcu/stall/common.h) \
+    $(wildcard include/config/no/hz/full.h) \
+    $(wildcard include/config/rcu/nocb/cpu.h) \
+    $(wildcard include/config/tasks/rcu.h) \
+    $(wildcard include/config/debug/objects/rcu/head.h) \
+    $(wildcard include/config/hotplug/cpu.h) \
+    $(wildcard include/config/prove/rcu.h) \
+    $(wildcard include/config/rcu/boost.h) \
+    $(wildcard include/config/rcu/nocb/cpu/all.h) \
+    $(wildcard include/config/no/hz/full/sysidle.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cpumask.h \
+    $(wildcard include/config/debug/per/cpu/maps.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitmap.h \
+    $(wildcard include/config/s390.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seqlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/completion.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/debugobjects.h \
+    $(wildcard include/config/debug/objects.h) \
+    $(wildcard include/config/debug/objects/free.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ktime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time.h \
+    $(wildcard include/config/arch/uses/gettimeoffset.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/math64.h \
+    $(wildcard include/config/arch/supports/int128.h) \
+  arch/arm64/include/generated/asm/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/time.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jiffies.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/param.h \
+    $(wildcard include/config/hz.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/arch_timer.h \
+    $(wildcard include/config/fsl/erratum/a008585.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/clocksource/arm_arch_timer.h \
+    $(wildcard include/config/arm/arch/timer.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timecounter.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/timex.h \
+  include/generated/timeconst.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timekeeping.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcutree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwsem.h \
+    $(wildcard include/config/rwsem/spin/on/owner.h) \
+    $(wildcard include/config/rwsem/generic/spinlock.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/osq_lock.h \
+  arch/arm64/include/generated/asm/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uprobes.h \
+    $(wildcard include/config/uprobes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/page-flags-layout.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/numa.h \
+    $(wildcard include/config/nodes/shift.h) \
+  include/generated/bounds.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sparsemem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/workqueue.h \
+    $(wildcard include/config/debug/objects/work.h) \
+    $(wildcard include/config/freezer.h) \
+    $(wildcard include/config/sysfs.h) \
+    $(wildcard include/config/wq/watchdog.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timer.h \
+    $(wildcard include/config/timer/stats.h) \
+    $(wildcard include/config/debug/objects/timers.h) \
+    $(wildcard include/config/no/hz/common.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysctl.h \
+    $(wildcard include/config/sysctl.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uidgid.h \
+    $(wildcard include/config/multiuser.h) \
+    $(wildcard include/config/user/ns.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/highuid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/mmu.h \
+    $(wildcard include/config/harden/branch/predictor.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu.h \
+    $(wildcard include/config/need/per/cpu/embed/first/chunk.h) \
+    $(wildcard include/config/need/per/cpu/page/first/chunk.h) \
+    $(wildcard include/config/have/setup/per/cpu/area.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/smp.h \
+    $(wildcard include/config/amlogic/modify.h) \
+    $(wildcard include/config/up/late/init.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/llist.h \
+    $(wildcard include/config/arch/have/nmi/safe/cmpxchg.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/smp.h \
+    $(wildcard include/config/arm64/acpi/parking/protocol.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-defs.h \
+    $(wildcard include/config/page/table/isolation.h) \
+    $(wildcard include/config/debug/force/weak/per/cpu.h) \
+  arch/arm64/include/generated/asm/early_ioremap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/early_ioremap.h \
+    $(wildcard include/config/generic/early/ioremap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/xen/xen.h \
+    $(wildcard include/config/xen.h) \
+    $(wildcard include/config/xen/dom0.h) \
+    $(wildcard include/config/xen/pvh.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/io.h \
+    $(wildcard include/config/generic/iomap.h) \
+    $(wildcard include/config/virt/to/bus.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/pci_iomap.h \
+    $(wildcard include/config/pci.h) \
+    $(wildcard include/config/no/generic/pci/ioport/map.h) \
+    $(wildcard include/config/generic/pci/iomap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/vmalloc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/module.h \
+    $(wildcard include/config/modules/tree/lookup.h) \
+    $(wildcard include/config/livepatch.h) \
+    $(wildcard include/config/cfi/clang.h) \
+    $(wildcard include/config/module/sig.h) \
+    $(wildcard include/config/kallsyms.h) \
+    $(wildcard include/config/tracepoints.h) \
+    $(wildcard include/config/event/tracing.h) \
+    $(wildcard include/config/module/unload.h) \
+    $(wildcard include/config/constructors.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/compat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched.h \
+    $(wildcard include/config/cpu/quiet.h) \
+    $(wildcard include/config/sched/debug.h) \
+    $(wildcard include/config/lockup/detector.h) \
+    $(wildcard include/config/detect/hung/task.h) \
+    $(wildcard include/config/core/dump/default/elf/headers.h) \
+    $(wildcard include/config/virt/cpu/accounting/native.h) \
+    $(wildcard include/config/sched/autogroup.h) \
+    $(wildcard include/config/bsd/process/acct.h) \
+    $(wildcard include/config/taskstats.h) \
+    $(wildcard include/config/audit.h) \
+    $(wildcard include/config/inotify/user.h) \
+    $(wildcard include/config/fanotify.h) \
+    $(wildcard include/config/epoll.h) \
+    $(wildcard include/config/posix/mqueue.h) \
+    $(wildcard include/config/keys.h) \
+    $(wildcard include/config/perf/events.h) \
+    $(wildcard include/config/bpf/syscall.h) \
+    $(wildcard include/config/sched/info.h) \
+    $(wildcard include/config/task/delay/acct.h) \
+    $(wildcard include/config/schedstats.h) \
+    $(wildcard include/config/sched/smt.h) \
+    $(wildcard include/config/sched/mc.h) \
+    $(wildcard include/config/sched/walt.h) \
+    $(wildcard include/config/fair/group/sched.h) \
+    $(wildcard include/config/rt/group/sched.h) \
+    $(wildcard include/config/cgroup/sched.h) \
+    $(wildcard include/config/blk/dev/io/trace.h) \
+    $(wildcard include/config/slob.h) \
+    $(wildcard include/config/compat/brk.h) \
+    $(wildcard include/config/cgroups.h) \
+    $(wildcard include/config/cc/stackprotector.h) \
+    $(wildcard include/config/cpu/freq/times.h) \
+    $(wildcard include/config/virt/cpu/accounting/gen.h) \
+    $(wildcard include/config/sysvipc.h) \
+    $(wildcard include/config/auditsyscall.h) \
+    $(wildcard include/config/rt/mutexes.h) \
+    $(wildcard include/config/debug/mutexes.h) \
+    $(wildcard include/config/ubsan.h) \
+    $(wildcard include/config/task/xacct.h) \
+    $(wildcard include/config/cpusets.h) \
+    $(wildcard include/config/futex.h) \
+    $(wildcard include/config/fault/injection.h) \
+    $(wildcard include/config/latencytop.h) \
+    $(wildcard include/config/function/graph/tracer.h) \
+    $(wildcard include/config/kcov.h) \
+    $(wildcard include/config/bcache.h) \
+    $(wildcard include/config/vmap/stack.h) \
+    $(wildcard include/config/arch/wants/dynamic/task/struct.h) \
+    $(wildcard include/config/have/unstable/sched/clock.h) \
+    $(wildcard include/config/irq/time/accounting.h) \
+    $(wildcard include/config/proc/fs.h) \
+    $(wildcard include/config/stack/growsup.h) \
+    $(wildcard include/config/have/copy/thread/tls.h) \
+    $(wildcard include/config/have/exit/thread.h) \
+    $(wildcard include/config/cpu/freq.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched/prio.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/capability.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/capability.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/plist.h \
+    $(wildcard include/config/debug/pi/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/nodemask.h \
+    $(wildcard include/config/highmem.h) \
+    $(wildcard include/config/movable/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cputime.h \
+  arch/arm64/include/generated/asm/cputime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime.h \
+    $(wildcard include/config/virt/cpu/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime_jiffies.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ipc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/ipc.h \
+  arch/arm64/include/generated/asm/ipcbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/ipcbuf.h \
+  arch/arm64/include/generated/asm/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/shm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/shm.h \
+  arch/arm64/include/generated/asm/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/signal.h \
+    $(wildcard include/config/old/sigaction.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal-defs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/sigcontext.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/topology.h \
+    $(wildcard include/config/use/percpu/numa/node/id.h) \
+    $(wildcard include/config/have/memoryless/nodes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmzone.h \
+    $(wildcard include/config/force/max/zoneorder.h) \
+    $(wildcard include/config/cma.h) \
+    $(wildcard include/config/memory/isolation.h) \
+    $(wildcard include/config/zsmalloc.h) \
+    $(wildcard include/config/amlogic/cma.h) \
+    $(wildcard include/config/zone/dma.h) \
+    $(wildcard include/config/zone/dma32.h) \
+    $(wildcard include/config/zone/device.h) \
+    $(wildcard include/config/memory/hotplug.h) \
+    $(wildcard include/config/flat/node/mem/map.h) \
+    $(wildcard include/config/page/extension.h) \
+    $(wildcard include/config/no/bootmem.h) \
+    $(wildcard include/config/deferred/struct/page/init.h) \
+    $(wildcard include/config/have/memory/present.h) \
+    $(wildcard include/config/need/node/memmap/size.h) \
+    $(wildcard include/config/have/memblock/node/map.h) \
+    $(wildcard include/config/need/multiple/nodes.h) \
+    $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
+    $(wildcard include/config/sparsemem/extreme.h) \
+    $(wildcard include/config/holes/in/zone.h) \
+    $(wildcard include/config/arch/has/holes/memorymodel.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pageblock-flags.h \
+    $(wildcard include/config/hugetlb/page/size/variable.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/memory_hotplug.h \
+    $(wildcard include/config/memory/hotremove.h) \
+    $(wildcard include/config/have/arch/nodedata/extension.h) \
+    $(wildcard include/config/have/bootmem/info/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/notifier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mutex.h \
+    $(wildcard include/config/mutex/spin/on/owner.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/srcu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seccomp.h \
+    $(wildcard include/config/seccomp.h) \
+    $(wildcard include/config/have/arch/seccomp/filter.h) \
+    $(wildcard include/config/seccomp/filter.h) \
+    $(wildcard include/config/checkpoint/restore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rculist.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rtmutex.h \
+    $(wildcard include/config/debug/rt/mutexes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/resource.h \
+  arch/arm64/include/generated/asm/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/hrtimer.h \
+    $(wildcard include/config/high/res/timers.h) \
+    $(wildcard include/config/time/low/res.h) \
+    $(wildcard include/config/timerfd.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timerqueue.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/task_io_accounting.h \
+    $(wildcard include/config/task/io/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/latencytop.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cred.h \
+    $(wildcard include/config/debug/credentials.h) \
+    $(wildcard include/config/security.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/key.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/assoc_array.h \
+    $(wildcard include/config/associative/array.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/selinux.h \
+    $(wildcard include/config/security/selinux.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/gfp.h \
+    $(wildcard include/config/pm/sleep.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/magic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup-defs.h \
+    $(wildcard include/config/sock/cgroup/data.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/limits.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/idr.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-refcount.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcu_sync.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bpf-cgroup.h \
+    $(wildcard include/config/cgroup/bpf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf_common.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup_subsys.h \
+    $(wildcard include/config/cgroup/cpuacct.h) \
+    $(wildcard include/config/cgroup/schedtune.h) \
+    $(wildcard include/config/cgroup/device.h) \
+    $(wildcard include/config/cgroup/freezer.h) \
+    $(wildcard include/config/cgroup/net/classid.h) \
+    $(wildcard include/config/cgroup/perf.h) \
+    $(wildcard include/config/cgroup/net/prio.h) \
+    $(wildcard include/config/cgroup/hugetlb.h) \
+    $(wildcard include/config/cgroup/pids.h) \
+    $(wildcard include/config/cgroup/debug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kmod.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/elf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/elf.h \
+  arch/arm64/include/generated/asm/user.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/user.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/elf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/elf-em.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject.h \
+    $(wildcard include/config/uevent/helper.h) \
+    $(wildcard include/config/debug/kobject/release.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysfs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernfs.h \
+    $(wildcard include/config/kernfs.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject_ns.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kref.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/moduleparam.h \
+    $(wildcard include/config/alpha.h) \
+    $(wildcard include/config/ia64.h) \
+    $(wildcard include/config/ppc64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/extable.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rbtree_latch.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cfi.h \
+    $(wildcard include/config/cfi/clang/shadow.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/module.h \
+    $(wildcard include/config/arm64/module/plts.h) \
+    $(wildcard include/config/randomize/base.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/module.h \
+    $(wildcard include/config/have/mod/arch/specific.h) \
+    $(wildcard include/config/modules/use/elf/rel.h) \
+    $(wildcard include/config/modules/use/elf/rela.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/of.h \
+    $(wildcard include/config/sparc.h) \
+    $(wildcard include/config/of/dynamic.h) \
+    $(wildcard include/config/of.h) \
+    $(wildcard include/config/attach/node.h) \
+    $(wildcard include/config/detach/node.h) \
+    $(wildcard include/config/add/property.h) \
+    $(wildcard include/config/remove/property.h) \
+    $(wildcard include/config/update/property.h) \
+    $(wildcard include/config/of/numa.h) \
+    $(wildcard include/config/no/change.h) \
+    $(wildcard include/config/change/add.h) \
+    $(wildcard include/config/change/remove.h) \
+    $(wildcard include/config/of/resolve.h) \
+    $(wildcard include/config/of/overlay.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mod_devicetable.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uuid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/uuid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/property.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/fwnode.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/of_platform.h \
+    $(wildcard include/config/of/address.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/device.h \
+    $(wildcard include/config/debug/devres.h) \
+    $(wildcard include/config/generic/msi/irq/domain.h) \
+    $(wildcard include/config/pinctrl.h) \
+    $(wildcard include/config/generic/msi/irq.h) \
+    $(wildcard include/config/dma/cma.h) \
+    $(wildcard include/config/devtmpfs.h) \
+    $(wildcard include/config/sysfs/deprecated.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ioport.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/klist.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/devinfo.h \
+    $(wildcard include/config/pm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/consumer.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seq_file.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/fs.h \
+    $(wildcard include/config/fs/posix/acl.h) \
+    $(wildcard include/config/cgroup/writeback.h) \
+    $(wildcard include/config/ima.h) \
+    $(wildcard include/config/fsnotify.h) \
+    $(wildcard include/config/fs/encryption.h) \
+    $(wildcard include/config/file/locking.h) \
+    $(wildcard include/config/quota.h) \
+    $(wildcard include/config/fs/dax.h) \
+    $(wildcard include/config/mandatory/file/locking.h) \
+    $(wildcard include/config/migration.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kdev_t.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kdev_t.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dcache.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rculist_bl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list_bl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bit_spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/lockref.h \
+    $(wildcard include/config/arch/use/cmpxchg/lockref.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringhash.h \
+    $(wildcard include/config/dcache/word/access.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/hash.h \
+    $(wildcard include/config/have/arch/hash.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/path.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list_lru.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/shrinker.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/radix-tree.h \
+    $(wildcard include/config/radix/tree/multiorder.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/semaphore.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fiemap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/migrate_mode.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/delayed_call.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/ioctl.h \
+  arch/arm64/include/generated/asm/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/quota.h \
+    $(wildcard include/config/quota/netlink/interface.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu_counter.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/dqblk_xfs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_v1.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_v2.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_qtree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/projid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/quota.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/nfs_fs_i.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/pinctrl-state.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pm.h \
+    $(wildcard include/config/vt/console/sleep.h) \
+    $(wildcard include/config/amlogic/usb.h) \
+    $(wildcard include/config/pm/clk.h) \
+    $(wildcard include/config/pm/generic/domains.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ratelimit.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/device.h \
+    $(wildcard include/config/iommu/api.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pm_wakeup.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/of_device.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cpu.h \
+    $(wildcard include/config/pm/sleep/smp.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/node.h \
+    $(wildcard include/config/memory/hotplug/sparse.h) \
+    $(wildcard include/config/hugetlbfs.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cpuhotplug.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/platform_device.h \
+    $(wildcard include/config/suspend.h) \
+    $(wildcard include/config/hibernate/callbacks.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/slab.h \
+    $(wildcard include/config/debug/slab.h) \
+    $(wildcard include/config/failslab.h) \
+    $(wildcard include/config/have/hardened/usercopy/allocator.h) \
+    $(wildcard include/config/slab.h) \
+    $(wildcard include/config/slub.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kmemleak.h \
+    $(wildcard include/config/debug/kmemleak.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kasan.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux/tee_drv.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux/tee.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uaccess.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/uaccess.h \
+    $(wildcard include/config/arm64/pan.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/kernel-pgtable.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kasan-checks.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/compiler.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/../include/linux/arm-smccc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_private.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_msg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_smc.h \
+
+/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/core.o: $(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/core.o)
+
+$(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/core.o):
diff --git a/optee/.optee_armtz.ko.cmd b/optee/.optee_armtz.ko.cmd
new file mode 100644 (file)
index 0000000..249aad2
--- /dev/null
@@ -0,0 +1 @@
+cmd_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.ko := aarch64-linux-gnu-ld -EL -r  -T /mnt/fileroot/lei.qian/p-amlogic/common/scripts/module-common.lds -T /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/kernel/module.lds --build-id  -o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.ko /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.o ;  true
diff --git a/optee/.optee_armtz.mod.o.cmd b/optee/.optee_armtz.mod.o.cmd
new file mode 100644 (file)
index 0000000..7c6945c
--- /dev/null
@@ -0,0 +1,648 @@
+cmd_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.o := aarch64-linux-gnu-gcc -Wp,-MD,/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.optee_armtz.mod.o.d  -nostdinc -isystem /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include -I./arch/arm64/include/generated/uapi -I./arch/arm64/include/generated  -I/mnt/fileroot/lei.qian/p-amlogic/common/include -I./include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi -I/mnt/fileroot/lei.qian/p-amlogic/common/include/uapi -I./include/generated/uapi -include /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kconfig.h -I/mnt/fileroot/lei.qian/p-amlogic/common//mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/ -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/ -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -Werror -std=gnu89 -fno-PIE -fno-PIE -mgeneral-regs-only -fno-asynchronous-unwind-tables -fno-pic -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include  -DKBUILD_BASENAME='"optee_armtz.mod"'  -DKBUILD_MODNAME='"optee_armtz"' -DMODULE -mcmodel=large  -c -o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.c
+
+source_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.o := /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.c
+
+deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.o := \
+    $(wildcard include/config/module/unload.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/module.h \
+    $(wildcard include/config/modules.h) \
+    $(wildcard include/config/sysfs.h) \
+    $(wildcard include/config/modules/tree/lookup.h) \
+    $(wildcard include/config/livepatch.h) \
+    $(wildcard include/config/cfi/clang.h) \
+    $(wildcard include/config/unused/symbols.h) \
+    $(wildcard include/config/module/sig.h) \
+    $(wildcard include/config/generic/bug.h) \
+    $(wildcard include/config/kallsyms.h) \
+    $(wildcard include/config/smp.h) \
+    $(wildcard include/config/tracepoints.h) \
+    $(wildcard include/config/tracing.h) \
+    $(wildcard include/config/event/tracing.h) \
+    $(wildcard include/config/ftrace/mcount/record.h) \
+    $(wildcard include/config/constructors.h) \
+    $(wildcard include/config/debug/set/module/ronx.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list.h \
+    $(wildcard include/config/debug/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/types.h \
+    $(wildcard include/config/have/uid16.h) \
+    $(wildcard include/config/uid16.h) \
+    $(wildcard include/config/lbdaf.h) \
+    $(wildcard include/config/arch/dma/addr/t/64bit.h) \
+    $(wildcard include/config/phys/addr/t/64bit.h) \
+    $(wildcard include/config/64bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/types.h \
+  arch/arm64/include/generated/asm/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler.h \
+    $(wildcard include/config/sparse/rcu/pointer.h) \
+    $(wildcard include/config/trace/branch/profiling.h) \
+    $(wildcard include/config/profile/all/branches.h) \
+    $(wildcard include/config/kasan.h) \
+    $(wildcard include/config/enable/must/check.h) \
+    $(wildcard include/config/enable/warn/deprecated.h) \
+    $(wildcard include/config/kprobes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler-gcc.h \
+    $(wildcard include/config/arch/supports/optimized/inlining.h) \
+    $(wildcard include/config/optimize/inlining.h) \
+    $(wildcard include/config/gcov/kernel.h) \
+    $(wildcard include/config/stack/validation.h) \
+    $(wildcard include/config/arch/use/builtin/bswap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/poison.h \
+    $(wildcard include/config/illegal/pointer/value.h) \
+    $(wildcard include/config/page/poisoning/zero.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/const.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernel.h \
+    $(wildcard include/config/preempt/voluntary.h) \
+    $(wildcard include/config/debug/atomic/sleep.h) \
+    $(wildcard include/config/mmu.h) \
+    $(wildcard include/config/prove/locking.h) \
+    $(wildcard include/config/panic/timeout.h) \
+  /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/lib/gcc/aarch64-linux-gnu/4.9.2/include/stdarg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringify.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/export.h \
+    $(wildcard include/config/have/underscore/symbol/prefix.h) \
+    $(wildcard include/config/modversions.h) \
+    $(wildcard include/config/trim/unused/ksyms.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/barrier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/barrier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/ffz.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/fls64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/find.h \
+    $(wildcard include/config/generic/find/first/bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/arch_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/const_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/lock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/non-atomic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/le.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/byteorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/swab.h \
+  arch/arm64/include/generated/asm/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/generic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/log2.h \
+    $(wildcard include/config/arch/has/ilog2/u32.h) \
+    $(wildcard include/config/arch/has/ilog2/u64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/typecheck.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/printk.h \
+    $(wildcard include/config/message/loglevel/default.h) \
+    $(wildcard include/config/early/printk.h) \
+    $(wildcard include/config/printk/nmi.h) \
+    $(wildcard include/config/printk.h) \
+    $(wildcard include/config/dynamic/debug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/init.h \
+    $(wildcard include/config/debug/rodata.h) \
+    $(wildcard include/config/lto/clang.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kern_levels.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cache.h \
+    $(wildcard include/config/arch/has/cache/line/size.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kernel.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysinfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cache.h \
+    $(wildcard include/config/amlogic/memory/extend.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cachetype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cputype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sysreg.h \
+    $(wildcard include/config/arm64/4k/pages.h) \
+    $(wildcard include/config/arm64/16k/pages.h) \
+    $(wildcard include/config/arm64/64k/pages.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/big/endian.h) \
+    $(wildcard include/config/cpu/endian/be8.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/../../arm/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/endian/be32.h) \
+    $(wildcard include/config/thumb2/kernel.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stat.h \
+    $(wildcard include/config/compat.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/compat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched.h \
+    $(wildcard include/config/cpu/quiet.h) \
+    $(wildcard include/config/no/hz/common.h) \
+    $(wildcard include/config/sched/debug.h) \
+    $(wildcard include/config/prove/rcu.h) \
+    $(wildcard include/config/hotplug/cpu.h) \
+    $(wildcard include/config/lockup/detector.h) \
+    $(wildcard include/config/detect/hung/task.h) \
+    $(wildcard include/config/core/dump/default/elf/headers.h) \
+    $(wildcard include/config/virt/cpu/accounting/native.h) \
+    $(wildcard include/config/no/hz/full.h) \
+    $(wildcard include/config/sched/autogroup.h) \
+    $(wildcard include/config/bsd/process/acct.h) \
+    $(wildcard include/config/taskstats.h) \
+    $(wildcard include/config/audit.h) \
+    $(wildcard include/config/inotify/user.h) \
+    $(wildcard include/config/fanotify.h) \
+    $(wildcard include/config/epoll.h) \
+    $(wildcard include/config/posix/mqueue.h) \
+    $(wildcard include/config/keys.h) \
+    $(wildcard include/config/perf/events.h) \
+    $(wildcard include/config/bpf/syscall.h) \
+    $(wildcard include/config/sched/info.h) \
+    $(wildcard include/config/task/delay/acct.h) \
+    $(wildcard include/config/schedstats.h) \
+    $(wildcard include/config/sched/smt.h) \
+    $(wildcard include/config/sched/mc.h) \
+    $(wildcard include/config/numa.h) \
+    $(wildcard include/config/sched/walt.h) \
+    $(wildcard include/config/fair/group/sched.h) \
+    $(wildcard include/config/rt/group/sched.h) \
+    $(wildcard include/config/thread/info/in/task.h) \
+    $(wildcard include/config/cgroup/sched.h) \
+    $(wildcard include/config/preempt/notifiers.h) \
+    $(wildcard include/config/blk/dev/io/trace.h) \
+    $(wildcard include/config/preempt/rcu.h) \
+    $(wildcard include/config/tasks/rcu.h) \
+    $(wildcard include/config/memcg.h) \
+    $(wildcard include/config/slob.h) \
+    $(wildcard include/config/compat/brk.h) \
+    $(wildcard include/config/cgroups.h) \
+    $(wildcard include/config/cc/stackprotector.h) \
+    $(wildcard include/config/cpu/freq/times.h) \
+    $(wildcard include/config/virt/cpu/accounting/gen.h) \
+    $(wildcard include/config/sysvipc.h) \
+    $(wildcard include/config/auditsyscall.h) \
+    $(wildcard include/config/rt/mutexes.h) \
+    $(wildcard include/config/debug/mutexes.h) \
+    $(wildcard include/config/trace/irqflags.h) \
+    $(wildcard include/config/lockdep.h) \
+    $(wildcard include/config/ubsan.h) \
+    $(wildcard include/config/block.h) \
+    $(wildcard include/config/task/xacct.h) \
+    $(wildcard include/config/cpusets.h) \
+    $(wildcard include/config/futex.h) \
+    $(wildcard include/config/debug/preempt.h) \
+    $(wildcard include/config/numa/balancing.h) \
+    $(wildcard include/config/arch/want/batched/unmap/tlb/flush.h) \
+    $(wildcard include/config/fault/injection.h) \
+    $(wildcard include/config/latencytop.h) \
+    $(wildcard include/config/function/graph/tracer.h) \
+    $(wildcard include/config/kcov.h) \
+    $(wildcard include/config/uprobes.h) \
+    $(wildcard include/config/bcache.h) \
+    $(wildcard include/config/vmap/stack.h) \
+    $(wildcard include/config/arch/wants/dynamic/task/struct.h) \
+    $(wildcard include/config/have/unstable/sched/clock.h) \
+    $(wildcard include/config/irq/time/accounting.h) \
+    $(wildcard include/config/proc/fs.h) \
+    $(wildcard include/config/stack/growsup.h) \
+    $(wildcard include/config/have/copy/thread/tls.h) \
+    $(wildcard include/config/have/exit/thread.h) \
+    $(wildcard include/config/debug/stack/usage.h) \
+    $(wildcard include/config/preempt.h) \
+    $(wildcard include/config/cpu/freq.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched/prio.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/param.h \
+    $(wildcard include/config/hz.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/capability.h \
+    $(wildcard include/config/multiuser.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/capability.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/threads.h \
+    $(wildcard include/config/nr/cpus.h) \
+    $(wildcard include/config/base/small.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time.h \
+    $(wildcard include/config/arch/uses/gettimeoffset.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seqlock.h \
+    $(wildcard include/config/debug/lock/alloc.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock.h \
+    $(wildcard include/config/debug/spinlock.h) \
+    $(wildcard include/config/generic/lockbreak.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/preempt.h \
+    $(wildcard include/config/preempt/count.h) \
+    $(wildcard include/config/preempt/tracer.h) \
+  arch/arm64/include/generated/asm/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/thread_info.h \
+    $(wildcard include/config/have/arch/within/stack/frames.h) \
+    $(wildcard include/config/hardened/usercopy.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bug.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bug.h \
+    $(wildcard include/config/debug/bugverbose.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/brk-imm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bug.h \
+    $(wildcard include/config/bug.h) \
+    $(wildcard include/config/generic/bug/relative/pointers.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/restart_block.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/current.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/thread_info.h \
+    $(wildcard include/config/arm64/sw/ttbr0/pan.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stack_pointer.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/irqflags.h \
+    $(wildcard include/config/irqsoff/tracer.h) \
+    $(wildcard include/config/trace/irqflags/support.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/irqflags.h \
+    $(wildcard include/config/amlogic/debug/lockup.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/../drivers/amlogic/debug/irqflags_debug.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/amlogic/debug_lockup.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bottom_half.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/lockdep.h \
+    $(wildcard include/config/lock/stat.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/lse.h \
+    $(wildcard include/config/as/lse.h) \
+    $(wildcard include/config/arm64/lse/atomics.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/processor.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/string.h \
+    $(wildcard include/config/binary/printf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/alternative.h \
+    $(wildcard include/config/arm64/uao.h) \
+    $(wildcard include/config/foo.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpucaps.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/insn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/fpsimd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hw_breakpoint.h \
+    $(wildcard include/config/have/hw/breakpoint.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpufeature.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jump_label.h \
+    $(wildcard include/config/jump/label.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/jump_label.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/virt.h \
+    $(wildcard include/config/arm64/vhe.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-hwdef.h \
+    $(wildcard include/config/pgtable/levels.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_api_smp.h \
+    $(wildcard include/config/inline/spin/lock.h) \
+    $(wildcard include/config/inline/spin/lock/bh.h) \
+    $(wildcard include/config/inline/spin/lock/irq.h) \
+    $(wildcard include/config/inline/spin/lock/irqsave.h) \
+    $(wildcard include/config/inline/spin/trylock.h) \
+    $(wildcard include/config/inline/spin/trylock/bh.h) \
+    $(wildcard include/config/uninline/spin/unlock.h) \
+    $(wildcard include/config/inline/spin/unlock/bh.h) \
+    $(wildcard include/config/inline/spin/unlock/irq.h) \
+    $(wildcard include/config/inline/spin/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_api_smp.h \
+    $(wildcard include/config/inline/read/lock.h) \
+    $(wildcard include/config/inline/write/lock.h) \
+    $(wildcard include/config/inline/read/lock/bh.h) \
+    $(wildcard include/config/inline/write/lock/bh.h) \
+    $(wildcard include/config/inline/read/lock/irq.h) \
+    $(wildcard include/config/inline/write/lock/irq.h) \
+    $(wildcard include/config/inline/read/lock/irqsave.h) \
+    $(wildcard include/config/inline/write/lock/irqsave.h) \
+    $(wildcard include/config/inline/read/trylock.h) \
+    $(wildcard include/config/inline/write/trylock.h) \
+    $(wildcard include/config/inline/read/unlock.h) \
+    $(wildcard include/config/inline/write/unlock.h) \
+    $(wildcard include/config/inline/read/unlock/bh.h) \
+    $(wildcard include/config/inline/write/unlock/bh.h) \
+    $(wildcard include/config/inline/read/unlock/irq.h) \
+    $(wildcard include/config/inline/write/unlock/irq.h) \
+    $(wildcard include/config/inline/read/unlock/irqrestore.h) \
+    $(wildcard include/config/inline/write/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/atomic.h \
+    $(wildcard include/config/generic/atomic64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic_ll_sc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cmpxchg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/atomic-long.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/math64.h \
+    $(wildcard include/config/arch/supports/int128.h) \
+  arch/arm64/include/generated/asm/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/time.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/arch_timer.h \
+    $(wildcard include/config/fsl/erratum/a008585.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/clocksource/arm_arch_timer.h \
+    $(wildcard include/config/arm/arch/timer.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timecounter.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jiffies.h \
+  include/generated/timeconst.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/plist.h \
+    $(wildcard include/config/debug/pi/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rbtree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcupdate.h \
+    $(wildcard include/config/tiny/rcu.h) \
+    $(wildcard include/config/tree/rcu.h) \
+    $(wildcard include/config/rcu/trace.h) \
+    $(wildcard include/config/rcu/stall/common.h) \
+    $(wildcard include/config/rcu/nocb/cpu.h) \
+    $(wildcard include/config/debug/objects/rcu/head.h) \
+    $(wildcard include/config/rcu/boost.h) \
+    $(wildcard include/config/rcu/nocb/cpu/all.h) \
+    $(wildcard include/config/no/hz/full/sysidle.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cpumask.h \
+    $(wildcard include/config/cpumask/offstack.h) \
+    $(wildcard include/config/debug/per/cpu/maps.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitmap.h \
+    $(wildcard include/config/s390.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/completion.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/debugobjects.h \
+    $(wildcard include/config/debug/objects.h) \
+    $(wildcard include/config/debug/objects/free.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ktime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timekeeping.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/errno.h \
+  arch/arm64/include/generated/asm/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno-base.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcutree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/nodemask.h \
+    $(wildcard include/config/highmem.h) \
+    $(wildcard include/config/movable/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/numa.h \
+    $(wildcard include/config/nodes/shift.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mm_types.h \
+    $(wildcard include/config/split/ptlock/cpus.h) \
+    $(wildcard include/config/arch/enable/split/pmd/ptlock.h) \
+    $(wildcard include/config/amlogic/page/trace.h) \
+    $(wildcard include/config/have/cmpxchg/double.h) \
+    $(wildcard include/config/have/aligned/struct/page.h) \
+    $(wildcard include/config/transparent/hugepage.h) \
+    $(wildcard include/config/kmemcheck.h) \
+    $(wildcard include/config/userfaultfd.h) \
+    $(wildcard include/config/aio.h) \
+    $(wildcard include/config/mmu/notifier.h) \
+    $(wildcard include/config/compaction.h) \
+    $(wildcard include/config/x86/intel/mpx.h) \
+    $(wildcard include/config/hugetlb/page.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwsem.h \
+    $(wildcard include/config/rwsem/spin/on/owner.h) \
+    $(wildcard include/config/rwsem/generic/spinlock.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/err.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/osq_lock.h \
+  arch/arm64/include/generated/asm/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uprobes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/page-flags-layout.h \
+    $(wildcard include/config/sparsemem.h) \
+    $(wildcard include/config/sparsemem/vmemmap.h) \
+  include/generated/bounds.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sparsemem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/workqueue.h \
+    $(wildcard include/config/debug/objects/work.h) \
+    $(wildcard include/config/freezer.h) \
+    $(wildcard include/config/wq/watchdog.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timer.h \
+    $(wildcard include/config/timer/stats.h) \
+    $(wildcard include/config/debug/objects/timers.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysctl.h \
+    $(wildcard include/config/sysctl.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uidgid.h \
+    $(wildcard include/config/user/ns.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/highuid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/page.h \
+    $(wildcard include/config/arm64/page/shift.h) \
+    $(wildcard include/config/arm64/cont/shift.h) \
+    $(wildcard include/config/have/arch/pfn/valid.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/pgtable-nopud.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/memory.h \
+    $(wildcard include/config/arm64/va/bits.h) \
+    $(wildcard include/config/blk/dev/initrd.h) \
+  arch/arm64/include/generated/asm/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmdebug.h \
+    $(wildcard include/config/debug/vm.h) \
+    $(wildcard include/config/debug/virtual.h) \
+    $(wildcard include/config/debug/vm/pgflags.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/memory_model.h \
+    $(wildcard include/config/flatmem.h) \
+    $(wildcard include/config/discontigmem.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pfn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/getorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/mmu.h \
+    $(wildcard include/config/unmap/kernel/at/el0.h) \
+    $(wildcard include/config/harden/branch/predictor.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu.h \
+    $(wildcard include/config/need/per/cpu/embed/first/chunk.h) \
+    $(wildcard include/config/need/per/cpu/page/first/chunk.h) \
+    $(wildcard include/config/have/setup/per/cpu/area.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/smp.h \
+    $(wildcard include/config/amlogic/modify.h) \
+    $(wildcard include/config/up/late/init.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/llist.h \
+    $(wildcard include/config/arch/have/nmi/safe/cmpxchg.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/smp.h \
+    $(wildcard include/config/arm64/acpi/parking/protocol.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-defs.h \
+    $(wildcard include/config/page/table/isolation.h) \
+    $(wildcard include/config/debug/force/weak/per/cpu.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cputime.h \
+  arch/arm64/include/generated/asm/cputime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime.h \
+    $(wildcard include/config/virt/cpu/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime_jiffies.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ipc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/ipc.h \
+  arch/arm64/include/generated/asm/ipcbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/ipcbuf.h \
+  arch/arm64/include/generated/asm/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/shm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/shm.h \
+  arch/arm64/include/generated/asm/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/signal.h \
+    $(wildcard include/config/old/sigaction.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal-defs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/sigcontext.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/topology.h \
+    $(wildcard include/config/use/percpu/numa/node/id.h) \
+    $(wildcard include/config/have/memoryless/nodes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmzone.h \
+    $(wildcard include/config/force/max/zoneorder.h) \
+    $(wildcard include/config/cma.h) \
+    $(wildcard include/config/memory/isolation.h) \
+    $(wildcard include/config/zsmalloc.h) \
+    $(wildcard include/config/amlogic/cma.h) \
+    $(wildcard include/config/zone/dma.h) \
+    $(wildcard include/config/zone/dma32.h) \
+    $(wildcard include/config/zone/device.h) \
+    $(wildcard include/config/memory/hotplug.h) \
+    $(wildcard include/config/flat/node/mem/map.h) \
+    $(wildcard include/config/page/extension.h) \
+    $(wildcard include/config/no/bootmem.h) \
+    $(wildcard include/config/deferred/struct/page/init.h) \
+    $(wildcard include/config/have/memory/present.h) \
+    $(wildcard include/config/need/node/memmap/size.h) \
+    $(wildcard include/config/have/memblock/node/map.h) \
+    $(wildcard include/config/need/multiple/nodes.h) \
+    $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
+    $(wildcard include/config/sparsemem/extreme.h) \
+    $(wildcard include/config/holes/in/zone.h) \
+    $(wildcard include/config/arch/has/holes/memorymodel.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pageblock-flags.h \
+    $(wildcard include/config/hugetlb/page/size/variable.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/memory_hotplug.h \
+    $(wildcard include/config/memory/hotremove.h) \
+    $(wildcard include/config/have/arch/nodedata/extension.h) \
+    $(wildcard include/config/have/bootmem/info/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/notifier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mutex.h \
+    $(wildcard include/config/mutex/spin/on/owner.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/srcu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seccomp.h \
+    $(wildcard include/config/seccomp.h) \
+    $(wildcard include/config/have/arch/seccomp/filter.h) \
+    $(wildcard include/config/seccomp/filter.h) \
+    $(wildcard include/config/checkpoint/restore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rculist.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rtmutex.h \
+    $(wildcard include/config/debug/rt/mutexes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/resource.h \
+  arch/arm64/include/generated/asm/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/hrtimer.h \
+    $(wildcard include/config/high/res/timers.h) \
+    $(wildcard include/config/time/low/res.h) \
+    $(wildcard include/config/timerfd.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timerqueue.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/task_io_accounting.h \
+    $(wildcard include/config/task/io/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/latencytop.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cred.h \
+    $(wildcard include/config/debug/credentials.h) \
+    $(wildcard include/config/security.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/key.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/assoc_array.h \
+    $(wildcard include/config/associative/array.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/selinux.h \
+    $(wildcard include/config/security/selinux.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/gfp.h \
+    $(wildcard include/config/pm/sleep.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/magic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup-defs.h \
+    $(wildcard include/config/sock/cgroup/data.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/limits.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/idr.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-refcount.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcu_sync.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bpf-cgroup.h \
+    $(wildcard include/config/cgroup/bpf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf_common.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup_subsys.h \
+    $(wildcard include/config/cgroup/cpuacct.h) \
+    $(wildcard include/config/cgroup/schedtune.h) \
+    $(wildcard include/config/blk/cgroup.h) \
+    $(wildcard include/config/cgroup/device.h) \
+    $(wildcard include/config/cgroup/freezer.h) \
+    $(wildcard include/config/cgroup/net/classid.h) \
+    $(wildcard include/config/cgroup/perf.h) \
+    $(wildcard include/config/cgroup/net/prio.h) \
+    $(wildcard include/config/cgroup/hugetlb.h) \
+    $(wildcard include/config/cgroup/pids.h) \
+    $(wildcard include/config/cgroup/debug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kmod.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/elf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/elf.h \
+  arch/arm64/include/generated/asm/user.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/user.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/elf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/elf-em.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject.h \
+    $(wildcard include/config/uevent/helper.h) \
+    $(wildcard include/config/debug/kobject/release.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysfs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernfs.h \
+    $(wildcard include/config/kernfs.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject_ns.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kref.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/moduleparam.h \
+    $(wildcard include/config/alpha.h) \
+    $(wildcard include/config/ia64.h) \
+    $(wildcard include/config/ppc64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/extable.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rbtree_latch.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cfi.h \
+    $(wildcard include/config/cfi/clang/shadow.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/module.h \
+    $(wildcard include/config/arm64/module/plts.h) \
+    $(wildcard include/config/randomize/base.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/module.h \
+    $(wildcard include/config/have/mod/arch/specific.h) \
+    $(wildcard include/config/modules/use/elf/rel.h) \
+    $(wildcard include/config/modules/use/elf/rela.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/vermagic.h \
+  include/generated/utsrelease.h \
+
+/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.o: $(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.o)
+
+$(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.mod.o):
diff --git a/optee/.optee_armtz.o.cmd b/optee/.optee_armtz.o.cmd
new file mode 100644 (file)
index 0000000..9e0d599
--- /dev/null
@@ -0,0 +1 @@
+cmd_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.o := aarch64-linux-gnu-ld -EL    -r -o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/core.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/call.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/rpc.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/supp.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.o 
diff --git a/optee/.rpc.o.cmd b/optee/.rpc.o.cmd
new file mode 100644 (file)
index 0000000..a55db63
--- /dev/null
@@ -0,0 +1,714 @@
+cmd_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/rpc.o := aarch64-linux-gnu-gcc -Wp,-MD,/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.rpc.o.d  -nostdinc -isystem /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include -I./arch/arm64/include/generated/uapi -I./arch/arm64/include/generated  -I/mnt/fileroot/lei.qian/p-amlogic/common/include -I./include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi -I/mnt/fileroot/lei.qian/p-amlogic/common/include/uapi -I./include/generated/uapi -include /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kconfig.h -I/mnt/fileroot/lei.qian/p-amlogic/common//mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -Werror -std=gnu89 -fno-PIE -fno-PIE -mgeneral-regs-only -fno-asynchronous-unwind-tables -fno-pic -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include  -DMODULE -mcmodel=large  -DKBUILD_BASENAME='"rpc"'  -DKBUILD_MODNAME='"optee_armtz"' -c -o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.tmp_rpc.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/rpc.c
+
+source_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/rpc.o := /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/rpc.c
+
+deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/rpc.o := \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/delay.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernel.h \
+    $(wildcard include/config/lbdaf.h) \
+    $(wildcard include/config/preempt/voluntary.h) \
+    $(wildcard include/config/debug/atomic/sleep.h) \
+    $(wildcard include/config/mmu.h) \
+    $(wildcard include/config/prove/locking.h) \
+    $(wildcard include/config/panic/timeout.h) \
+    $(wildcard include/config/tracing.h) \
+    $(wildcard include/config/ftrace/mcount/record.h) \
+  /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/lib/gcc/aarch64-linux-gnu/4.9.2/include/stdarg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler.h \
+    $(wildcard include/config/sparse/rcu/pointer.h) \
+    $(wildcard include/config/trace/branch/profiling.h) \
+    $(wildcard include/config/profile/all/branches.h) \
+    $(wildcard include/config/kasan.h) \
+    $(wildcard include/config/enable/must/check.h) \
+    $(wildcard include/config/enable/warn/deprecated.h) \
+    $(wildcard include/config/kprobes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler-gcc.h \
+    $(wildcard include/config/arch/supports/optimized/inlining.h) \
+    $(wildcard include/config/optimize/inlining.h) \
+    $(wildcard include/config/gcov/kernel.h) \
+    $(wildcard include/config/stack/validation.h) \
+    $(wildcard include/config/arch/use/builtin/bswap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/types.h \
+  arch/arm64/include/generated/asm/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitsperlong.h \
+    $(wildcard include/config/64bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringify.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/export.h \
+    $(wildcard include/config/have/underscore/symbol/prefix.h) \
+    $(wildcard include/config/modules.h) \
+    $(wildcard include/config/modversions.h) \
+    $(wildcard include/config/trim/unused/ksyms.h) \
+    $(wildcard include/config/unused/symbols.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/types.h \
+    $(wildcard include/config/have/uid16.h) \
+    $(wildcard include/config/uid16.h) \
+    $(wildcard include/config/arch/dma/addr/t/64bit.h) \
+    $(wildcard include/config/phys/addr/t/64bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/barrier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/barrier.h \
+    $(wildcard include/config/smp.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/ffz.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/fls64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/find.h \
+    $(wildcard include/config/generic/find/first/bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/arch_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/const_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/lock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/non-atomic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/le.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/byteorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/swab.h \
+  arch/arm64/include/generated/asm/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/generic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/log2.h \
+    $(wildcard include/config/arch/has/ilog2/u32.h) \
+    $(wildcard include/config/arch/has/ilog2/u64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/typecheck.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/printk.h \
+    $(wildcard include/config/message/loglevel/default.h) \
+    $(wildcard include/config/early/printk.h) \
+    $(wildcard include/config/printk/nmi.h) \
+    $(wildcard include/config/printk.h) \
+    $(wildcard include/config/dynamic/debug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/init.h \
+    $(wildcard include/config/debug/rodata.h) \
+    $(wildcard include/config/debug/set/module/ronx.h) \
+    $(wildcard include/config/lto/clang.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kern_levels.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cache.h \
+    $(wildcard include/config/arch/has/cache/line/size.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kernel.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysinfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cache.h \
+    $(wildcard include/config/amlogic/memory/extend.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cachetype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cputype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sysreg.h \
+    $(wildcard include/config/arm64/4k/pages.h) \
+    $(wildcard include/config/arm64/16k/pages.h) \
+    $(wildcard include/config/arm64/64k/pages.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/big/endian.h) \
+    $(wildcard include/config/cpu/endian/be8.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/../../arm/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/endian/be32.h) \
+    $(wildcard include/config/thumb2/kernel.h) \
+  arch/arm64/include/generated/asm/delay.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/delay.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/device.h \
+    $(wildcard include/config/debug/devres.h) \
+    $(wildcard include/config/generic/msi/irq/domain.h) \
+    $(wildcard include/config/pinctrl.h) \
+    $(wildcard include/config/generic/msi/irq.h) \
+    $(wildcard include/config/numa.h) \
+    $(wildcard include/config/dma/cma.h) \
+    $(wildcard include/config/pm/sleep.h) \
+    $(wildcard include/config/of.h) \
+    $(wildcard include/config/devtmpfs.h) \
+    $(wildcard include/config/sysfs/deprecated.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ioport.h \
+    $(wildcard include/config/memory/hotremove.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject.h \
+    $(wildcard include/config/uevent/helper.h) \
+    $(wildcard include/config/debug/kobject/release.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list.h \
+    $(wildcard include/config/debug/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/poison.h \
+    $(wildcard include/config/illegal/pointer/value.h) \
+    $(wildcard include/config/page/poisoning/zero.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/const.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysfs.h \
+    $(wildcard include/config/debug/lock/alloc.h) \
+    $(wildcard include/config/sysfs.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernfs.h \
+    $(wildcard include/config/kernfs.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/err.h \
+  arch/arm64/include/generated/asm/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno-base.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mutex.h \
+    $(wildcard include/config/debug/mutexes.h) \
+    $(wildcard include/config/mutex/spin/on/owner.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/current.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_types.h \
+    $(wildcard include/config/generic/lockbreak.h) \
+    $(wildcard include/config/debug/spinlock.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/lockdep.h \
+    $(wildcard include/config/lockdep.h) \
+    $(wildcard include/config/lock/stat.h) \
+    $(wildcard include/config/trace/irqflags.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/atomic.h \
+    $(wildcard include/config/generic/atomic64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic.h \
+    $(wildcard include/config/arm64/lse/atomics.h) \
+    $(wildcard include/config/as/lse.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/lse.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic_ll_sc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cmpxchg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bug.h \
+    $(wildcard include/config/generic/bug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bug.h \
+    $(wildcard include/config/debug/bugverbose.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/brk-imm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bug.h \
+    $(wildcard include/config/bug.h) \
+    $(wildcard include/config/generic/bug/relative/pointers.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/atomic-long.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/processor.h \
+    $(wildcard include/config/compat.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/string.h \
+    $(wildcard include/config/binary/printf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/alternative.h \
+    $(wildcard include/config/arm64/uao.h) \
+    $(wildcard include/config/foo.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpucaps.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/insn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/fpsimd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hw_breakpoint.h \
+    $(wildcard include/config/have/hw/breakpoint.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpufeature.h \
+    $(wildcard include/config/arm64/sw/ttbr0/pan.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jump_label.h \
+    $(wildcard include/config/jump/label.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/jump_label.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/virt.h \
+    $(wildcard include/config/arm64/vhe.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-hwdef.h \
+    $(wildcard include/config/pgtable/levels.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/osq_lock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/idr.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcupdate.h \
+    $(wildcard include/config/tiny/rcu.h) \
+    $(wildcard include/config/tree/rcu.h) \
+    $(wildcard include/config/preempt/rcu.h) \
+    $(wildcard include/config/rcu/trace.h) \
+    $(wildcard include/config/preempt/count.h) \
+    $(wildcard include/config/rcu/stall/common.h) \
+    $(wildcard include/config/no/hz/full.h) \
+    $(wildcard include/config/rcu/nocb/cpu.h) \
+    $(wildcard include/config/tasks/rcu.h) \
+    $(wildcard include/config/debug/objects/rcu/head.h) \
+    $(wildcard include/config/hotplug/cpu.h) \
+    $(wildcard include/config/prove/rcu.h) \
+    $(wildcard include/config/preempt.h) \
+    $(wildcard include/config/rcu/boost.h) \
+    $(wildcard include/config/rcu/nocb/cpu/all.h) \
+    $(wildcard include/config/no/hz/full/sysidle.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/preempt.h \
+    $(wildcard include/config/debug/preempt.h) \
+    $(wildcard include/config/preempt/tracer.h) \
+    $(wildcard include/config/preempt/notifiers.h) \
+  arch/arm64/include/generated/asm/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/thread_info.h \
+    $(wildcard include/config/thread/info/in/task.h) \
+    $(wildcard include/config/debug/stack/usage.h) \
+    $(wildcard include/config/have/arch/within/stack/frames.h) \
+    $(wildcard include/config/hardened/usercopy.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/restart_block.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/thread_info.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stack_pointer.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/irqflags.h \
+    $(wildcard include/config/irqsoff/tracer.h) \
+    $(wildcard include/config/trace/irqflags/support.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/irqflags.h \
+    $(wildcard include/config/amlogic/debug/lockup.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/../drivers/amlogic/debug/irqflags_debug.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/amlogic/debug_lockup.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bottom_half.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_api_smp.h \
+    $(wildcard include/config/inline/spin/lock.h) \
+    $(wildcard include/config/inline/spin/lock/bh.h) \
+    $(wildcard include/config/inline/spin/lock/irq.h) \
+    $(wildcard include/config/inline/spin/lock/irqsave.h) \
+    $(wildcard include/config/inline/spin/trylock.h) \
+    $(wildcard include/config/inline/spin/trylock/bh.h) \
+    $(wildcard include/config/uninline/spin/unlock.h) \
+    $(wildcard include/config/inline/spin/unlock/bh.h) \
+    $(wildcard include/config/inline/spin/unlock/irq.h) \
+    $(wildcard include/config/inline/spin/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_api_smp.h \
+    $(wildcard include/config/inline/read/lock.h) \
+    $(wildcard include/config/inline/write/lock.h) \
+    $(wildcard include/config/inline/read/lock/bh.h) \
+    $(wildcard include/config/inline/write/lock/bh.h) \
+    $(wildcard include/config/inline/read/lock/irq.h) \
+    $(wildcard include/config/inline/write/lock/irq.h) \
+    $(wildcard include/config/inline/read/lock/irqsave.h) \
+    $(wildcard include/config/inline/write/lock/irqsave.h) \
+    $(wildcard include/config/inline/read/trylock.h) \
+    $(wildcard include/config/inline/write/trylock.h) \
+    $(wildcard include/config/inline/read/unlock.h) \
+    $(wildcard include/config/inline/write/unlock.h) \
+    $(wildcard include/config/inline/read/unlock/bh.h) \
+    $(wildcard include/config/inline/write/unlock/bh.h) \
+    $(wildcard include/config/inline/read/unlock/irq.h) \
+    $(wildcard include/config/inline/write/unlock/irq.h) \
+    $(wildcard include/config/inline/read/unlock/irqrestore.h) \
+    $(wildcard include/config/inline/write/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/threads.h \
+    $(wildcard include/config/nr/cpus.h) \
+    $(wildcard include/config/base/small.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cpumask.h \
+    $(wildcard include/config/cpumask/offstack.h) \
+    $(wildcard include/config/debug/per/cpu/maps.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitmap.h \
+    $(wildcard include/config/s390.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seqlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/completion.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/debugobjects.h \
+    $(wildcard include/config/debug/objects.h) \
+    $(wildcard include/config/debug/objects/free.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ktime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time.h \
+    $(wildcard include/config/arch/uses/gettimeoffset.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/math64.h \
+    $(wildcard include/config/arch/supports/int128.h) \
+  arch/arm64/include/generated/asm/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/time.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jiffies.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/param.h \
+    $(wildcard include/config/hz.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/arch_timer.h \
+    $(wildcard include/config/fsl/erratum/a008585.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/clocksource/arm_arch_timer.h \
+    $(wildcard include/config/arm/arch/timer.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timecounter.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/timex.h \
+  include/generated/timeconst.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timekeeping.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcutree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rbtree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject_ns.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/compat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched.h \
+    $(wildcard include/config/cpu/quiet.h) \
+    $(wildcard include/config/no/hz/common.h) \
+    $(wildcard include/config/sched/debug.h) \
+    $(wildcard include/config/lockup/detector.h) \
+    $(wildcard include/config/detect/hung/task.h) \
+    $(wildcard include/config/core/dump/default/elf/headers.h) \
+    $(wildcard include/config/virt/cpu/accounting/native.h) \
+    $(wildcard include/config/sched/autogroup.h) \
+    $(wildcard include/config/bsd/process/acct.h) \
+    $(wildcard include/config/taskstats.h) \
+    $(wildcard include/config/audit.h) \
+    $(wildcard include/config/inotify/user.h) \
+    $(wildcard include/config/fanotify.h) \
+    $(wildcard include/config/epoll.h) \
+    $(wildcard include/config/posix/mqueue.h) \
+    $(wildcard include/config/keys.h) \
+    $(wildcard include/config/perf/events.h) \
+    $(wildcard include/config/bpf/syscall.h) \
+    $(wildcard include/config/sched/info.h) \
+    $(wildcard include/config/task/delay/acct.h) \
+    $(wildcard include/config/schedstats.h) \
+    $(wildcard include/config/sched/smt.h) \
+    $(wildcard include/config/sched/mc.h) \
+    $(wildcard include/config/sched/walt.h) \
+    $(wildcard include/config/fair/group/sched.h) \
+    $(wildcard include/config/rt/group/sched.h) \
+    $(wildcard include/config/cgroup/sched.h) \
+    $(wildcard include/config/blk/dev/io/trace.h) \
+    $(wildcard include/config/memcg.h) \
+    $(wildcard include/config/slob.h) \
+    $(wildcard include/config/compat/brk.h) \
+    $(wildcard include/config/cgroups.h) \
+    $(wildcard include/config/cc/stackprotector.h) \
+    $(wildcard include/config/cpu/freq/times.h) \
+    $(wildcard include/config/virt/cpu/accounting/gen.h) \
+    $(wildcard include/config/sysvipc.h) \
+    $(wildcard include/config/auditsyscall.h) \
+    $(wildcard include/config/rt/mutexes.h) \
+    $(wildcard include/config/ubsan.h) \
+    $(wildcard include/config/block.h) \
+    $(wildcard include/config/task/xacct.h) \
+    $(wildcard include/config/cpusets.h) \
+    $(wildcard include/config/futex.h) \
+    $(wildcard include/config/numa/balancing.h) \
+    $(wildcard include/config/arch/want/batched/unmap/tlb/flush.h) \
+    $(wildcard include/config/fault/injection.h) \
+    $(wildcard include/config/latencytop.h) \
+    $(wildcard include/config/function/graph/tracer.h) \
+    $(wildcard include/config/kcov.h) \
+    $(wildcard include/config/uprobes.h) \
+    $(wildcard include/config/bcache.h) \
+    $(wildcard include/config/vmap/stack.h) \
+    $(wildcard include/config/arch/wants/dynamic/task/struct.h) \
+    $(wildcard include/config/have/unstable/sched/clock.h) \
+    $(wildcard include/config/irq/time/accounting.h) \
+    $(wildcard include/config/proc/fs.h) \
+    $(wildcard include/config/stack/growsup.h) \
+    $(wildcard include/config/have/copy/thread/tls.h) \
+    $(wildcard include/config/have/exit/thread.h) \
+    $(wildcard include/config/cpu/freq.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched/prio.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/capability.h \
+    $(wildcard include/config/multiuser.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/capability.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/plist.h \
+    $(wildcard include/config/debug/pi/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/nodemask.h \
+    $(wildcard include/config/highmem.h) \
+    $(wildcard include/config/movable/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/numa.h \
+    $(wildcard include/config/nodes/shift.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mm_types.h \
+    $(wildcard include/config/split/ptlock/cpus.h) \
+    $(wildcard include/config/arch/enable/split/pmd/ptlock.h) \
+    $(wildcard include/config/amlogic/page/trace.h) \
+    $(wildcard include/config/have/cmpxchg/double.h) \
+    $(wildcard include/config/have/aligned/struct/page.h) \
+    $(wildcard include/config/transparent/hugepage.h) \
+    $(wildcard include/config/kmemcheck.h) \
+    $(wildcard include/config/userfaultfd.h) \
+    $(wildcard include/config/aio.h) \
+    $(wildcard include/config/mmu/notifier.h) \
+    $(wildcard include/config/compaction.h) \
+    $(wildcard include/config/x86/intel/mpx.h) \
+    $(wildcard include/config/hugetlb/page.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwsem.h \
+    $(wildcard include/config/rwsem/spin/on/owner.h) \
+    $(wildcard include/config/rwsem/generic/spinlock.h) \
+  arch/arm64/include/generated/asm/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uprobes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/page-flags-layout.h \
+    $(wildcard include/config/sparsemem.h) \
+    $(wildcard include/config/sparsemem/vmemmap.h) \
+  include/generated/bounds.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sparsemem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/workqueue.h \
+    $(wildcard include/config/debug/objects/work.h) \
+    $(wildcard include/config/freezer.h) \
+    $(wildcard include/config/wq/watchdog.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timer.h \
+    $(wildcard include/config/timer/stats.h) \
+    $(wildcard include/config/debug/objects/timers.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysctl.h \
+    $(wildcard include/config/sysctl.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uidgid.h \
+    $(wildcard include/config/user/ns.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/highuid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/page.h \
+    $(wildcard include/config/arm64/page/shift.h) \
+    $(wildcard include/config/arm64/cont/shift.h) \
+    $(wildcard include/config/have/arch/pfn/valid.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/pgtable-nopud.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/memory.h \
+    $(wildcard include/config/arm64/va/bits.h) \
+    $(wildcard include/config/blk/dev/initrd.h) \
+  arch/arm64/include/generated/asm/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmdebug.h \
+    $(wildcard include/config/debug/vm.h) \
+    $(wildcard include/config/debug/virtual.h) \
+    $(wildcard include/config/debug/vm/pgflags.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/memory_model.h \
+    $(wildcard include/config/flatmem.h) \
+    $(wildcard include/config/discontigmem.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pfn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/getorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/mmu.h \
+    $(wildcard include/config/unmap/kernel/at/el0.h) \
+    $(wildcard include/config/harden/branch/predictor.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu.h \
+    $(wildcard include/config/need/per/cpu/embed/first/chunk.h) \
+    $(wildcard include/config/need/per/cpu/page/first/chunk.h) \
+    $(wildcard include/config/have/setup/per/cpu/area.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/smp.h \
+    $(wildcard include/config/amlogic/modify.h) \
+    $(wildcard include/config/up/late/init.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/llist.h \
+    $(wildcard include/config/arch/have/nmi/safe/cmpxchg.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/smp.h \
+    $(wildcard include/config/arm64/acpi/parking/protocol.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-defs.h \
+    $(wildcard include/config/page/table/isolation.h) \
+    $(wildcard include/config/debug/force/weak/per/cpu.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cputime.h \
+  arch/arm64/include/generated/asm/cputime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime.h \
+    $(wildcard include/config/virt/cpu/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime_jiffies.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ipc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/ipc.h \
+  arch/arm64/include/generated/asm/ipcbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/ipcbuf.h \
+  arch/arm64/include/generated/asm/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/shm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/shm.h \
+  arch/arm64/include/generated/asm/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/signal.h \
+    $(wildcard include/config/old/sigaction.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal-defs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/sigcontext.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/topology.h \
+    $(wildcard include/config/use/percpu/numa/node/id.h) \
+    $(wildcard include/config/have/memoryless/nodes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmzone.h \
+    $(wildcard include/config/force/max/zoneorder.h) \
+    $(wildcard include/config/cma.h) \
+    $(wildcard include/config/memory/isolation.h) \
+    $(wildcard include/config/zsmalloc.h) \
+    $(wildcard include/config/amlogic/cma.h) \
+    $(wildcard include/config/zone/dma.h) \
+    $(wildcard include/config/zone/dma32.h) \
+    $(wildcard include/config/zone/device.h) \
+    $(wildcard include/config/memory/hotplug.h) \
+    $(wildcard include/config/flat/node/mem/map.h) \
+    $(wildcard include/config/page/extension.h) \
+    $(wildcard include/config/no/bootmem.h) \
+    $(wildcard include/config/deferred/struct/page/init.h) \
+    $(wildcard include/config/have/memory/present.h) \
+    $(wildcard include/config/need/node/memmap/size.h) \
+    $(wildcard include/config/have/memblock/node/map.h) \
+    $(wildcard include/config/need/multiple/nodes.h) \
+    $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
+    $(wildcard include/config/sparsemem/extreme.h) \
+    $(wildcard include/config/holes/in/zone.h) \
+    $(wildcard include/config/arch/has/holes/memorymodel.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pageblock-flags.h \
+    $(wildcard include/config/hugetlb/page/size/variable.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/memory_hotplug.h \
+    $(wildcard include/config/have/arch/nodedata/extension.h) \
+    $(wildcard include/config/have/bootmem/info/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/notifier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/srcu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seccomp.h \
+    $(wildcard include/config/seccomp.h) \
+    $(wildcard include/config/have/arch/seccomp/filter.h) \
+    $(wildcard include/config/seccomp/filter.h) \
+    $(wildcard include/config/checkpoint/restore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rculist.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rtmutex.h \
+    $(wildcard include/config/debug/rt/mutexes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/resource.h \
+  arch/arm64/include/generated/asm/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/hrtimer.h \
+    $(wildcard include/config/high/res/timers.h) \
+    $(wildcard include/config/time/low/res.h) \
+    $(wildcard include/config/timerfd.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timerqueue.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/task_io_accounting.h \
+    $(wildcard include/config/task/io/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/latencytop.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cred.h \
+    $(wildcard include/config/debug/credentials.h) \
+    $(wildcard include/config/security.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/key.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/assoc_array.h \
+    $(wildcard include/config/associative/array.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/selinux.h \
+    $(wildcard include/config/security/selinux.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/gfp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/magic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup-defs.h \
+    $(wildcard include/config/sock/cgroup/data.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/limits.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-refcount.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcu_sync.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bpf-cgroup.h \
+    $(wildcard include/config/cgroup/bpf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf_common.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup_subsys.h \
+    $(wildcard include/config/cgroup/cpuacct.h) \
+    $(wildcard include/config/cgroup/schedtune.h) \
+    $(wildcard include/config/blk/cgroup.h) \
+    $(wildcard include/config/cgroup/device.h) \
+    $(wildcard include/config/cgroup/freezer.h) \
+    $(wildcard include/config/cgroup/net/classid.h) \
+    $(wildcard include/config/cgroup/perf.h) \
+    $(wildcard include/config/cgroup/net/prio.h) \
+    $(wildcard include/config/cgroup/hugetlb.h) \
+    $(wildcard include/config/cgroup/pids.h) \
+    $(wildcard include/config/cgroup/debug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kref.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/klist.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/devinfo.h \
+    $(wildcard include/config/pm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/consumer.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seq_file.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/fs.h \
+    $(wildcard include/config/fs/posix/acl.h) \
+    $(wildcard include/config/cgroup/writeback.h) \
+    $(wildcard include/config/ima.h) \
+    $(wildcard include/config/fsnotify.h) \
+    $(wildcard include/config/fs/encryption.h) \
+    $(wildcard include/config/file/locking.h) \
+    $(wildcard include/config/quota.h) \
+    $(wildcard include/config/fs/dax.h) \
+    $(wildcard include/config/mandatory/file/locking.h) \
+    $(wildcard include/config/migration.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kdev_t.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kdev_t.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dcache.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rculist_bl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list_bl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bit_spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/lockref.h \
+    $(wildcard include/config/arch/use/cmpxchg/lockref.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringhash.h \
+    $(wildcard include/config/dcache/word/access.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/hash.h \
+    $(wildcard include/config/have/arch/hash.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/path.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list_lru.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/shrinker.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/radix-tree.h \
+    $(wildcard include/config/radix/tree/multiorder.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/semaphore.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fiemap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/migrate_mode.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/blk_types.h \
+    $(wildcard include/config/blk/dev/integrity.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/delayed_call.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/ioctl.h \
+  arch/arm64/include/generated/asm/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/quota.h \
+    $(wildcard include/config/quota/netlink/interface.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu_counter.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/dqblk_xfs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_v1.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_v2.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_qtree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/projid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/quota.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/nfs_fs_i.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/pinctrl-state.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pm.h \
+    $(wildcard include/config/vt/console/sleep.h) \
+    $(wildcard include/config/amlogic/usb.h) \
+    $(wildcard include/config/pm/clk.h) \
+    $(wildcard include/config/pm/generic/domains.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ratelimit.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/device.h \
+    $(wildcard include/config/iommu/api.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pm_wakeup.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/slab.h \
+    $(wildcard include/config/debug/slab.h) \
+    $(wildcard include/config/failslab.h) \
+    $(wildcard include/config/have/hardened/usercopy/allocator.h) \
+    $(wildcard include/config/slab.h) \
+    $(wildcard include/config/slub.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kmemleak.h \
+    $(wildcard include/config/debug/kmemleak.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kasan.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux/tee_drv.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux/tee.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_private.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/arm-smccc.h \
+    $(wildcard include/config/arm64.h) \
+    $(wildcard include/config/arm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/const.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_msg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_smc.h \
+
+/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/rpc.o: $(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/rpc.o)
+
+$(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/rpc.o):
diff --git a/optee/.smccc-call.o.cmd b/optee/.smccc-call.o.cmd
new file mode 100644 (file)
index 0000000..887d861
--- /dev/null
@@ -0,0 +1,28 @@
+cmd_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.o := aarch64-linux-gnu-gcc -Wp,-MD,/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.smccc-call.o.d  -nostdinc -isystem /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include -I./arch/arm64/include/generated/uapi -I./arch/arm64/include/generated  -I/mnt/fileroot/lei.qian/p-amlogic/common/include -I./include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi -I/mnt/fileroot/lei.qian/p-amlogic/common/include/uapi -I./include/generated/uapi -include /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kconfig.h -D__KERNEL__ -mlittle-endian -D__ASSEMBLY__ -fno-PIE -DCC_HAVE_ASM_GOTO -Wa,-gdwarf-2 -DMODULE  -c -o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.S
+
+source_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.o := /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.S
+
+deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.o := \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler.h \
+    $(wildcard include/config/sparse/rcu/pointer.h) \
+    $(wildcard include/config/trace/branch/profiling.h) \
+    $(wildcard include/config/profile/all/branches.h) \
+    $(wildcard include/config/kasan.h) \
+    $(wildcard include/config/enable/must/check.h) \
+    $(wildcard include/config/enable/warn/deprecated.h) \
+    $(wildcard include/config/kprobes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringify.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/export.h \
+    $(wildcard include/config/have/underscore/symbol/prefix.h) \
+    $(wildcard include/config/modules.h) \
+    $(wildcard include/config/modversions.h) \
+    $(wildcard include/config/trim/unused/ksyms.h) \
+    $(wildcard include/config/unused/symbols.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/asm-offsets.h \
+  include/generated/asm-offsets.h \
+
+/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.o: $(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.o)
+
+$(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/smccc-call.o):
diff --git a/optee/.supp.o.cmd b/optee/.supp.o.cmd
new file mode 100644 (file)
index 0000000..15fd02f
--- /dev/null
@@ -0,0 +1,726 @@
+cmd_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/supp.o := aarch64-linux-gnu-gcc -Wp,-MD,/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.supp.o.d  -nostdinc -isystem /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/bin/../lib/gcc/aarch64-linux-gnu/4.9.2/include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include -I./arch/arm64/include/generated/uapi -I./arch/arm64/include/generated  -I/mnt/fileroot/lei.qian/p-amlogic/common/include -I./include -I/mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi -I/mnt/fileroot/lei.qian/p-amlogic/common/include/uapi -I./include/generated/uapi -include /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kconfig.h -I/mnt/fileroot/lei.qian/p-amlogic/common//mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee -D__KERNEL__ -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -Werror -std=gnu89 -fno-PIE -fno-PIE -mgeneral-regs-only -fno-asynchronous-unwind-tables -fno-pic -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -DCC_HAVE_ASM_GOTO -Wframe-larger-than=2048 -fstack-protector-strong -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -g -pg -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-merge-all-constants -fmerge-constants -fno-stack-check -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux  -I/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include  -DMODULE -mcmodel=large  -DKBUILD_BASENAME='"supp"'  -DKBUILD_MODNAME='"optee_armtz"' -c -o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/.tmp_supp.o /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/supp.c
+
+source_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/supp.o := /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/supp.c
+
+deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/supp.o := \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/device.h \
+    $(wildcard include/config/debug/devres.h) \
+    $(wildcard include/config/generic/msi/irq/domain.h) \
+    $(wildcard include/config/pinctrl.h) \
+    $(wildcard include/config/generic/msi/irq.h) \
+    $(wildcard include/config/numa.h) \
+    $(wildcard include/config/dma/cma.h) \
+    $(wildcard include/config/pm/sleep.h) \
+    $(wildcard include/config/of.h) \
+    $(wildcard include/config/devtmpfs.h) \
+    $(wildcard include/config/printk.h) \
+    $(wildcard include/config/dynamic/debug.h) \
+    $(wildcard include/config/sysfs/deprecated.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ioport.h \
+    $(wildcard include/config/memory/hotremove.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler.h \
+    $(wildcard include/config/sparse/rcu/pointer.h) \
+    $(wildcard include/config/trace/branch/profiling.h) \
+    $(wildcard include/config/profile/all/branches.h) \
+    $(wildcard include/config/kasan.h) \
+    $(wildcard include/config/enable/must/check.h) \
+    $(wildcard include/config/enable/warn/deprecated.h) \
+    $(wildcard include/config/kprobes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/compiler-gcc.h \
+    $(wildcard include/config/arch/supports/optimized/inlining.h) \
+    $(wildcard include/config/optimize/inlining.h) \
+    $(wildcard include/config/gcov/kernel.h) \
+    $(wildcard include/config/stack/validation.h) \
+    $(wildcard include/config/arch/use/builtin/bswap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/types.h \
+  arch/arm64/include/generated/asm/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/int-ll64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitsperlong.h \
+    $(wildcard include/config/64bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/bitsperlong.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stddef.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/posix_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/types.h \
+    $(wildcard include/config/have/uid16.h) \
+    $(wildcard include/config/uid16.h) \
+    $(wildcard include/config/lbdaf.h) \
+    $(wildcard include/config/arch/dma/addr/t/64bit.h) \
+    $(wildcard include/config/phys/addr/t/64bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject.h \
+    $(wildcard include/config/uevent/helper.h) \
+    $(wildcard include/config/debug/kobject/release.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list.h \
+    $(wildcard include/config/debug/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/poison.h \
+    $(wildcard include/config/illegal/pointer/value.h) \
+    $(wildcard include/config/page/poisoning/zero.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/const.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernel.h \
+    $(wildcard include/config/preempt/voluntary.h) \
+    $(wildcard include/config/debug/atomic/sleep.h) \
+    $(wildcard include/config/mmu.h) \
+    $(wildcard include/config/prove/locking.h) \
+    $(wildcard include/config/panic/timeout.h) \
+    $(wildcard include/config/tracing.h) \
+    $(wildcard include/config/ftrace/mcount/record.h) \
+  /opt/gcc-linaro-aarch64-linux-gnu-4.9-2014.09_linux/lib/gcc/aarch64-linux-gnu/4.9.2/include/stdarg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringify.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/export.h \
+    $(wildcard include/config/have/underscore/symbol/prefix.h) \
+    $(wildcard include/config/modules.h) \
+    $(wildcard include/config/modversions.h) \
+    $(wildcard include/config/trim/unused/ksyms.h) \
+    $(wildcard include/config/unused/symbols.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/linkage.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bitops.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/barrier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/barrier.h \
+    $(wildcard include/config/smp.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-ffs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-__fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/builtin-fls.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/ffz.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/fls64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/find.h \
+    $(wildcard include/config/generic/find/first/bit.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/arch_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/const_hweight.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/lock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/non-atomic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bitops/le.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/byteorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/byteorder/little_endian.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/swab.h \
+  arch/arm64/include/generated/asm/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/swab.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/byteorder/generic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/log2.h \
+    $(wildcard include/config/arch/has/ilog2/u32.h) \
+    $(wildcard include/config/arch/has/ilog2/u64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/typecheck.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/printk.h \
+    $(wildcard include/config/message/loglevel/default.h) \
+    $(wildcard include/config/early/printk.h) \
+    $(wildcard include/config/printk/nmi.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/init.h \
+    $(wildcard include/config/debug/rodata.h) \
+    $(wildcard include/config/debug/set/module/ronx.h) \
+    $(wildcard include/config/lto/clang.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kern_levels.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cache.h \
+    $(wildcard include/config/arch/has/cache/line/size.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kernel.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysinfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cache.h \
+    $(wildcard include/config/amlogic/memory/extend.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cachetype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cputype.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sysreg.h \
+    $(wildcard include/config/arm64/4k/pages.h) \
+    $(wildcard include/config/arm64/16k/pages.h) \
+    $(wildcard include/config/arm64/64k/pages.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/big/endian.h) \
+    $(wildcard include/config/cpu/endian/be8.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/../../arm/include/asm/opcodes.h \
+    $(wildcard include/config/cpu/endian/be32.h) \
+    $(wildcard include/config/thumb2/kernel.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysfs.h \
+    $(wildcard include/config/debug/lock/alloc.h) \
+    $(wildcard include/config/sysfs.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kernfs.h \
+    $(wildcard include/config/kernfs.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/err.h \
+  arch/arm64/include/generated/asm/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/errno-base.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mutex.h \
+    $(wildcard include/config/debug/mutexes.h) \
+    $(wildcard include/config/mutex/spin/on/owner.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/current.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_types.h \
+    $(wildcard include/config/generic/lockbreak.h) \
+    $(wildcard include/config/debug/spinlock.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/lockdep.h \
+    $(wildcard include/config/lockdep.h) \
+    $(wildcard include/config/lock/stat.h) \
+    $(wildcard include/config/trace/irqflags.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/atomic.h \
+    $(wildcard include/config/generic/atomic64.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic.h \
+    $(wildcard include/config/arm64/lse/atomics.h) \
+    $(wildcard include/config/as/lse.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/lse.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/atomic_ll_sc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cmpxchg.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bug.h \
+    $(wildcard include/config/generic/bug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/bug.h \
+    $(wildcard include/config/debug/bugverbose.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/brk-imm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/bug.h \
+    $(wildcard include/config/bug.h) \
+    $(wildcard include/config/generic/bug/relative/pointers.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/atomic-long.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/processor.h \
+    $(wildcard include/config/compat.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/string.h \
+    $(wildcard include/config/binary/printf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/string.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/alternative.h \
+    $(wildcard include/config/arm64/uao.h) \
+    $(wildcard include/config/foo.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpucaps.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/insn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/fpsimd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/hwcap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/ptrace.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/hw_breakpoint.h \
+    $(wildcard include/config/have/hw/breakpoint.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/cpufeature.h \
+    $(wildcard include/config/arm64/sw/ttbr0/pan.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jump_label.h \
+    $(wildcard include/config/jump/label.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/jump_label.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/virt.h \
+    $(wildcard include/config/arm64/vhe.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sections.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-hwdef.h \
+    $(wildcard include/config/pgtable/levels.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/osq_lock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/idr.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcupdate.h \
+    $(wildcard include/config/tiny/rcu.h) \
+    $(wildcard include/config/tree/rcu.h) \
+    $(wildcard include/config/preempt/rcu.h) \
+    $(wildcard include/config/rcu/trace.h) \
+    $(wildcard include/config/preempt/count.h) \
+    $(wildcard include/config/rcu/stall/common.h) \
+    $(wildcard include/config/no/hz/full.h) \
+    $(wildcard include/config/rcu/nocb/cpu.h) \
+    $(wildcard include/config/tasks/rcu.h) \
+    $(wildcard include/config/debug/objects/rcu/head.h) \
+    $(wildcard include/config/hotplug/cpu.h) \
+    $(wildcard include/config/prove/rcu.h) \
+    $(wildcard include/config/preempt.h) \
+    $(wildcard include/config/rcu/boost.h) \
+    $(wildcard include/config/rcu/nocb/cpu/all.h) \
+    $(wildcard include/config/no/hz/full/sysidle.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/preempt.h \
+    $(wildcard include/config/debug/preempt.h) \
+    $(wildcard include/config/preempt/tracer.h) \
+    $(wildcard include/config/preempt/notifiers.h) \
+  arch/arm64/include/generated/asm/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/preempt.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/thread_info.h \
+    $(wildcard include/config/thread/info/in/task.h) \
+    $(wildcard include/config/debug/stack/usage.h) \
+    $(wildcard include/config/have/arch/within/stack/frames.h) \
+    $(wildcard include/config/hardened/usercopy.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/restart_block.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/thread_info.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stack_pointer.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/irqflags.h \
+    $(wildcard include/config/irqsoff/tracer.h) \
+    $(wildcard include/config/trace/irqflags/support.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/irqflags.h \
+    $(wildcard include/config/amlogic/debug/lockup.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/../drivers/amlogic/debug/irqflags_debug.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/amlogic/debug_lockup.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bottom_half.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/spinlock_api_smp.h \
+    $(wildcard include/config/inline/spin/lock.h) \
+    $(wildcard include/config/inline/spin/lock/bh.h) \
+    $(wildcard include/config/inline/spin/lock/irq.h) \
+    $(wildcard include/config/inline/spin/lock/irqsave.h) \
+    $(wildcard include/config/inline/spin/trylock.h) \
+    $(wildcard include/config/inline/spin/trylock/bh.h) \
+    $(wildcard include/config/uninline/spin/unlock.h) \
+    $(wildcard include/config/inline/spin/unlock/bh.h) \
+    $(wildcard include/config/inline/spin/unlock/irq.h) \
+    $(wildcard include/config/inline/spin/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwlock_api_smp.h \
+    $(wildcard include/config/inline/read/lock.h) \
+    $(wildcard include/config/inline/write/lock.h) \
+    $(wildcard include/config/inline/read/lock/bh.h) \
+    $(wildcard include/config/inline/write/lock/bh.h) \
+    $(wildcard include/config/inline/read/lock/irq.h) \
+    $(wildcard include/config/inline/write/lock/irq.h) \
+    $(wildcard include/config/inline/read/lock/irqsave.h) \
+    $(wildcard include/config/inline/write/lock/irqsave.h) \
+    $(wildcard include/config/inline/read/trylock.h) \
+    $(wildcard include/config/inline/write/trylock.h) \
+    $(wildcard include/config/inline/read/unlock.h) \
+    $(wildcard include/config/inline/write/unlock.h) \
+    $(wildcard include/config/inline/read/unlock/bh.h) \
+    $(wildcard include/config/inline/write/unlock/bh.h) \
+    $(wildcard include/config/inline/read/unlock/irq.h) \
+    $(wildcard include/config/inline/write/unlock/irq.h) \
+    $(wildcard include/config/inline/read/unlock/irqrestore.h) \
+    $(wildcard include/config/inline/write/unlock/irqrestore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/threads.h \
+    $(wildcard include/config/nr/cpus.h) \
+    $(wildcard include/config/base/small.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cpumask.h \
+    $(wildcard include/config/cpumask/offstack.h) \
+    $(wildcard include/config/debug/per/cpu/maps.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bitmap.h \
+    $(wildcard include/config/s390.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seqlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/completion.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/wait.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/debugobjects.h \
+    $(wildcard include/config/debug/objects.h) \
+    $(wildcard include/config/debug/objects/free.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ktime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time.h \
+    $(wildcard include/config/arch/uses/gettimeoffset.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/math64.h \
+    $(wildcard include/config/arch/supports/int128.h) \
+  arch/arm64/include/generated/asm/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/div64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/time64.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/time.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/jiffies.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/param.h \
+    $(wildcard include/config/hz.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/param.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/timex.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/arch_timer.h \
+    $(wildcard include/config/fsl/erratum/a008585.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/clocksource/arm_arch_timer.h \
+    $(wildcard include/config/arm/arch/timer.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timecounter.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/timex.h \
+  include/generated/timeconst.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timekeeping.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/errno.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcutree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rbtree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kobject_ns.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/compat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched.h \
+    $(wildcard include/config/cpu/quiet.h) \
+    $(wildcard include/config/no/hz/common.h) \
+    $(wildcard include/config/sched/debug.h) \
+    $(wildcard include/config/lockup/detector.h) \
+    $(wildcard include/config/detect/hung/task.h) \
+    $(wildcard include/config/core/dump/default/elf/headers.h) \
+    $(wildcard include/config/virt/cpu/accounting/native.h) \
+    $(wildcard include/config/sched/autogroup.h) \
+    $(wildcard include/config/bsd/process/acct.h) \
+    $(wildcard include/config/taskstats.h) \
+    $(wildcard include/config/audit.h) \
+    $(wildcard include/config/inotify/user.h) \
+    $(wildcard include/config/fanotify.h) \
+    $(wildcard include/config/epoll.h) \
+    $(wildcard include/config/posix/mqueue.h) \
+    $(wildcard include/config/keys.h) \
+    $(wildcard include/config/perf/events.h) \
+    $(wildcard include/config/bpf/syscall.h) \
+    $(wildcard include/config/sched/info.h) \
+    $(wildcard include/config/task/delay/acct.h) \
+    $(wildcard include/config/schedstats.h) \
+    $(wildcard include/config/sched/smt.h) \
+    $(wildcard include/config/sched/mc.h) \
+    $(wildcard include/config/sched/walt.h) \
+    $(wildcard include/config/fair/group/sched.h) \
+    $(wildcard include/config/rt/group/sched.h) \
+    $(wildcard include/config/cgroup/sched.h) \
+    $(wildcard include/config/blk/dev/io/trace.h) \
+    $(wildcard include/config/memcg.h) \
+    $(wildcard include/config/slob.h) \
+    $(wildcard include/config/compat/brk.h) \
+    $(wildcard include/config/cgroups.h) \
+    $(wildcard include/config/cc/stackprotector.h) \
+    $(wildcard include/config/cpu/freq/times.h) \
+    $(wildcard include/config/virt/cpu/accounting/gen.h) \
+    $(wildcard include/config/sysvipc.h) \
+    $(wildcard include/config/auditsyscall.h) \
+    $(wildcard include/config/rt/mutexes.h) \
+    $(wildcard include/config/ubsan.h) \
+    $(wildcard include/config/block.h) \
+    $(wildcard include/config/task/xacct.h) \
+    $(wildcard include/config/cpusets.h) \
+    $(wildcard include/config/futex.h) \
+    $(wildcard include/config/numa/balancing.h) \
+    $(wildcard include/config/arch/want/batched/unmap/tlb/flush.h) \
+    $(wildcard include/config/fault/injection.h) \
+    $(wildcard include/config/latencytop.h) \
+    $(wildcard include/config/function/graph/tracer.h) \
+    $(wildcard include/config/kcov.h) \
+    $(wildcard include/config/uprobes.h) \
+    $(wildcard include/config/bcache.h) \
+    $(wildcard include/config/vmap/stack.h) \
+    $(wildcard include/config/arch/wants/dynamic/task/struct.h) \
+    $(wildcard include/config/have/unstable/sched/clock.h) \
+    $(wildcard include/config/irq/time/accounting.h) \
+    $(wildcard include/config/proc/fs.h) \
+    $(wildcard include/config/stack/growsup.h) \
+    $(wildcard include/config/have/copy/thread/tls.h) \
+    $(wildcard include/config/have/exit/thread.h) \
+    $(wildcard include/config/cpu/freq.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sched.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sched/prio.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/capability.h \
+    $(wildcard include/config/multiuser.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/capability.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/plist.h \
+    $(wildcard include/config/debug/pi/list.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/nodemask.h \
+    $(wildcard include/config/highmem.h) \
+    $(wildcard include/config/movable/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/numa.h \
+    $(wildcard include/config/nodes/shift.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mm_types.h \
+    $(wildcard include/config/split/ptlock/cpus.h) \
+    $(wildcard include/config/arch/enable/split/pmd/ptlock.h) \
+    $(wildcard include/config/amlogic/page/trace.h) \
+    $(wildcard include/config/have/cmpxchg/double.h) \
+    $(wildcard include/config/have/aligned/struct/page.h) \
+    $(wildcard include/config/transparent/hugepage.h) \
+    $(wildcard include/config/kmemcheck.h) \
+    $(wildcard include/config/userfaultfd.h) \
+    $(wildcard include/config/aio.h) \
+    $(wildcard include/config/mmu/notifier.h) \
+    $(wildcard include/config/compaction.h) \
+    $(wildcard include/config/x86/intel/mpx.h) \
+    $(wildcard include/config/hugetlb/page.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/auxvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rwsem.h \
+    $(wildcard include/config/rwsem/spin/on/owner.h) \
+    $(wildcard include/config/rwsem/generic/spinlock.h) \
+  arch/arm64/include/generated/asm/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uprobes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/page-flags-layout.h \
+    $(wildcard include/config/sparsemem.h) \
+    $(wildcard include/config/sparsemem/vmemmap.h) \
+  include/generated/bounds.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/sparsemem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/workqueue.h \
+    $(wildcard include/config/debug/objects/work.h) \
+    $(wildcard include/config/freezer.h) \
+    $(wildcard include/config/wq/watchdog.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timer.h \
+    $(wildcard include/config/timer/stats.h) \
+    $(wildcard include/config/debug/objects/timers.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sysctl.h \
+    $(wildcard include/config/sysctl.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uidgid.h \
+    $(wildcard include/config/user/ns.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/highuid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sysctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/page.h \
+    $(wildcard include/config/arm64/page/shift.h) \
+    $(wildcard include/config/arm64/cont/shift.h) \
+    $(wildcard include/config/have/arch/pfn/valid.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/personality.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-types.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/pgtable-nopud.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/memory.h \
+    $(wildcard include/config/arm64/va/bits.h) \
+    $(wildcard include/config/blk/dev/initrd.h) \
+  arch/arm64/include/generated/asm/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sizes.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmdebug.h \
+    $(wildcard include/config/debug/vm.h) \
+    $(wildcard include/config/debug/virtual.h) \
+    $(wildcard include/config/debug/vm/pgflags.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/memory_model.h \
+    $(wildcard include/config/flatmem.h) \
+    $(wildcard include/config/discontigmem.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pfn.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/getorder.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/mmu.h \
+    $(wildcard include/config/unmap/kernel/at/el0.h) \
+    $(wildcard include/config/harden/branch/predictor.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu.h \
+    $(wildcard include/config/need/per/cpu/embed/first/chunk.h) \
+    $(wildcard include/config/need/per/cpu/page/first/chunk.h) \
+    $(wildcard include/config/have/setup/per/cpu/area.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/smp.h \
+    $(wildcard include/config/amlogic/modify.h) \
+    $(wildcard include/config/up/late/init.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/llist.h \
+    $(wildcard include/config/arch/have/nmi/safe/cmpxchg.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/smp.h \
+    $(wildcard include/config/arm64/acpi/parking/protocol.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/percpu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-defs.h \
+    $(wildcard include/config/page/table/isolation.h) \
+    $(wildcard include/config/debug/force/weak/per/cpu.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cputime.h \
+  arch/arm64/include/generated/asm/cputime.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime.h \
+    $(wildcard include/config/virt/cpu/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/cputime_jiffies.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/sem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ipc.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/ipc.h \
+  arch/arm64/include/generated/asm/ipcbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/ipcbuf.h \
+  arch/arm64/include/generated/asm/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/sembuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/shm.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/shm.h \
+  arch/arm64/include/generated/asm/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmbuf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/shmparam.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/signal.h \
+    $(wildcard include/config/old/sigaction.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/signal-defs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/sigcontext.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/siginfo.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/topology.h \
+    $(wildcard include/config/use/percpu/numa/node/id.h) \
+    $(wildcard include/config/have/memoryless/nodes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/mmzone.h \
+    $(wildcard include/config/force/max/zoneorder.h) \
+    $(wildcard include/config/cma.h) \
+    $(wildcard include/config/memory/isolation.h) \
+    $(wildcard include/config/zsmalloc.h) \
+    $(wildcard include/config/amlogic/cma.h) \
+    $(wildcard include/config/zone/dma.h) \
+    $(wildcard include/config/zone/dma32.h) \
+    $(wildcard include/config/zone/device.h) \
+    $(wildcard include/config/memory/hotplug.h) \
+    $(wildcard include/config/flat/node/mem/map.h) \
+    $(wildcard include/config/page/extension.h) \
+    $(wildcard include/config/no/bootmem.h) \
+    $(wildcard include/config/deferred/struct/page/init.h) \
+    $(wildcard include/config/have/memory/present.h) \
+    $(wildcard include/config/need/node/memmap/size.h) \
+    $(wildcard include/config/have/memblock/node/map.h) \
+    $(wildcard include/config/need/multiple/nodes.h) \
+    $(wildcard include/config/have/arch/early/pfn/to/nid.h) \
+    $(wildcard include/config/sparsemem/extreme.h) \
+    $(wildcard include/config/holes/in/zone.h) \
+    $(wildcard include/config/arch/has/holes/memorymodel.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pageblock-flags.h \
+    $(wildcard include/config/hugetlb/page/size/variable.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/memory_hotplug.h \
+    $(wildcard include/config/have/arch/nodedata/extension.h) \
+    $(wildcard include/config/have/bootmem/info/node.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/notifier.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/srcu.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/topology.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seccomp.h \
+    $(wildcard include/config/seccomp.h) \
+    $(wildcard include/config/have/arch/seccomp/filter.h) \
+    $(wildcard include/config/seccomp/filter.h) \
+    $(wildcard include/config/checkpoint/restore.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/seccomp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/unistd.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rculist.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rtmutex.h \
+    $(wildcard include/config/debug/rt/mutexes.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/resource.h \
+  arch/arm64/include/generated/asm/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/resource.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/hrtimer.h \
+    $(wildcard include/config/high/res/timers.h) \
+    $(wildcard include/config/time/low/res.h) \
+    $(wildcard include/config/timerfd.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/timerqueue.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kcov.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/task_io_accounting.h \
+    $(wildcard include/config/task/io/accounting.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/latencytop.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cred.h \
+    $(wildcard include/config/debug/credentials.h) \
+    $(wildcard include/config/security.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/key.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/assoc_array.h \
+    $(wildcard include/config/associative/array.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/selinux.h \
+    $(wildcard include/config/security/selinux.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/gfp.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/magic.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup-defs.h \
+    $(wildcard include/config/sock/cgroup/data.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/limits.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-refcount.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu-rwsem.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rcu_sync.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bpf-cgroup.h \
+    $(wildcard include/config/cgroup/bpf.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/bpf_common.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/cgroup_subsys.h \
+    $(wildcard include/config/cgroup/cpuacct.h) \
+    $(wildcard include/config/cgroup/schedtune.h) \
+    $(wildcard include/config/blk/cgroup.h) \
+    $(wildcard include/config/cgroup/device.h) \
+    $(wildcard include/config/cgroup/freezer.h) \
+    $(wildcard include/config/cgroup/net/classid.h) \
+    $(wildcard include/config/cgroup/perf.h) \
+    $(wildcard include/config/cgroup/net/prio.h) \
+    $(wildcard include/config/cgroup/hugetlb.h) \
+    $(wildcard include/config/cgroup/pids.h) \
+    $(wildcard include/config/cgroup/debug.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/stat.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kref.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/klist.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/devinfo.h \
+    $(wildcard include/config/pm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/consumer.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/seq_file.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/fs.h \
+    $(wildcard include/config/fs/posix/acl.h) \
+    $(wildcard include/config/cgroup/writeback.h) \
+    $(wildcard include/config/ima.h) \
+    $(wildcard include/config/fsnotify.h) \
+    $(wildcard include/config/fs/encryption.h) \
+    $(wildcard include/config/file/locking.h) \
+    $(wildcard include/config/quota.h) \
+    $(wildcard include/config/fs/dax.h) \
+    $(wildcard include/config/mandatory/file/locking.h) \
+    $(wildcard include/config/migration.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kdev_t.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/kdev_t.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dcache.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/rculist_bl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list_bl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bit_spinlock.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/lockref.h \
+    $(wildcard include/config/arch/use/cmpxchg/lockref.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/stringhash.h \
+    $(wildcard include/config/dcache/word/access.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/hash.h \
+    $(wildcard include/config/have/arch/hash.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/path.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/list_lru.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/shrinker.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/radix-tree.h \
+    $(wildcard include/config/radix/tree/multiorder.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/semaphore.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/uapi/asm/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/fcntl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fiemap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/migrate_mode.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/blk_types.h \
+    $(wildcard include/config/blk/dev/integrity.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/bvec.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/delayed_call.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/fs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/ioctl.h \
+  arch/arm64/include/generated/asm/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/asm-generic/ioctl.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/quota.h \
+    $(wildcard include/config/quota/netlink/interface.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/percpu_counter.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/dqblk_xfs.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_v1.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_v2.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/dqblk_qtree.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/projid.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/quota.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/nfs_fs_i.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pinctrl/pinctrl-state.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pm.h \
+    $(wildcard include/config/vt/console/sleep.h) \
+    $(wildcard include/config/amlogic/usb.h) \
+    $(wildcard include/config/pm/clk.h) \
+    $(wildcard include/config/pm/generic/domains.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/ratelimit.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/device.h \
+    $(wildcard include/config/iommu/api.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/pm_wakeup.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/slab.h \
+    $(wildcard include/config/debug/slab.h) \
+    $(wildcard include/config/failslab.h) \
+    $(wildcard include/config/have/hardened/usercopy/allocator.h) \
+    $(wildcard include/config/slab.h) \
+    $(wildcard include/config/slub.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kmemleak.h \
+    $(wildcard include/config/debug/kmemleak.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kasan.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/uaccess.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/uaccess.h \
+    $(wildcard include/config/arm64/pan.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/kernel-pgtable.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable.h \
+    $(wildcard include/config/arm64/hw/afdbm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/proc-fns.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/pgtable-prot.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/fixmap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/boot.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/fixmap.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/asm-generic/pgtable.h \
+    $(wildcard include/config/have/arch/soft/dirty.h) \
+    $(wildcard include/config/have/arch/huge/vmap.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/kasan-checks.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/arch/arm64/include/asm/compiler.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_private.h \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/linux/arm-smccc.h \
+    $(wildcard include/config/arm64.h) \
+    $(wildcard include/config/arm.h) \
+  /mnt/fileroot/lei.qian/p-amlogic/common/include/uapi/linux/const.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux/tee_drv.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver//include/linux/tee.h \
+  /mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_msg.h \
+
+/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/supp.o: $(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/supp.o)
+
+$(deps_/mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/supp.o):
diff --git a/optee/Kconfig b/optee/Kconfig
new file mode 100755 (executable)
index 0000000..0126de8
--- /dev/null
@@ -0,0 +1,7 @@
+# OP-TEE Trusted Execution Environment Configuration
+config OPTEE
+       tristate "OP-TEE"
+       depends on HAVE_ARM_SMCCC
+       help
+         This implements the OP-TEE Trusted Execution Environment (TEE)
+         driver.
diff --git a/optee/Makefile b/optee/Makefile
new file mode 100755 (executable)
index 0000000..85d2fc9
--- /dev/null
@@ -0,0 +1,11 @@
+ccflags-y+=-Werror
+ccflags-y+=-I$(M)/include/linux
+ccflags-y+=-I$(M)/include
+
+obj-m += optee_armtz.o
+
+optee_armtz-objs += core.o
+optee_armtz-objs += call.o
+optee_armtz-objs += rpc.o
+optee_armtz-objs += supp.o
+optee_armtz-objs += smccc-call.o
diff --git a/optee/call.c b/optee/call.c
new file mode 100644 (file)
index 0000000..ab1d92c
--- /dev/null
@@ -0,0 +1,444 @@
+/*
+ * Copyright (c) 2015, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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/arm-smccc.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/errno.h>
+#include <linux/slab.h>
+#include "tee_drv.h"
+#include <linux/types.h>
+#include <linux/uaccess.h>
+#include "optee_private.h"
+#include "optee_smc.h"
+
+struct optee_call_waiter {
+       struct list_head list_node;
+       struct completion c;
+};
+
+static void optee_cq_wait_init(struct optee_call_queue *cq,
+                              struct optee_call_waiter *w)
+{
+       /*
+        * We're preparing to make a call to secure world. In case we can't
+        * allocate a thread in secure world we'll end up waiting in
+        * optee_cq_wait_for_completion().
+        *
+        * Normally if there's no contention in secure world the call will
+        * complete and we can cleanup directly with optee_cq_wait_final().
+        */
+       mutex_lock(&cq->mutex);
+
+       /*
+        * We add ourselves to the queue, but we don't wait. This
+        * guarantees that we don't lose a completion if secure world
+        * returns busy and another thread just exited and try to complete
+        * someone.
+        */
+       init_completion(&w->c);
+       list_add_tail(&w->list_node, &cq->waiters);
+
+       mutex_unlock(&cq->mutex);
+}
+
+static void optee_cq_wait_for_completion(struct optee_call_queue *cq,
+                                        struct optee_call_waiter *w)
+{
+       wait_for_completion(&w->c);
+
+       mutex_lock(&cq->mutex);
+
+       /* Move to end of list to get out of the way for other waiters */
+       list_del(&w->list_node);
+       reinit_completion(&w->c);
+       list_add_tail(&w->list_node, &cq->waiters);
+
+       mutex_unlock(&cq->mutex);
+}
+
+static void optee_cq_complete_one(struct optee_call_queue *cq)
+{
+       struct optee_call_waiter *w;
+
+       list_for_each_entry(w, &cq->waiters, list_node) {
+               if (!completion_done(&w->c)) {
+                       complete(&w->c);
+                       break;
+               }
+       }
+}
+
+static void optee_cq_wait_final(struct optee_call_queue *cq,
+                               struct optee_call_waiter *w)
+{
+       /*
+        * We're done with the call to secure world. The thread in secure
+        * world that was used for this call is now available for some
+        * other task to use.
+        */
+       mutex_lock(&cq->mutex);
+
+       /* Get out of the list */
+       list_del(&w->list_node);
+
+       /* Wake up one eventual waiting task */
+       optee_cq_complete_one(cq);
+
+       /*
+        * If we're completed we've got a completion from another task that
+        * was just done with its call to secure world. Since yet another
+        * thread now is available in secure world wake up another eventual
+        * waiting task.
+        */
+       if (completion_done(&w->c))
+               optee_cq_complete_one(cq);
+
+       mutex_unlock(&cq->mutex);
+}
+
+/* Requires the filpstate mutex to be held */
+static struct optee_session *find_session(struct optee_context_data *ctxdata,
+                                         u32 session_id)
+{
+       struct optee_session *sess;
+
+       list_for_each_entry(sess, &ctxdata->sess_list, list_node)
+               if (sess->session_id == session_id)
+                       return sess;
+
+       return NULL;
+}
+
+/**
+ * optee_do_call_with_arg() - Do an SMC to OP-TEE in secure world
+ * @ctx:       calling context
+ * @parg:      physical address of message to pass to secure world
+ *
+ * Does and SMC to OP-TEE in secure world and handles eventual resulting
+ * Remote Procedure Calls (RPC) from OP-TEE.
+ *
+ * Returns return code from secure world, 0 is OK
+ */
+u32 optee_do_call_with_arg(struct tee_context *ctx, phys_addr_t parg)
+{
+       struct optee *optee = tee_get_drvdata(ctx->teedev);
+       struct optee_call_waiter w;
+       struct optee_rpc_param param = { };
+       u32 ret;
+
+       param.a0 = OPTEE_SMC_CALL_WITH_ARG;
+       reg_pair_from_64(&param.a1, &param.a2, parg);
+       /* Initialize waiter */
+       optee_cq_wait_init(&optee->call_queue, &w);
+       while (true) {
+               struct arm_smccc_res res;
+
+               optee->invoke_fn(param.a0, param.a1, param.a2, param.a3,
+                                param.a4, param.a5, param.a6, param.a7,
+                                &res);
+
+               if (res.a0 == OPTEE_SMC_RETURN_ETHREAD_LIMIT) {
+                       /*
+                        * Out of threads in secure world, wait for a thread
+                        * become available.
+                        */
+                       optee_cq_wait_for_completion(&optee->call_queue, &w);
+               } else if (OPTEE_SMC_RETURN_IS_RPC(res.a0)) {
+                       param.a0 = res.a0;
+                       param.a1 = res.a1;
+                       param.a2 = res.a2;
+                       param.a3 = res.a3;
+                       optee_handle_rpc(ctx, &param);
+               } else {
+                       ret = res.a0;
+                       break;
+               }
+       }
+
+       /*
+        * We're done with our thread in secure world, if there's any
+        * thread waiters wake up one.
+        */
+       optee_cq_wait_final(&optee->call_queue, &w);
+
+       return ret;
+}
+
+static struct tee_shm *get_msg_arg(struct tee_context *ctx, size_t num_params,
+                                  struct optee_msg_arg **msg_arg,
+                                  phys_addr_t *msg_parg)
+{
+       int rc;
+       struct tee_shm *shm;
+       struct optee_msg_arg *ma;
+
+       shm = tee_shm_alloc(ctx, OPTEE_MSG_GET_ARG_SIZE(num_params),
+                           TEE_SHM_MAPPED);
+       if (IS_ERR(shm))
+               return shm;
+
+       ma = tee_shm_get_va(shm, 0);
+       if (IS_ERR(ma)) {
+               rc = PTR_ERR(ma);
+               goto out;
+       }
+
+       rc = tee_shm_get_pa(shm, 0, msg_parg);
+       if (rc)
+               goto out;
+
+       memset(ma, 0, OPTEE_MSG_GET_ARG_SIZE(num_params));
+       ma->num_params = num_params;
+       *msg_arg = ma;
+out:
+       if (rc) {
+               tee_shm_free(shm);
+               return ERR_PTR(rc);
+       }
+
+       return shm;
+}
+
+int optee_open_session(struct tee_context *ctx,
+                      struct tee_ioctl_open_session_arg *arg,
+                      struct tee_param *param)
+{
+       struct optee_context_data *ctxdata = ctx->data;
+       int rc;
+       struct tee_shm *shm;
+       struct optee_msg_arg *msg_arg;
+       phys_addr_t msg_parg;
+       struct optee_session *sess = NULL;
+
+       /* +2 for the meta parameters added below */
+       shm = get_msg_arg(ctx, arg->num_params + 2, &msg_arg, &msg_parg);
+       if (IS_ERR(shm))
+               return PTR_ERR(shm);
+
+       msg_arg->cmd = OPTEE_MSG_CMD_OPEN_SESSION;
+       msg_arg->cancel_id = arg->cancel_id;
+
+       /*
+        * Initialize and add the meta parameters needed when opening a
+        * session.
+        */
+       msg_arg->params[0].attr = OPTEE_MSG_ATTR_TYPE_VALUE_INPUT |
+                                 OPTEE_MSG_ATTR_META;
+       msg_arg->params[1].attr = OPTEE_MSG_ATTR_TYPE_VALUE_INPUT |
+                                 OPTEE_MSG_ATTR_META;
+       memcpy(&msg_arg->params[0].u.value, arg->uuid, sizeof(arg->uuid));
+       memcpy(&msg_arg->params[1].u.value, arg->uuid, sizeof(arg->clnt_uuid));
+       msg_arg->params[1].u.value.c = arg->clnt_login;
+
+       rc = optee_to_msg_param(msg_arg->params + 2, arg->num_params, param);
+       if (rc)
+               goto out;
+
+       sess = kzalloc(sizeof(*sess), GFP_KERNEL);
+       if (!sess) {
+               rc = -ENOMEM;
+               goto out;
+       }
+
+       if (optee_do_call_with_arg(ctx, msg_parg)) {
+               msg_arg->ret = TEEC_ERROR_COMMUNICATION;
+               msg_arg->ret_origin = TEEC_ORIGIN_COMMS;
+       }
+
+       if (msg_arg->ret == TEEC_SUCCESS) {
+               /* A new session has been created, add it to the list. */
+               sess->session_id = msg_arg->session;
+               mutex_lock(&ctxdata->mutex);
+               list_add(&sess->list_node, &ctxdata->sess_list);
+               mutex_unlock(&ctxdata->mutex);
+       } else {
+               kfree(sess);
+       }
+
+       if (optee_from_msg_param(param, arg->num_params, msg_arg->params + 2)) {
+               arg->ret = TEEC_ERROR_COMMUNICATION;
+               arg->ret_origin = TEEC_ORIGIN_COMMS;
+               /* Close session again to avoid leakage */
+               optee_close_session(ctx, msg_arg->session);
+       } else {
+               arg->session = msg_arg->session;
+               arg->ret = msg_arg->ret;
+               arg->ret_origin = msg_arg->ret_origin;
+       }
+out:
+       tee_shm_free(shm);
+
+       return rc;
+}
+
+int optee_close_session(struct tee_context *ctx, u32 session)
+{
+       struct optee_context_data *ctxdata = ctx->data;
+       struct tee_shm *shm;
+       struct optee_msg_arg *msg_arg;
+       phys_addr_t msg_parg;
+       struct optee_session *sess;
+
+       /* Check that the session is valid and remove it from the list */
+       mutex_lock(&ctxdata->mutex);
+       sess = find_session(ctxdata, session);
+       if (sess)
+               list_del(&sess->list_node);
+       mutex_unlock(&ctxdata->mutex);
+       if (!sess)
+               return -EINVAL;
+       kfree(sess);
+
+       shm = get_msg_arg(ctx, 0, &msg_arg, &msg_parg);
+       if (IS_ERR(shm))
+               return PTR_ERR(shm);
+
+       msg_arg->cmd = OPTEE_MSG_CMD_CLOSE_SESSION;
+       msg_arg->session = session;
+       optee_do_call_with_arg(ctx, msg_parg);
+
+       tee_shm_free(shm);
+       return 0;
+}
+
+int optee_invoke_func(struct tee_context *ctx, struct tee_ioctl_invoke_arg *arg,
+                     struct tee_param *param)
+{
+       struct optee_context_data *ctxdata = ctx->data;
+       struct tee_shm *shm;
+       struct optee_msg_arg *msg_arg;
+       phys_addr_t msg_parg;
+       struct optee_session *sess;
+       int rc;
+
+       /* Check that the session is valid */
+       mutex_lock(&ctxdata->mutex);
+       sess = find_session(ctxdata, arg->session);
+       mutex_unlock(&ctxdata->mutex);
+       if (!sess)
+               return -EINVAL;
+
+       shm = get_msg_arg(ctx, arg->num_params, &msg_arg, &msg_parg);
+       if (IS_ERR(shm))
+               return PTR_ERR(shm);
+       msg_arg->cmd = OPTEE_MSG_CMD_INVOKE_COMMAND;
+       msg_arg->func = arg->func;
+       msg_arg->session = arg->session;
+       msg_arg->cancel_id = arg->cancel_id;
+
+       rc = optee_to_msg_param(msg_arg->params, arg->num_params, param);
+       if (rc)
+               goto out;
+
+       if (optee_do_call_with_arg(ctx, msg_parg)) {
+               msg_arg->ret = TEEC_ERROR_COMMUNICATION;
+               msg_arg->ret_origin = TEEC_ORIGIN_COMMS;
+       }
+
+       if (optee_from_msg_param(param, arg->num_params, msg_arg->params)) {
+               msg_arg->ret = TEEC_ERROR_COMMUNICATION;
+               msg_arg->ret_origin = TEEC_ORIGIN_COMMS;
+       }
+
+       arg->ret = msg_arg->ret;
+       arg->ret_origin = msg_arg->ret_origin;
+out:
+       tee_shm_free(shm);
+       return rc;
+}
+
+int optee_cancel_req(struct tee_context *ctx, u32 cancel_id, u32 session)
+{
+       struct optee_context_data *ctxdata = ctx->data;
+       struct tee_shm *shm;
+       struct optee_msg_arg *msg_arg;
+       phys_addr_t msg_parg;
+       struct optee_session *sess;
+
+       /* Check that the session is valid */
+       mutex_lock(&ctxdata->mutex);
+       sess = find_session(ctxdata, session);
+       mutex_unlock(&ctxdata->mutex);
+       if (!sess)
+               return -EINVAL;
+
+       shm = get_msg_arg(ctx, 0, &msg_arg, &msg_parg);
+       if (IS_ERR(shm))
+               return PTR_ERR(shm);
+
+       msg_arg->cmd = OPTEE_MSG_CMD_CANCEL;
+       msg_arg->session = session;
+       msg_arg->cancel_id = cancel_id;
+       optee_do_call_with_arg(ctx, msg_parg);
+
+       tee_shm_free(shm);
+       return 0;
+}
+
+/**
+ * optee_enable_shm_cache() - Enables caching of some shared memory allocation
+ *                           in OP-TEE
+ * @optee:     main service struct
+ */
+void optee_enable_shm_cache(struct optee *optee)
+{
+       struct optee_call_waiter w;
+
+       /* We need to retry until secure world isn't busy. */
+       optee_cq_wait_init(&optee->call_queue, &w);
+       while (true) {
+               struct arm_smccc_res res;
+
+               optee->invoke_fn(OPTEE_SMC_ENABLE_SHM_CACHE, 0, 0, 0, 0, 0, 0,
+                                0, &res);
+               if (res.a0 == OPTEE_SMC_RETURN_OK)
+                       break;
+               optee_cq_wait_for_completion(&optee->call_queue, &w);
+       }
+       optee_cq_wait_final(&optee->call_queue, &w);
+}
+
+/**
+ * optee_disable_shm_cache() - Disables caching of some shared memory allocation
+ *                           in OP-TEE
+ * @optee:     main service struct
+ */
+void optee_disable_shm_cache(struct optee *optee)
+{
+       struct optee_call_waiter w;
+
+       /* We need to retry until secure world isn't busy. */
+       optee_cq_wait_init(&optee->call_queue, &w);
+       while (true) {
+               union {
+                       struct arm_smccc_res smccc;
+                       struct optee_smc_disable_shm_cache_result result;
+               } res;
+
+               optee->invoke_fn(OPTEE_SMC_DISABLE_SHM_CACHE, 0, 0, 0, 0, 0, 0,
+                                0, &res.smccc);
+               if (res.result.status == OPTEE_SMC_RETURN_ENOTAVAIL)
+                       break; /* All shm's freed */
+               if (res.result.status == OPTEE_SMC_RETURN_OK) {
+                       struct tee_shm *shm;
+
+                       shm = reg_pair_to_ptr(res.result.shm_upper32,
+                                             res.result.shm_lower32);
+                       tee_shm_free(shm);
+               } else {
+                       optee_cq_wait_for_completion(&optee->call_queue, &w);
+               }
+       }
+       optee_cq_wait_final(&optee->call_queue, &w);
+}
diff --git a/optee/call.o b/optee/call.o
new file mode 100644 (file)
index 0000000..10dad7b
Binary files /dev/null and b/optee/call.o differ
diff --git a/optee/core.c b/optee/core.c
new file mode 100644 (file)
index 0000000..efffb3d
--- /dev/null
@@ -0,0 +1,610 @@
+/*
+ * Copyright (c) 2015, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/arm-smccc.h>
+#include <linux/errno.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+#include <linux/string.h>
+#include "tee_drv.h"
+#include <linux/types.h>
+#include <linux/uaccess.h>
+#include "../include/linux/arm-smccc.h"
+#include "optee_private.h"
+#include "optee_smc.h"
+
+#define DRIVER_NAME "optee"
+
+#define OPTEE_SHM_NUM_PRIV_PAGES       4
+
+/**
+ * optee_from_msg_param() - convert from OPTEE_MSG parameters to
+ *                         struct tee_param
+ * @params:    subsystem internal parameter representation
+ * @num_params:        number of elements in the parameter arrays
+ * @msg_params:        OPTEE_MSG parameters
+ * Returns 0 on success or <0 on failure
+ */
+int optee_from_msg_param(struct tee_param *params, size_t num_params,
+                        const struct optee_msg_param *msg_params)
+{
+       int rc;
+       size_t n;
+       struct tee_shm *shm;
+       phys_addr_t pa;
+
+       for (n = 0; n < num_params; n++) {
+               struct tee_param *p = params + n;
+               const struct optee_msg_param *mp = msg_params + n;
+               u32 attr = mp->attr & OPTEE_MSG_ATTR_TYPE_MASK;
+
+               switch (attr) {
+               case OPTEE_MSG_ATTR_TYPE_NONE:
+                       p->attr = TEE_IOCTL_PARAM_ATTR_TYPE_NONE;
+                       memset(&p->u, 0, sizeof(p->u));
+                       break;
+               case OPTEE_MSG_ATTR_TYPE_VALUE_INPUT:
+               case OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT:
+               case OPTEE_MSG_ATTR_TYPE_VALUE_INOUT:
+                       p->attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT +
+                                 attr - OPTEE_MSG_ATTR_TYPE_VALUE_INPUT;
+                       p->u.value.a = mp->u.value.a;
+                       p->u.value.b = mp->u.value.b;
+                       p->u.value.c = mp->u.value.c;
+                       break;
+               case OPTEE_MSG_ATTR_TYPE_TMEM_INPUT:
+               case OPTEE_MSG_ATTR_TYPE_TMEM_OUTPUT:
+               case OPTEE_MSG_ATTR_TYPE_TMEM_INOUT:
+                       p->attr = TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT +
+                                 attr - OPTEE_MSG_ATTR_TYPE_TMEM_INPUT;
+                       p->u.memref.size = mp->u.tmem.size;
+                       shm = (struct tee_shm *)(unsigned long)
+                               mp->u.tmem.shm_ref;
+                       if (!shm) {
+                               p->u.memref.shm_offs = 0;
+                               p->u.memref.shm = NULL;
+                               break;
+                       }
+                       rc = tee_shm_get_pa(shm, 0, &pa);
+                       if (rc)
+                               return rc;
+                       p->u.memref.shm_offs = mp->u.tmem.buf_ptr - pa;
+                       p->u.memref.shm = shm;
+
+                       /* Check that the memref is covered by the shm object */
+                       if (p->u.memref.size) {
+                               size_t o = p->u.memref.shm_offs +
+                                          p->u.memref.size - 1;
+
+                               rc = tee_shm_get_pa(shm, o, NULL);
+                               if (rc)
+                                       return rc;
+                       }
+                       break;
+               default:
+                       return -EINVAL;
+               }
+       }
+       return 0;
+}
+
+/**
+ * optee_to_msg_param() - convert from struct tee_params to OPTEE_MSG parameters
+ * @msg_params:        OPTEE_MSG parameters
+ * @num_params:        number of elements in the parameter arrays
+ * @params:    subsystem itnernal parameter representation
+ * Returns 0 on success or <0 on failure
+ */
+int optee_to_msg_param(struct optee_msg_param *msg_params, size_t num_params,
+                      const struct tee_param *params)
+{
+       int rc;
+       size_t n;
+       phys_addr_t pa;
+
+       for (n = 0; n < num_params; n++) {
+               const struct tee_param *p = params + n;
+               struct optee_msg_param *mp = msg_params + n;
+
+               switch (p->attr) {
+               case TEE_IOCTL_PARAM_ATTR_TYPE_NONE:
+                       mp->attr = TEE_IOCTL_PARAM_ATTR_TYPE_NONE;
+                       memset(&mp->u, 0, sizeof(mp->u));
+                       break;
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
+                       mp->attr = OPTEE_MSG_ATTR_TYPE_VALUE_INPUT + p->attr -
+                                  TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT;
+                       mp->u.value.a = p->u.value.a;
+                       mp->u.value.b = p->u.value.b;
+                       mp->u.value.c = p->u.value.c;
+                       break;
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
+                       mp->attr = OPTEE_MSG_ATTR_TYPE_TMEM_INPUT +
+                                  p->attr -
+                                  TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT;
+                       mp->u.tmem.shm_ref = (unsigned long)p->u.memref.shm;
+                       mp->u.tmem.size = p->u.memref.size;
+                       if (!p->u.memref.shm) {
+                               mp->u.tmem.buf_ptr = 0;
+                               break;
+                       }
+                       rc = tee_shm_get_pa(p->u.memref.shm,
+                                           p->u.memref.shm_offs, &pa);
+                       if (rc)
+                               return rc;
+                       mp->u.tmem.buf_ptr = pa;
+                       mp->attr |= OPTEE_MSG_ATTR_CACHE_PREDEFINED <<
+                                       OPTEE_MSG_ATTR_CACHE_SHIFT;
+                       break;
+               default:
+                       return -EINVAL;
+               }
+       }
+       return 0;
+}
+
+static void optee_get_version(struct tee_device *teedev,
+                             struct tee_ioctl_version_data *vers)
+{
+       struct tee_ioctl_version_data v = {
+               .impl_id = TEE_IMPL_ID_OPTEE,
+               .impl_caps = TEE_OPTEE_CAP_TZ,
+               .gen_caps = TEE_GEN_CAP_GP,
+       };
+       *vers = v;
+}
+
+static int optee_open(struct tee_context *ctx)
+{
+       struct optee_context_data *ctxdata;
+       struct tee_device *teedev = ctx->teedev;
+       struct optee *optee = tee_get_drvdata(teedev);
+
+       ctxdata = kzalloc(sizeof(*ctxdata), GFP_KERNEL);
+       if (!ctxdata)
+               return -ENOMEM;
+
+       if (teedev == optee->supp_teedev) {
+               bool busy = true;
+
+               mutex_lock(&optee->supp.mutex);
+               if (!optee->supp.ctx) {
+                       busy = false;
+                       optee->supp.ctx = ctx;
+               }
+               mutex_unlock(&optee->supp.mutex);
+               if (busy) {
+                       kfree(ctxdata);
+                       return -EBUSY;
+               }
+       }
+
+       mutex_init(&ctxdata->mutex);
+       INIT_LIST_HEAD(&ctxdata->sess_list);
+
+       ctx->data = ctxdata;
+       return 0;
+}
+
+static void optee_release(struct tee_context *ctx)
+{
+       struct optee_context_data *ctxdata = ctx->data;
+       struct tee_device *teedev = ctx->teedev;
+       struct optee *optee = tee_get_drvdata(teedev);
+       struct tee_shm *shm;
+       struct optee_msg_arg *arg = NULL;
+       phys_addr_t parg;
+       struct optee_session *sess;
+       struct optee_session *sess_tmp;
+
+       if (!ctxdata)
+               return;
+
+       shm = tee_shm_alloc(ctx, sizeof(struct optee_msg_arg), TEE_SHM_MAPPED);
+       if (!IS_ERR(shm)) {
+               arg = tee_shm_get_va(shm, 0);
+               /*
+                * If va2pa fails for some reason, we can't call
+                * optee_close_session(), only free the memory. Secure OS
+                * will leak sessions and finally refuse more sessions, but
+                * we will at least let normal world reclaim its memory.
+                */
+               if (!IS_ERR(arg))
+                       tee_shm_va2pa(shm, arg, &parg);
+       }
+
+       list_for_each_entry_safe(sess, sess_tmp, &ctxdata->sess_list,
+                                list_node) {
+               list_del(&sess->list_node);
+               if (!IS_ERR_OR_NULL(arg)) {
+                       memset(arg, 0, sizeof(*arg));
+                       arg->cmd = OPTEE_MSG_CMD_CLOSE_SESSION;
+                       arg->session = sess->session_id;
+                       optee_do_call_with_arg(ctx, parg);
+               }
+               kfree(sess);
+       }
+       kfree(ctxdata);
+
+       if (!IS_ERR(shm))
+               tee_shm_free(shm);
+
+       ctx->data = NULL;
+
+       if (teedev == optee->supp_teedev)
+               optee_supp_release(&optee->supp);
+}
+
+static struct tee_driver_ops optee_ops = {
+       .get_version = optee_get_version,
+       .open = optee_open,
+       .release = optee_release,
+       .open_session = optee_open_session,
+       .close_session = optee_close_session,
+       .invoke_func = optee_invoke_func,
+       .cancel_req = optee_cancel_req,
+};
+
+static struct tee_desc optee_desc = {
+       .name = DRIVER_NAME "-clnt",
+       .ops = &optee_ops,
+       .owner = THIS_MODULE,
+};
+
+static struct tee_driver_ops optee_supp_ops = {
+       .get_version = optee_get_version,
+       .open = optee_open,
+       .release = optee_release,
+       .supp_recv = optee_supp_recv,
+       .supp_send = optee_supp_send,
+};
+
+static struct tee_desc optee_supp_desc = {
+       .name = DRIVER_NAME "-supp",
+       .ops = &optee_supp_ops,
+       .owner = THIS_MODULE,
+       .flags = TEE_DESC_PRIVILEGED,
+};
+
+static bool optee_msg_api_uid_is_optee_api(optee_invoke_fn *invoke_fn)
+{
+       struct arm_smccc_res res;
+
+       invoke_fn(OPTEE_SMC_CALLS_UID, 0, 0, 0, 0, 0, 0, 0, &res);
+
+       if (res.a0 == OPTEE_MSG_UID_0 && res.a1 == OPTEE_MSG_UID_1 &&
+           res.a2 == OPTEE_MSG_UID_2 && res.a3 == OPTEE_MSG_UID_3)
+               return true;
+       return false;
+}
+
+static bool optee_msg_api_revision_is_compatible(optee_invoke_fn *invoke_fn)
+{
+       union {
+               struct arm_smccc_res smccc;
+               struct optee_smc_calls_revision_result result;
+       } res;
+
+       invoke_fn(OPTEE_SMC_CALLS_REVISION, 0, 0, 0, 0, 0, 0, 0, &res.smccc);
+
+       if (res.result.major == OPTEE_MSG_REVISION_MAJOR &&
+           (int)res.result.minor >= OPTEE_MSG_REVISION_MINOR)
+               return true;
+       return false;
+}
+
+static bool optee_msg_exchange_capabilities(optee_invoke_fn *invoke_fn,
+                                           u32 *sec_caps)
+{
+       union {
+               struct arm_smccc_res smccc;
+               struct optee_smc_exchange_capabilities_result result;
+       } res;
+       u32 a1 = 0;
+
+       /*
+        * TODO This isn't enough to tell if it's UP system (from kernel
+        * point of view) or not, is_smp() returns the the information
+        * needed, but can't be called directly from here.
+        */
+       if (!IS_ENABLED(CONFIG_SMP) || nr_cpu_ids == 1)
+               a1 |= OPTEE_SMC_NSEC_CAP_UNIPROCESSOR;
+
+       invoke_fn(OPTEE_SMC_EXCHANGE_CAPABILITIES, a1, 0, 0, 0, 0, 0, 0,
+                 &res.smccc);
+
+       if (res.result.status != OPTEE_SMC_RETURN_OK)
+               return false;
+
+       *sec_caps = res.result.capabilities;
+       return true;
+}
+
+static struct tee_shm_pool *
+optee_config_shm_memremap(optee_invoke_fn *invoke_fn, void **memremaped_shm)
+{
+       union {
+               struct arm_smccc_res smccc;
+               struct optee_smc_get_shm_config_result result;
+       } res;
+       struct tee_shm_pool *pool;
+       unsigned long vaddr;
+       phys_addr_t paddr;
+       size_t size;
+       phys_addr_t begin;
+       phys_addr_t end;
+       void *va;
+       struct tee_shm_pool_mem_info priv_info;
+       struct tee_shm_pool_mem_info dmabuf_info;
+
+       invoke_fn(OPTEE_SMC_GET_SHM_CONFIG, 0, 0, 0, 0, 0, 0, 0, &res.smccc);
+       if (res.result.status != OPTEE_SMC_RETURN_OK) {
+               pr_info("shm service not available\n");
+               return ERR_PTR(-ENOENT);
+       }
+
+       if (res.result.settings != OPTEE_SMC_SHM_CACHED) {
+               pr_err("only normal cached shared memory supported\n");
+               return ERR_PTR(-EINVAL);
+       }
+
+       begin = roundup(res.result.start, PAGE_SIZE);
+       end = rounddown(res.result.start + res.result.size, PAGE_SIZE);
+       paddr = begin;
+       size = end - begin;
+
+       if (size < 2 * OPTEE_SHM_NUM_PRIV_PAGES * PAGE_SIZE) {
+               pr_err("too small shared memory area\n");
+               return ERR_PTR(-EINVAL);
+       }
+
+       va = ioremap_cache(paddr, size);
+       if (!va) {
+               pr_err("shared memory ioremap failed\n");
+               return ERR_PTR(-EINVAL);
+       }
+       vaddr = (unsigned long)va;
+
+       priv_info.vaddr = vaddr;
+       priv_info.paddr = paddr;
+       priv_info.size = OPTEE_SHM_NUM_PRIV_PAGES * PAGE_SIZE;
+       dmabuf_info.vaddr = vaddr + OPTEE_SHM_NUM_PRIV_PAGES * PAGE_SIZE;
+       dmabuf_info.paddr = paddr + OPTEE_SHM_NUM_PRIV_PAGES * PAGE_SIZE;
+       dmabuf_info.size = size - OPTEE_SHM_NUM_PRIV_PAGES * PAGE_SIZE;
+
+       pool = tee_shm_pool_alloc_res_mem(&priv_info, &dmabuf_info);
+       if (IS_ERR(pool)) {
+               iounmap(va);
+               goto out;
+       }
+
+       *memremaped_shm = va;
+out:
+       return pool;
+}
+
+/* Simple wrapper functions to be able to use a function pointer */
+static void optee_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)
+{
+       arm_smccc_smc(a0, a1, a2, a3, a4, a5, a6, a7, res);
+}
+
+static optee_invoke_fn *get_invoke_func(void)
+{
+               return optee_smccc_smc;
+
+}
+
+static int optee_probe(struct platform_device *pdev)
+{
+       optee_invoke_fn *invoke_fn;
+       struct tee_shm_pool *pool;
+       struct optee *optee = NULL;
+       void *memremaped_shm = NULL;
+       struct tee_device *teedev;
+       u32 sec_caps;
+       int rc;
+
+       invoke_fn = get_invoke_func();
+       if (IS_ERR(invoke_fn))
+               return -EINVAL;
+
+       if (!optee_msg_api_uid_is_optee_api(invoke_fn)) {
+               pr_warn("api uid mismatch\n");
+               return -EINVAL;
+       }
+
+       if (!optee_msg_api_revision_is_compatible(invoke_fn)) {
+               pr_warn("api revision mismatch\n");
+               return -EINVAL;
+       }
+
+       if (!optee_msg_exchange_capabilities(invoke_fn, &sec_caps)) {
+               pr_warn("capabilities mismatch\n");
+               return -EINVAL;
+       }
+
+       /*
+        * We have no other option for shared memory, if secure world
+        * doesn't have any reserved memory we can use we can't continue.
+        */
+       if (!(sec_caps & OPTEE_SMC_SEC_CAP_HAVE_RESERVED_SHM))
+               return -EINVAL;
+
+       pool = optee_config_shm_memremap(invoke_fn, &memremaped_shm);
+       if (IS_ERR(pool))
+               return PTR_ERR(pool);
+
+       optee = kzalloc(sizeof(*optee), GFP_KERNEL);
+       if (!optee) {
+               rc = -ENOMEM;
+               goto err;
+       }
+
+       optee->invoke_fn = invoke_fn;
+
+       teedev = tee_device_alloc(&optee_desc, NULL, pool, optee);
+       if (IS_ERR(teedev)) {
+               rc = PTR_ERR(teedev);
+               goto err;
+       }
+       optee->teedev = teedev;
+
+       teedev = tee_device_alloc(&optee_supp_desc, NULL, pool, optee);
+       if (IS_ERR(teedev)) {
+               rc = PTR_ERR(teedev);
+               goto err;
+       }
+       optee->supp_teedev = teedev;
+
+       rc = tee_device_register(optee->teedev);
+       if (rc)
+               goto err;
+
+       rc = tee_device_register(optee->supp_teedev);
+       if (rc)
+               goto err;
+
+       mutex_init(&optee->call_queue.mutex);
+       INIT_LIST_HEAD(&optee->call_queue.waiters);
+       optee_wait_queue_init(&optee->wait_queue);
+       optee_supp_init(&optee->supp);
+       optee->memremaped_shm = memremaped_shm;
+       optee->pool = pool;
+
+       platform_set_drvdata(pdev, optee);
+
+       optee_enable_shm_cache(optee);
+
+       pr_info("initialized driver\n");
+       return 0;
+err:
+       if (optee) {
+               /*
+                * tee_device_unregister() is safe to call even if the
+                * devices hasn't been registered with
+                * tee_device_register() yet.
+                */
+               tee_device_unregister(optee->supp_teedev);
+               tee_device_unregister(optee->teedev);
+               kfree(optee);
+       }
+       if (pool)
+               tee_shm_pool_free(pool);
+       if (memremaped_shm)
+               iounmap(memremaped_shm);
+       return rc;
+}
+
+static int optee_remove(struct platform_device *pdev)
+{
+       struct optee *optee = platform_get_drvdata(pdev);
+
+       /*
+        * Ask OP-TEE to free all cached shared memory objects to decrease
+        * reference counters and also avoid wild pointers in secure world
+        * into the old shared memory range.
+        */
+       optee_disable_shm_cache(optee);
+
+       /*
+        * The two devices has to be unregistered before we can free the
+        * other resources.
+        */
+       tee_device_unregister(optee->supp_teedev);
+       tee_device_unregister(optee->teedev);
+
+       tee_shm_pool_free(optee->pool);
+       if (optee->memremaped_shm)
+               iounmap(optee->memremaped_shm);
+       optee_wait_queue_exit(&optee->wait_queue);
+       optee_supp_uninit(&optee->supp);
+       mutex_destroy(&optee->call_queue.mutex);
+
+       kfree(optee);
+
+       return 0;
+}
+
+static const struct of_device_id optee_match[] = {
+       { .compatible = "linaro,optee-tz" },
+       {},
+};
+
+static struct platform_driver optee_driver = {
+       .driver = {
+               .name = DRIVER_NAME,
+               .of_match_table = optee_match,
+       },
+       .probe = optee_probe,
+       .remove = optee_remove,
+};
+
+static void platform_optee_release(struct device *dev)
+{
+       return;
+}
+
+static struct platform_device optee_device = {
+       .name = DRIVER_NAME,
+       .id = 0,
+       .dev = {
+               .release = platform_optee_release,
+       },
+};
+
+static int __init optee_driver_init(void)
+{
+       int rc = 0;
+
+       /*
+        * Preferred path is /firmware/optee, but it's the matching that
+        * matters.
+        */
+       rc = platform_device_register(&optee_device);
+       if (rc != 0) {
+               pr_err("failed to register device %s\n", optee_device.name);
+               return -EINVAL;
+       }
+
+       return platform_driver_register(&optee_driver);
+}
+module_init(optee_driver_init);
+
+static void __exit optee_driver_exit(void)
+{
+       platform_device_unregister(&optee_device);
+       platform_driver_unregister(&optee_driver);
+}
+module_exit(optee_driver_exit);
+
+MODULE_AUTHOR("Linaro");
+MODULE_DESCRIPTION("OP-TEE driver");
+MODULE_SUPPORTED_DEVICE("");
+MODULE_VERSION("1.0");
+MODULE_LICENSE("GPL v2");
diff --git a/optee/core.o b/optee/core.o
new file mode 100644 (file)
index 0000000..05a1841
Binary files /dev/null and b/optee/core.o differ
diff --git a/optee/modules.order b/optee/modules.order
new file mode 100644 (file)
index 0000000..0c403f5
--- /dev/null
@@ -0,0 +1 @@
+kernel//mnt/fileroot/lei.qian/p-amlogic/vendor/amlogic/common//tdk/linuxdriver/optee/optee_armtz.ko
diff --git a/optee/optee_armtz.ko b/optee/optee_armtz.ko
new file mode 100644 (file)
index 0000000..9c1f05c
Binary files /dev/null and b/optee/optee_armtz.ko differ
diff --git a/optee/optee_armtz.mod.c b/optee/optee_armtz.mod.c
new file mode 100644 (file)
index 0000000..f45b42f
--- /dev/null
@@ -0,0 +1,81 @@
+#include <linux/module.h>
+#include <linux/vermagic.h>
+#include <linux/compiler.h>
+
+MODULE_INFO(vermagic, VERMAGIC_STRING);
+
+__visible struct module __this_module
+__attribute__((section(".gnu.linkonce.this_module"))) = {
+       .name = KBUILD_MODNAME,
+       .init = init_module,
+#ifdef CONFIG_MODULE_UNLOAD
+       .exit = cleanup_module,
+#endif
+       .arch = MODULE_ARCH_INIT,
+};
+
+#ifdef RETPOLINE
+MODULE_INFO(retpoline, "Y");
+#endif
+
+static const struct modversion_info ____versions[]
+__used
+__attribute__((section("__versions"))) = {
+       { 0x4730f430, __VMLINUX_SYMBOL_STR(module_layout) },
+       { 0xf644c769, __VMLINUX_SYMBOL_STR(kmalloc_caches) },
+       { 0xd2b09ce5, __VMLINUX_SYMBOL_STR(__kmalloc) },
+       { 0xf9a482f9, __VMLINUX_SYMBOL_STR(msleep) },
+       { 0x1fdc7df2, __VMLINUX_SYMBOL_STR(_mcount) },
+       { 0x7cbb7be8, __VMLINUX_SYMBOL_STR(tee_device_unregister) },
+       { 0x9529f94, __VMLINUX_SYMBOL_STR(tee_device_alloc) },
+       { 0x89eb90b8, __VMLINUX_SYMBOL_STR(tee_shm_free) },
+       { 0xb7b8bb11, __VMLINUX_SYMBOL_STR(mutex_unlock) },
+       { 0xd10caa2, __VMLINUX_SYMBOL_STR(tee_shm_va2pa) },
+       { 0xc0900e65, __VMLINUX_SYMBOL_STR(__platform_driver_register) },
+       { 0x2464be37, __VMLINUX_SYMBOL_STR(tee_device_register) },
+       { 0xab40cca9, __VMLINUX_SYMBOL_STR(__init_waitqueue_head) },
+       { 0xfe7c4287, __VMLINUX_SYMBOL_STR(nr_cpu_ids) },
+       { 0xf9dde891, __VMLINUX_SYMBOL_STR(wait_for_completion) },
+       { 0x64dd992e, __VMLINUX_SYMBOL_STR(tee_shm_get_pa) },
+       { 0xdcb764ad, __VMLINUX_SYMBOL_STR(memset) },
+       { 0x20906cd5, __VMLINUX_SYMBOL_STR(idr_destroy) },
+       { 0x27ae16cc, __VMLINUX_SYMBOL_STR(__mutex_init) },
+       { 0x27e1a049, __VMLINUX_SYMBOL_STR(printk) },
+       { 0xde434656, __VMLINUX_SYMBOL_STR(wait_for_completion_interruptible) },
+       { 0x778bff44, __VMLINUX_SYMBOL_STR(mutex_lock) },
+       { 0x22f27664, __VMLINUX_SYMBOL_STR(platform_device_unregister) },
+       { 0xa850dafc, __VMLINUX_SYMBOL_STR(idr_alloc) },
+       { 0xb84e3e9c, __VMLINUX_SYMBOL_STR(tee_shm_alloc) },
+       { 0x475dd1fb, __VMLINUX_SYMBOL_STR(tee_shm_get_from_id) },
+       { 0x453da992, __VMLINUX_SYMBOL_STR(tee_shm_pool_alloc_res_mem) },
+       { 0xb4fc735b, __VMLINUX_SYMBOL_STR(idr_remove) },
+       { 0xf93aae46, __VMLINUX_SYMBOL_STR(__arm_smccc_smc) },
+       { 0xaacc3134, __VMLINUX_SYMBOL_STR(idr_find_slowpath) },
+       { 0x6f26cb7b, __VMLINUX_SYMBOL_STR(idr_get_next) },
+       { 0xfaa3b724, __VMLINUX_SYMBOL_STR(platform_device_register) },
+       { 0x3a1ee744, __VMLINUX_SYMBOL_STR(tee_get_drvdata) },
+       { 0x3b16fec1, __VMLINUX_SYMBOL_STR(tee_shm_get_id) },
+       { 0xdb7305a1, __VMLINUX_SYMBOL_STR(__stack_chk_fail) },
+       { 0x211f68f1, __VMLINUX_SYMBOL_STR(getnstimeofday64) },
+       { 0x8008793c, __VMLINUX_SYMBOL_STR(kmem_cache_alloc_trace) },
+       { 0xb825500a, __VMLINUX_SYMBOL_STR(tee_shm_pool_free) },
+       { 0x4c5a9474, __VMLINUX_SYMBOL_STR(tee_shm_get_va) },
+       { 0x37a0cba, __VMLINUX_SYMBOL_STR(kfree) },
+       { 0x5980900a, __VMLINUX_SYMBOL_STR(tee_shm_put) },
+       { 0x4829a47e, __VMLINUX_SYMBOL_STR(memcpy) },
+       { 0xd4e7aa3d, __VMLINUX_SYMBOL_STR(ioremap_cache) },
+       { 0x45a55ec8, __VMLINUX_SYMBOL_STR(__iounmap) },
+       { 0x8f678b07, __VMLINUX_SYMBOL_STR(__stack_chk_guard) },
+       { 0xbdbc13a1, __VMLINUX_SYMBOL_STR(complete) },
+       { 0x96a38304, __VMLINUX_SYMBOL_STR(platform_driver_unregister) },
+       { 0x6f5ec7ec, __VMLINUX_SYMBOL_STR(idr_init) },
+       { 0xceb1717d, __VMLINUX_SYMBOL_STR(completion_done) },
+};
+
+static const char __module_depends[]
+__used
+__attribute__((section(".modinfo"))) =
+"depends=optee";
+
+
+MODULE_INFO(srcversion, "FC68E7B849330AEB4CF1DB6");
diff --git a/optee/optee_armtz.mod.o b/optee/optee_armtz.mod.o
new file mode 100644 (file)
index 0000000..eef8d2c
Binary files /dev/null and b/optee/optee_armtz.mod.o differ
diff --git a/optee/optee_armtz.o b/optee/optee_armtz.o
new file mode 100644 (file)
index 0000000..9aa5b7e
Binary files /dev/null and b/optee/optee_armtz.o differ
diff --git a/optee/optee_msg.h b/optee/optee_msg.h
new file mode 100755 (executable)
index 0000000..dd7a06e
--- /dev/null
@@ -0,0 +1,418 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef _OPTEE_MSG_H
+#define _OPTEE_MSG_H
+
+#include <linux/bitops.h>
+#include <linux/types.h>
+
+/*
+ * This file defines the OP-TEE message protocol used to communicate
+ * with an instance of OP-TEE running in secure world.
+ *
+ * This file is divided into three sections.
+ * 1. Formatting of messages.
+ * 2. Requests from normal world
+ * 3. Requests from secure world, Remote Procedure Call (RPC), handled by
+ *    tee-supplicant.
+ */
+
+/*****************************************************************************
+ * Part 1 - formatting of messages
+ *****************************************************************************/
+
+#define OPTEE_MSG_ATTR_TYPE_NONE               0x0
+#define OPTEE_MSG_ATTR_TYPE_VALUE_INPUT                0x1
+#define OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT       0x2
+#define OPTEE_MSG_ATTR_TYPE_VALUE_INOUT                0x3
+#define OPTEE_MSG_ATTR_TYPE_RMEM_INPUT         0x5
+#define OPTEE_MSG_ATTR_TYPE_RMEM_OUTPUT                0x6
+#define OPTEE_MSG_ATTR_TYPE_RMEM_INOUT         0x7
+#define OPTEE_MSG_ATTR_TYPE_TMEM_INPUT         0x9
+#define OPTEE_MSG_ATTR_TYPE_TMEM_OUTPUT                0xa
+#define OPTEE_MSG_ATTR_TYPE_TMEM_INOUT         0xb
+
+#define OPTEE_MSG_ATTR_TYPE_MASK               GENMASK(7, 0)
+
+/*
+ * Meta parameter to be absorbed by the Secure OS and not passed
+ * to the Trusted Application.
+ *
+ * Currently only used with OPTEE_MSG_CMD_OPEN_SESSION.
+ */
+#define OPTEE_MSG_ATTR_META                    BIT(8)
+
+/*
+ * The temporary shared memory object is not physically contigous and this
+ * temp memref is followed by another fragment until the last temp memref
+ * that doesn't have this bit set.
+ */
+#define OPTEE_MSG_ATTR_FRAGMENT                        BIT(9)
+
+/*
+ * Memory attributes for caching passed with temp memrefs. The actual value
+ * used is defined outside the message protocol with the exception of
+ * OPTEE_MSG_ATTR_CACHE_PREDEFINED which means the attributes already
+ * defined for the memory range should be used. If optee_smc.h is used as
+ * bearer of this protocol OPTEE_SMC_SHM_* is used for values.
+ */
+#define OPTEE_MSG_ATTR_CACHE_SHIFT             16
+#define OPTEE_MSG_ATTR_CACHE_MASK              GENMASK(2, 0)
+#define OPTEE_MSG_ATTR_CACHE_PREDEFINED                0
+
+/*
+ * Same values as TEE_LOGIN_* from TEE Internal API
+ */
+#define OPTEE_MSG_LOGIN_PUBLIC                 0x00000000
+#define OPTEE_MSG_LOGIN_USER                   0x00000001
+#define OPTEE_MSG_LOGIN_GROUP                  0x00000002
+#define OPTEE_MSG_LOGIN_APPLICATION            0x00000004
+#define OPTEE_MSG_LOGIN_APPLICATION_USER       0x00000005
+#define OPTEE_MSG_LOGIN_APPLICATION_GROUP      0x00000006
+
+/**
+ * struct optee_msg_param_tmem - temporary memory reference parameter
+ * @buf_ptr:   Address of the buffer
+ * @size:      Size of the buffer
+ * @shm_ref:   Temporary shared memory reference, pointer to a struct tee_shm
+ *
+ * Secure and normal world communicates pointers as physical address
+ * instead of the virtual address. This is because secure and normal world
+ * have completely independent memory mapping. Normal world can even have a
+ * hypervisor which need to translate the guest physical address (AKA IPA
+ * in ARM documentation) to a real physical address before passing the
+ * structure to secure world.
+ */
+struct optee_msg_param_tmem {
+       u64 buf_ptr;
+       u64 size;
+       u64 shm_ref;
+};
+
+/**
+ * struct optee_msg_param_rmem - registered memory reference parameter
+ * @offs:      Offset into shared memory reference
+ * @size:      Size of the buffer
+ * @shm_ref:   Shared memory reference, pointer to a struct tee_shm
+ */
+struct optee_msg_param_rmem {
+       u64 offs;
+       u64 size;
+       u64 shm_ref;
+};
+
+/**
+ * struct optee_msg_param_value - opaque value parameter
+ *
+ * Value parameters are passed unchecked between normal and secure world.
+ */
+struct optee_msg_param_value {
+       u64 a;
+       u64 b;
+       u64 c;
+};
+
+/**
+ * struct optee_msg_param - parameter used together with struct optee_msg_arg
+ * @attr:      attributes
+ * @tmem:      parameter by temporary memory reference
+ * @rmem:      parameter by registered memory reference
+ * @value:     parameter by opaque value
+ *
+ * @attr & OPTEE_MSG_ATTR_TYPE_MASK indicates if tmem, rmem or value is used in
+ * the union. OPTEE_MSG_ATTR_TYPE_VALUE_* indicates value,
+ * OPTEE_MSG_ATTR_TYPE_TMEM_* indicates tmem and
+ * OPTEE_MSG_ATTR_TYPE_RMEM_* indicates rmem.
+ * OPTEE_MSG_ATTR_TYPE_NONE indicates that none of the members are used.
+ */
+struct optee_msg_param {
+       u64 attr;
+       union {
+               struct optee_msg_param_tmem tmem;
+               struct optee_msg_param_rmem rmem;
+               struct optee_msg_param_value value;
+       } u;
+};
+
+/**
+ * struct optee_msg_arg - call argument
+ * @cmd: Command, one of OPTEE_MSG_CMD_* or OPTEE_MSG_RPC_CMD_*
+ * @func: Trusted Application function, specific to the Trusted Application,
+ *          used if cmd == OPTEE_MSG_CMD_INVOKE_COMMAND
+ * @session: In parameter for all OPTEE_MSG_CMD_* except
+ *          OPTEE_MSG_CMD_OPEN_SESSION where it's an output parameter instead
+ * @cancel_id: Cancellation id, a unique value to identify this request
+ * @ret: return value
+ * @ret_origin: origin of the return value
+ * @num_params: number of parameters supplied to the OS Command
+ * @params: the parameters supplied to the OS Command
+ *
+ * All normal calls to Trusted OS uses this struct. If cmd requires further
+ * information than what these field holds it can be passed as a parameter
+ * tagged as meta (setting the OPTEE_MSG_ATTR_META bit in corresponding
+ * attrs field). All parameters tagged as meta has to come first.
+ *
+ * Temp memref parameters can be fragmented if supported by the Trusted OS
+ * (when optee_smc.h is bearer of this protocol this is indicated with
+ * OPTEE_SMC_SEC_CAP_UNREGISTERED_SHM). If a logical memref parameter is
+ * fragmented then has all but the last fragment the
+ * OPTEE_MSG_ATTR_FRAGMENT bit set in attrs. Even if a memref is fragmented
+ * it will still be presented as a single logical memref to the Trusted
+ * Application.
+ */
+struct optee_msg_arg {
+       u32 cmd;
+       u32 func;
+       u32 session;
+       u32 cancel_id;
+       u32 pad;
+       u32 ret;
+       u32 ret_origin;
+       u32 num_params;
+
+       /* num_params tells the actual number of element in params */
+       struct optee_msg_param params[0];
+};
+
+/**
+ * OPTEE_MSG_GET_ARG_SIZE - return size of struct optee_msg_arg
+ *
+ * @num_params: Number of parameters embedded in the struct optee_msg_arg
+ *
+ * Returns the size of the struct optee_msg_arg together with the number
+ * of embedded parameters.
+ */
+#define OPTEE_MSG_GET_ARG_SIZE(num_params) \
+       (sizeof(struct optee_msg_arg) + \
+        sizeof(struct optee_msg_param) * (num_params))
+
+/*****************************************************************************
+ * Part 2 - requests from normal world
+ *****************************************************************************/
+
+/*
+ * Return the following UID if using API specified in this file without
+ * further extensions:
+ * 384fb3e0-e7f8-11e3-af63-0002a5d5c51b.
+ * Represented in 4 32-bit words in OPTEE_MSG_UID_0, OPTEE_MSG_UID_1,
+ * OPTEE_MSG_UID_2, OPTEE_MSG_UID_3.
+ */
+#define OPTEE_MSG_UID_0                        0x384fb3e0
+#define OPTEE_MSG_UID_1                        0xe7f811e3
+#define OPTEE_MSG_UID_2                        0xaf630002
+#define OPTEE_MSG_UID_3                        0xa5d5c51b
+#define OPTEE_MSG_FUNCID_CALLS_UID     0xFF01
+
+/*
+ * Returns 2.0 if using API specified in this file without further
+ * extensions. Represented in 2 32-bit words in OPTEE_MSG_REVISION_MAJOR
+ * and OPTEE_MSG_REVISION_MINOR
+ */
+#define OPTEE_MSG_REVISION_MAJOR       2
+#define OPTEE_MSG_REVISION_MINOR       0
+#define OPTEE_MSG_FUNCID_CALLS_REVISION        0xFF03
+
+/*
+ * Get UUID of Trusted OS.
+ *
+ * Used by non-secure world to figure out which Trusted OS is installed.
+ * Note that returned UUID is the UUID of the Trusted OS, not of the API.
+ *
+ * Returns UUID in 4 32-bit words in the same way as
+ * OPTEE_MSG_FUNCID_CALLS_UID described above.
+ */
+#define OPTEE_MSG_OS_OPTEE_UUID_0      0x486178e0
+#define OPTEE_MSG_OS_OPTEE_UUID_1      0xe7f811e3
+#define OPTEE_MSG_OS_OPTEE_UUID_2      0xbc5e0002
+#define OPTEE_MSG_OS_OPTEE_UUID_3      0xa5d5c51b
+#define OPTEE_MSG_FUNCID_GET_OS_UUID   0x0000
+
+/*
+ * Get revision of Trusted OS.
+ *
+ * Used by non-secure world to figure out which version of the Trusted OS
+ * is installed. Note that the returned revision is the revision of the
+ * Trusted OS, not of the API.
+ *
+ * Returns revision in 2 32-bit words in the same way as
+ * OPTEE_MSG_CALLS_REVISION described above.
+ */
+#define OPTEE_MSG_FUNCID_GET_OS_REVISION       0x0001
+
+/*
+ * Do a secure call with struct optee_msg_arg as argument
+ * The OPTEE_MSG_CMD_* below defines what goes in struct optee_msg_arg::cmd
+ *
+ * OPTEE_MSG_CMD_OPEN_SESSION opens a session to a Trusted Application.
+ * The first two parameters are tagged as meta, holding two value
+ * parameters to pass the following information:
+ * param[0].u.value.a-b uuid of Trusted Application
+ * param[1].u.value.a-b uuid of Client
+ * param[1].u.value.c Login class of client OPTEE_MSG_LOGIN_*
+ *
+ * OPTEE_MSG_CMD_INVOKE_COMMAND invokes a command a previously opened
+ * session to a Trusted Application.  struct optee_msg_arg::func is Trusted
+ * Application function, specific to the Trusted Application.
+ *
+ * OPTEE_MSG_CMD_CLOSE_SESSION closes a previously opened session to
+ * Trusted Application.
+ *
+ * OPTEE_MSG_CMD_CANCEL cancels a currently invoked command.
+ *
+ * OPTEE_MSG_CMD_REGISTER_SHM registers a shared memory reference. The
+ * information is passed as:
+ * [in] param[0].attr                  OPTEE_MSG_ATTR_TYPE_TMEM_INPUT
+ *                                     [| OPTEE_MSG_ATTR_FRAGMENT]
+ * [in] param[0].u.tmem.buf_ptr                physical address (of first fragment)
+ * [in] param[0].u.tmem.size           size (of first fragment)
+ * [in] param[0].u.tmem.shm_ref                holds shared memory reference
+ * ...
+ * The shared memory can optionally be fragmented, temp memrefs can follow
+ * each other with all but the last with the OPTEE_MSG_ATTR_FRAGMENT bit set.
+ *
+ * OPTEE_MSG_CMD_UNREGISTER_SHM unregisteres a previously registered shared
+ * memory reference. The information is passed as:
+ * [in] param[0].attr                  OPTEE_MSG_ATTR_TYPE_RMEM_INPUT
+ * [in] param[0].u.rmem.shm_ref                holds shared memory reference
+ * [in] param[0].u.rmem.offs           0
+ * [in] param[0].u.rmem.size           0
+ */
+#define OPTEE_MSG_CMD_OPEN_SESSION     0
+#define OPTEE_MSG_CMD_INVOKE_COMMAND   1
+#define OPTEE_MSG_CMD_CLOSE_SESSION    2
+#define OPTEE_MSG_CMD_CANCEL           3
+#define OPTEE_MSG_CMD_REGISTER_SHM     4
+#define OPTEE_MSG_CMD_UNREGISTER_SHM   5
+#define OPTEE_MSG_FUNCID_CALL_WITH_ARG 0x0004
+
+/*****************************************************************************
+ * Part 3 - Requests from secure world, RPC
+ *****************************************************************************/
+
+/*
+ * All RPC is done with a struct optee_msg_arg as bearer of information,
+ * struct optee_msg_arg::arg holds values defined by OPTEE_MSG_RPC_CMD_* below
+ *
+ * RPC communication with tee-supplicant is reversed compared to normal
+ * client communication desribed above. The supplicant receives requests
+ * and sends responses.
+ */
+
+/*
+ * Load a TA into memory, defined in tee-supplicant
+ */
+#define OPTEE_MSG_RPC_CMD_LOAD_TA      0
+
+/*
+ * Reserved
+ */
+#define OPTEE_MSG_RPC_CMD_RPMB         1
+
+/*
+ * File system access, defined in tee-supplicant
+ */
+#define OPTEE_MSG_RPC_CMD_FS           2
+
+/*
+ * Get time
+ *
+ * Returns number of seconds and nano seconds since the Epoch,
+ * 1970-01-01 00:00:00 +0000 (UTC).
+ *
+ * [out] param[0].u.value.a    Number of seconds
+ * [out] param[0].u.value.b    Number of nano seconds.
+ */
+#define OPTEE_MSG_RPC_CMD_GET_TIME     3
+
+/*
+ * Wait queue primitive, helper for secure world to implement a wait queue.
+ *
+ * If secure world need to wait for a secure world mutex it issues a sleep
+ * request instead of spinning in secure world. Conversely is a wakeup
+ * request issued when a secure world mutex with a thread waiting thread is
+ * unlocked.
+ *
+ * Waiting on a key
+ * [in] param[0].u.value.a OPTEE_MSG_RPC_WAIT_QUEUE_SLEEP
+ * [in] param[0].u.value.b wait key
+ *
+ * Waking up a key
+ * [in] param[0].u.value.a OPTEE_MSG_RPC_WAIT_QUEUE_WAKEUP
+ * [in] param[0].u.value.b wakeup key
+ */
+#define OPTEE_MSG_RPC_CMD_WAIT_QUEUE   4
+#define OPTEE_MSG_RPC_WAIT_QUEUE_SLEEP 0
+#define OPTEE_MSG_RPC_WAIT_QUEUE_WAKEUP        1
+
+/*
+ * Suspend execution
+ *
+ * [in] param[0].value .a number of milliseconds to suspend
+ */
+#define OPTEE_MSG_RPC_CMD_SUSPEND      5
+
+/*
+ * Allocate a piece of shared memory
+ *
+ * Shared memory can optionally be fragmented, to support that additional
+ * spare param entries are allocated to make room for eventual fragments.
+ * The spare param entries has .attr = OPTEE_MSG_ATTR_TYPE_NONE when
+ * unused. All returned temp memrefs except the last should have the
+ * OPTEE_MSG_ATTR_FRAGMENT bit set in the attr field.
+ *
+ * [in]  param[0].u.value.a            type of memory one of
+ *                                     OPTEE_MSG_RPC_SHM_TYPE_* below
+ * [in]  param[0].u.value.b            requested size
+ * [in]  param[0].u.value.c            required alignment
+ *
+ * [out] param[0].u.tmem.buf_ptr       physical address (of first fragment)
+ * [out] param[0].u.tmem.size          size (of first fragment)
+ * [out] param[0].u.tmem.shm_ref       shared memory reference
+ * ...
+ * [out] param[n].u.tmem.buf_ptr       physical address
+ * [out] param[n].u.tmem.size          size
+ * [out] param[n].u.tmem.shm_ref       shared memory reference (same value
+ *                                     as in param[n-1].u.tmem.shm_ref)
+ */
+#define OPTEE_MSG_RPC_CMD_SHM_ALLOC    6
+/* Memory that can be shared with a non-secure user space application */
+#define OPTEE_MSG_RPC_SHM_TYPE_APPL    0
+/* Memory only shared with non-secure kernel */
+#define OPTEE_MSG_RPC_SHM_TYPE_KERNEL  1
+
+/*
+ * Free shared memory previously allocated with OPTEE_MSG_RPC_CMD_SHM_ALLOC
+ *
+ * [in]  param[0].u.value.a            type of memory one of
+ *                                     OPTEE_MSG_RPC_SHM_TYPE_* above
+ * [in]  param[0].u.value.b            value of shared memory reference
+ *                                     returned in param[0].u.tmem.shm_ref
+ *                                     above
+ */
+#define OPTEE_MSG_RPC_CMD_SHM_FREE     7
+
+#endif /* _OPTEE_MSG_H */
diff --git a/optee/optee_private.h b/optee/optee_private.h
new file mode 100755 (executable)
index 0000000..cc5e0b5
--- /dev/null
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2015, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+
+#ifndef OPTEE_PRIVATE_H
+#define OPTEE_PRIVATE_H
+
+#include <linux/arm-smccc.h>
+#include <linux/semaphore.h>
+#include <linux/types.h>
+#include "tee_drv.h"
+#include "optee_msg.h"
+
+#define OPTEE_MAX_ARG_SIZE     1024
+
+/* Some Global Platform error codes used in this driver */
+#define TEEC_SUCCESS                   0x00000000
+#define TEEC_ERROR_BAD_PARAMETERS      0xFFFF0006
+#define TEEC_ERROR_COMMUNICATION       0xFFFF000E
+#define TEEC_ERROR_OUT_OF_MEMORY       0xFFFF000C
+
+#define TEEC_ORIGIN_COMMS              0x00000002
+
+typedef void (optee_invoke_fn)(unsigned long, unsigned long, unsigned long,
+                               unsigned long, unsigned long, unsigned long,
+                               unsigned long, unsigned long,
+                               struct arm_smccc_res *);
+
+struct optee_call_queue {
+       /* Serializes access to this struct */
+       struct mutex mutex;
+       struct list_head waiters;
+};
+
+struct optee_wait_queue {
+       /* Serializes access to this struct */
+       struct mutex mu;
+       struct list_head db;
+};
+
+/**
+ * struct optee_supp - supplicant synchronization struct
+ * @ctx                        the context of current connected supplicant.
+ *                     if !NULL the supplicant device is available for use,
+ *                     else busy
+ * @mutex:             held while accessing content of this struct
+ * @req_id:            current request id if supplicant is doing synchronous
+ *                     communication, else -1
+ * @reqs:              queued request not yet retrieved by supplicant
+ * @idr:               IDR holding all requests currently being processed
+ *                     by supplicant
+ * @reqs_c:            completion used by supplicant when waiting for a
+ *                     request to be queued.
+ */
+struct optee_supp {
+       /* Serializes access to this struct */
+       struct mutex mutex;
+       struct tee_context *ctx;
+
+       int req_id;
+       struct list_head reqs;
+       struct idr idr;
+       struct completion reqs_c;
+};
+
+/**
+ * struct optee - main service struct
+ * @supp_teedev:       supplicant device
+ * @teedev:            client device
+ * @invoke_fn:         function to issue smc or hvc
+ * @call_queue:                queue of threads waiting to call @invoke_fn
+ * @wait_queue:                queue of threads from secure world waiting for a
+ *                     secure world sync object
+ * @supp:              supplicant synchronization struct for RPC to supplicant
+ * @pool:              shared memory pool
+ * @memremaped_shm     virtual address of memory in shared memory pool
+ */
+struct optee {
+       struct tee_device *supp_teedev;
+       struct tee_device *teedev;
+       optee_invoke_fn *invoke_fn;
+       struct optee_call_queue call_queue;
+       struct optee_wait_queue wait_queue;
+       struct optee_supp supp;
+       struct tee_shm_pool *pool;
+       void *memremaped_shm;
+};
+
+struct optee_session {
+       struct list_head list_node;
+       u32 session_id;
+};
+
+struct optee_context_data {
+       /* Serializes access to this struct */
+       struct mutex mutex;
+       struct list_head sess_list;
+};
+
+struct optee_rpc_param {
+       u32     a0;
+       u32     a1;
+       u32     a2;
+       u32     a3;
+       u32     a4;
+       u32     a5;
+       u32     a6;
+       u32     a7;
+};
+
+void optee_handle_rpc(struct tee_context *ctx, struct optee_rpc_param *param);
+
+void optee_wait_queue_init(struct optee_wait_queue *wq);
+void optee_wait_queue_exit(struct optee_wait_queue *wq);
+
+u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params,
+                       struct tee_param *param);
+
+int optee_supp_read(struct tee_context *ctx, void __user *buf, size_t len);
+int optee_supp_write(struct tee_context *ctx, void __user *buf, size_t len);
+void optee_supp_init(struct optee_supp *supp);
+void optee_supp_uninit(struct optee_supp *supp);
+void optee_supp_release(struct optee_supp *supp);
+
+int optee_supp_recv(struct tee_context *ctx, u32 *func, u32 *num_params,
+                   struct tee_param *param);
+int optee_supp_send(struct tee_context *ctx, u32 ret, u32 num_params,
+                   struct tee_param *param);
+
+u32 optee_do_call_with_arg(struct tee_context *ctx, phys_addr_t parg);
+int optee_open_session(struct tee_context *ctx,
+                      struct tee_ioctl_open_session_arg *arg,
+                      struct tee_param *param);
+int optee_close_session(struct tee_context *ctx, u32 session);
+int optee_invoke_func(struct tee_context *ctx, struct tee_ioctl_invoke_arg *arg,
+                     struct tee_param *param);
+int optee_cancel_req(struct tee_context *ctx, u32 cancel_id, u32 session);
+
+void optee_enable_shm_cache(struct optee *optee);
+void optee_disable_shm_cache(struct optee *optee);
+
+int optee_from_msg_param(struct tee_param *params, size_t num_params,
+                        const struct optee_msg_param *msg_params);
+int optee_to_msg_param(struct optee_msg_param *msg_params, size_t num_params,
+                      const struct tee_param *params);
+
+/*
+ * Small helpers
+ */
+
+static inline void *reg_pair_to_ptr(u32 reg0, u32 reg1)
+{
+       return (void *)(unsigned long)(((u64)reg0 << 32) | reg1);
+}
+
+static inline void reg_pair_from_64(u32 *reg0, u32 *reg1, u64 val)
+{
+       *reg0 = val >> 32;
+       *reg1 = val;
+}
+
+#endif /*OPTEE_PRIVATE_H*/
diff --git a/optee/optee_smc.h b/optee/optee_smc.h
new file mode 100755 (executable)
index 0000000..13b7c98
--- /dev/null
@@ -0,0 +1,450 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef OPTEE_SMC_H
+#define OPTEE_SMC_H
+
+#include <linux/arm-smccc.h>
+#include <linux/bitops.h>
+
+#define OPTEE_SMC_STD_CALL_VAL(func_num) \
+       ARM_SMCCC_CALL_VAL(ARM_SMCCC_STD_CALL, ARM_SMCCC_SMC_32, \
+                          ARM_SMCCC_OWNER_TRUSTED_OS, (func_num))
+#define OPTEE_SMC_FAST_CALL_VAL(func_num) \
+       ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_32, \
+                          ARM_SMCCC_OWNER_TRUSTED_OS, (func_num))
+
+/*
+ * Function specified by SMC Calling convention.
+ */
+#define OPTEE_SMC_FUNCID_CALLS_COUNT   0xFF00
+#define OPTEE_SMC_CALLS_COUNT \
+       ARM_SMCCC_CALL_VAL(OPTEE_SMC_FAST_CALL, SMCCC_SMC_32, \
+                          SMCCC_OWNER_TRUSTED_OS_END, \
+                          OPTEE_SMC_FUNCID_CALLS_COUNT)
+
+/*
+ * Normal cached memory (write-back), shareable for SMP systems and not
+ * shareable for UP systems.
+ */
+#define OPTEE_SMC_SHM_CACHED           1
+
+/*
+ * a0..a7 is used as register names in the descriptions below, on arm32
+ * that translates to r0..r7 and on arm64 to w0..w7. In both cases it's
+ * 32-bit registers.
+ */
+
+/*
+ * Function specified by SMC Calling convention
+ *
+ * Return one of the following UIDs if using API specified in this file
+ * without further extentions:
+ * 65cb6b93-af0c-4617-8ed6-644a8d1140f8
+ * see also OPTEE_SMC_UID_* in optee_msg.h
+ */
+#define OPTEE_SMC_FUNCID_CALLS_UID OPTEE_MSG_FUNCID_CALLS_UID
+#define OPTEE_SMC_CALLS_UID \
+       ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_32, \
+                          ARM_SMCCC_OWNER_TRUSTED_OS_END, \
+                          OPTEE_SMC_FUNCID_CALLS_UID)
+
+/*
+ * Function specified by SMC Calling convention
+ *
+ * Returns 2.0 if using API specified in this file without further extentions.
+ * see also OPTEE_MSG_REVISION_* in optee_msg.h
+ */
+#define OPTEE_SMC_FUNCID_CALLS_REVISION OPTEE_MSG_FUNCID_CALLS_REVISION
+#define OPTEE_SMC_CALLS_REVISION \
+       ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, ARM_SMCCC_SMC_32, \
+                          ARM_SMCCC_OWNER_TRUSTED_OS_END, \
+                          OPTEE_SMC_FUNCID_CALLS_REVISION)
+
+struct optee_smc_calls_revision_result {
+       unsigned long major;
+       unsigned long minor;
+       unsigned long reserved0;
+       unsigned long reserved1;
+};
+
+/*
+ * Get UUID of Trusted OS.
+ *
+ * Used by non-secure world to figure out which Trusted OS is installed.
+ * Note that returned UUID is the UUID of the Trusted OS, not of the API.
+ *
+ * Returns UUID in a0-4 in the same way as OPTEE_SMC_CALLS_UID
+ * described above.
+ */
+#define OPTEE_SMC_FUNCID_GET_OS_UUID OPTEE_MSG_FUNCID_GET_OS_UUID
+#define OPTEE_SMC_CALL_GET_OS_UUID \
+       OPTEE_SMC_FAST_CALL_VAL(OPTEE_SMC_FUNCID_GET_OS_UUID)
+
+/*
+ * Get revision of Trusted OS.
+ *
+ * Used by non-secure world to figure out which version of the Trusted OS
+ * is installed. Note that the returned revision is the revision of the
+ * Trusted OS, not of the API.
+ *
+ * Returns revision in a0-1 in the same way as OPTEE_SMC_CALLS_REVISION
+ * described above.
+ */
+#define OPTEE_SMC_FUNCID_GET_OS_REVISION OPTEE_MSG_FUNCID_GET_OS_REVISION
+#define OPTEE_SMC_CALL_GET_OS_REVISION \
+       OPTEE_SMC_FAST_CALL_VAL(OPTEE_SMC_FUNCID_GET_OS_REVISION)
+
+/*
+ * Call with struct optee_msg_arg as argument
+ *
+ * Call register usage:
+ * a0  SMC Function ID, OPTEE_SMC*CALL_WITH_ARG
+ * a1  Upper 32bit of a 64bit physical pointer to a struct optee_msg_arg
+ * a2  Lower 32bit of a 64bit physical pointer to a struct optee_msg_arg
+ * a3  Cache settings, not used if physical pointer is in a predefined shared
+ *     memory area else per OPTEE_SMC_SHM_*
+ * a4-6        Not used
+ * a7  Hypervisor Client ID register
+ *
+ * Normal return register usage:
+ * a0  Return value, OPTEE_SMC_RETURN_*
+ * a1-3        Not used
+ * a4-7        Preserved
+ *
+ * OPTEE_SMC_RETURN_ETHREAD_LIMIT return register usage:
+ * a0  Return value, OPTEE_SMC_RETURN_ETHREAD_LIMIT
+ * a1-3        Preserved
+ * a4-7        Preserved
+ *
+ * RPC return register usage:
+ * a0  Return value, OPTEE_SMC_RETURN_IS_RPC(val)
+ * a1-2        RPC parameters
+ * a3-7        Resume information, must be preserved
+ *
+ * Possible return values:
+ * OPTEE_SMC_RETURN_UNKNOWN_FUNCTION   Trusted OS does not recognize this
+ *                                     function.
+ * OPTEE_SMC_RETURN_OK                 Call completed, result updated in
+ *                                     the previously supplied struct
+ *                                     optee_msg_arg.
+ * OPTEE_SMC_RETURN_ETHREAD_LIMIT      Number of Trusted OS threads exceeded,
+ *                                     try again later.
+ * OPTEE_SMC_RETURN_EBADADDR           Bad physcial pointer to struct
+ *                                     optee_msg_arg.
+ * OPTEE_SMC_RETURN_EBADCMD            Bad/unknown cmd in struct optee_msg_arg
+ * OPTEE_SMC_RETURN_IS_RPC()           Call suspended by RPC call to normal
+ *                                     world.
+ */
+#define OPTEE_SMC_FUNCID_CALL_WITH_ARG OPTEE_MSG_FUNCID_CALL_WITH_ARG
+#define OPTEE_SMC_CALL_WITH_ARG \
+       OPTEE_SMC_STD_CALL_VAL(OPTEE_SMC_FUNCID_CALL_WITH_ARG)
+
+/*
+ * Get Shared Memory Config
+ *
+ * Returns the Secure/Non-secure shared memory config.
+ *
+ * Call register usage:
+ * a0  SMC Function ID, OPTEE_SMC_GET_SHM_CONFIG
+ * a1-6        Not used
+ * a7  Hypervisor Client ID register
+ *
+ * Have config return register usage:
+ * a0  OPTEE_SMC_RETURN_OK
+ * a1  Physical address of start of SHM
+ * a2  Size of of SHM
+ * a3  Cache settings of memory, as defined by the
+ *     OPTEE_SMC_SHM_* values above
+ * a4-7        Preserved
+ *
+ * Not available register usage:
+ * a0  OPTEE_SMC_RETURN_ENOTAVAIL
+ * a1-3 Not used
+ * a4-7        Preserved
+ */
+#define OPTEE_SMC_FUNCID_GET_SHM_CONFIG        7
+#define OPTEE_SMC_GET_SHM_CONFIG \
+       OPTEE_SMC_FAST_CALL_VAL(OPTEE_SMC_FUNCID_GET_SHM_CONFIG)
+
+struct optee_smc_get_shm_config_result {
+       unsigned long status;
+       unsigned long start;
+       unsigned long size;
+       unsigned long settings;
+};
+
+/*
+ * Exchanges capabilities between normal world and secure world
+ *
+ * Call register usage:
+ * a0  SMC Function ID, OPTEE_SMC_EXCHANGE_CAPABILITIES
+ * a1  bitfield of normal world capabilities OPTEE_SMC_NSEC_CAP_*
+ * a2-6        Not used
+ * a7  Hypervisor Client ID register
+ *
+ * Normal return register usage:
+ * a0  OPTEE_SMC_RETURN_OK
+ * a1  bitfield of secure world capabilities OPTEE_SMC_SEC_CAP_*
+ * a2-7        Preserved
+ *
+ * Error return register usage:
+ * a0  OPTEE_SMC_RETURN_ENOTAVAIL, can't use the capabilities from normal world
+ * a1  bitfield of secure world capabilities OPTEE_SMC_SEC_CAP_*
+ * a2-7 Preserved
+ */
+/* Normal world works as a uniprocessor system */
+#define OPTEE_SMC_NSEC_CAP_UNIPROCESSOR                BIT(0)
+/* Secure world has reserved shared memory for normal world to use */
+#define OPTEE_SMC_SEC_CAP_HAVE_RESERVED_SHM    BIT(0)
+/* Secure world can communicate via previously unregistered shared memory */
+#define OPTEE_SMC_SEC_CAP_UNREGISTERED_SHM     BIT(1)
+#define OPTEE_SMC_FUNCID_EXCHANGE_CAPABILITIES 9
+#define OPTEE_SMC_EXCHANGE_CAPABILITIES \
+       OPTEE_SMC_FAST_CALL_VAL(OPTEE_SMC_FUNCID_EXCHANGE_CAPABILITIES)
+
+struct optee_smc_exchange_capabilities_result {
+       unsigned long status;
+       unsigned long capabilities;
+       unsigned long reserved0;
+       unsigned long reserved1;
+};
+
+/*
+ * Disable and empties cache of shared memory objects
+ *
+ * Secure world can cache frequently used shared memory objects, for
+ * example objects used as RPC arguments. When secure world is idle this
+ * function returns one shared memory reference to free. To disable the
+ * cache and free all cached objects this function has to be called until
+ * it returns OPTEE_SMC_RETURN_ENOTAVAIL.
+ *
+ * Call register usage:
+ * a0  SMC Function ID, OPTEE_SMC_DISABLE_SHM_CACHE
+ * a1-6        Not used
+ * a7  Hypervisor Client ID register
+ *
+ * Normal return register usage:
+ * a0  OPTEE_SMC_RETURN_OK
+ * a1  Upper 32bit of a 64bit Shared memory cookie
+ * a2  Lower 32bit of a 64bit Shared memory cookie
+ * a3-7        Preserved
+ *
+ * Cache empty return register usage:
+ * a0  OPTEE_SMC_RETURN_ENOTAVAIL
+ * a1-7        Preserved
+ *
+ * Not idle return register usage:
+ * a0  OPTEE_SMC_RETURN_EBUSY
+ * a1-7        Preserved
+ */
+#define OPTEE_SMC_FUNCID_DISABLE_SHM_CACHE     10
+#define OPTEE_SMC_DISABLE_SHM_CACHE \
+       OPTEE_SMC_FAST_CALL_VAL(OPTEE_SMC_FUNCID_DISABLE_SHM_CACHE)
+
+struct optee_smc_disable_shm_cache_result {
+       unsigned long status;
+       unsigned long shm_upper32;
+       unsigned long shm_lower32;
+       unsigned long reserved0;
+};
+
+/*
+ * Enable cache of shared memory objects
+ *
+ * Secure world can cache frequently used shared memory objects, for
+ * example objects used as RPC arguments. When secure world is idle this
+ * function returns OPTEE_SMC_RETURN_OK and the cache is enabled. If
+ * secure world isn't idle OPTEE_SMC_RETURN_EBUSY is returned.
+ *
+ * Call register usage:
+ * a0  SMC Function ID, OPTEE_SMC_ENABLE_SHM_CACHE
+ * a1-6        Not used
+ * a7  Hypervisor Client ID register
+ *
+ * Normal return register usage:
+ * a0  OPTEE_SMC_RETURN_OK
+ * a1-7        Preserved
+ *
+ * Not idle return register usage:
+ * a0  OPTEE_SMC_RETURN_EBUSY
+ * a1-7        Preserved
+ */
+#define OPTEE_SMC_FUNCID_ENABLE_SHM_CACHE      11
+#define OPTEE_SMC_ENABLE_SHM_CACHE \
+       OPTEE_SMC_FAST_CALL_VAL(OPTEE_SMC_FUNCID_ENABLE_SHM_CACHE)
+
+/*
+ * Resume from RPC (for example after processing an IRQ)
+ *
+ * Call register usage:
+ * a0  SMC Function ID, OPTEE_SMC_CALL_RETURN_FROM_RPC
+ * a1-3        Value of a1-3 when OPTEE_SMC_CALL_WITH_ARG returned
+ *     OPTEE_SMC_RETURN_RPC in a0
+ *
+ * Return register usage is the same as for OPTEE_SMC_*CALL_WITH_ARG above.
+ *
+ * Possible return values
+ * OPTEE_SMC_RETURN_UNKNOWN_FUNCTION   Trusted OS does not recognize this
+ *                                     function.
+ * OPTEE_SMC_RETURN_OK                 Original call completed, result
+ *                                     updated in the previously supplied.
+ *                                     struct optee_msg_arg
+ * OPTEE_SMC_RETURN_RPC                        Call suspended by RPC call to normal
+ *                                     world.
+ * OPTEE_SMC_RETURN_ERESUME            Resume failed, the opaque resume
+ *                                     information was corrupt.
+ */
+#define OPTEE_SMC_FUNCID_RETURN_FROM_RPC       3
+#define OPTEE_SMC_CALL_RETURN_FROM_RPC \
+       OPTEE_SMC_STD_CALL_VAL(OPTEE_SMC_FUNCID_RETURN_FROM_RPC)
+
+#define OPTEE_SMC_RETURN_RPC_PREFIX_MASK       0xFFFF0000
+#define OPTEE_SMC_RETURN_RPC_PREFIX            0xFFFF0000
+#define OPTEE_SMC_RETURN_RPC_FUNC_MASK         0x0000FFFF
+
+#define OPTEE_SMC_RETURN_GET_RPC_FUNC(ret) \
+       ((ret) & OPTEE_SMC_RETURN_RPC_FUNC_MASK)
+
+#define OPTEE_SMC_RPC_VAL(func)                ((func) | OPTEE_SMC_RETURN_RPC_PREFIX)
+
+/*
+ * Allocate memory for RPC parameter passing. The memory is used to hold a
+ * struct optee_msg_arg.
+ *
+ * "Call" register usage:
+ * a0  This value, OPTEE_SMC_RETURN_RPC_ALLOC
+ * a1  Size in bytes of required argument memory
+ * a2  Not used
+ * a3  Resume information, must be preserved
+ * a4-5        Not used
+ * a6-7        Resume information, must be preserved
+ *
+ * "Return" register usage:
+ * a0  SMC Function ID, OPTEE_SMC_CALL_RETURN_FROM_RPC.
+ * a1  Upper 32bits of 64bit physical pointer to allocated
+ *     memory, (a1 == 0 && a2 == 0) if size was 0 or if memory can't
+ *     be allocated.
+ * a2  Lower 32bits of 64bit physical pointer to allocated
+ *     memory, (a1 == 0 && a2 == 0) if size was 0 or if memory can't
+ *     be allocated
+ * a3  Preserved
+ * a4  Upper 32bits of 64bit Shared memory cookie used when freeing
+ *     the memory or doing an RPC
+ * a5  Lower 32bits of 64bit Shared memory cookie used when freeing
+ *     the memory or doing an RPC
+ * a6-7        Preserved
+ */
+#define OPTEE_SMC_RPC_FUNC_ALLOC       0
+#define OPTEE_SMC_RETURN_RPC_ALLOC \
+       OPTEE_SMC_RPC_VAL(OPTEE_SMC_RPC_FUNC_ALLOC)
+
+/*
+ * Free memory previously allocated by OPTEE_SMC_RETURN_RPC_ALLOC
+ *
+ * "Call" register usage:
+ * a0  This value, OPTEE_SMC_RETURN_RPC_FREE
+ * a1  Upper 32bits of 64bit shared memory cookie belonging to this
+ *     argument memory
+ * a2  Lower 32bits of 64bit shared memory cookie belonging to this
+ *     argument memory
+ * a3-7        Resume information, must be preserved
+ *
+ * "Return" register usage:
+ * a0  SMC Function ID, OPTEE_SMC_CALL_RETURN_FROM_RPC.
+ * a1-2        Not used
+ * a3-7        Preserved
+ */
+#define OPTEE_SMC_RPC_FUNC_FREE                2
+#define OPTEE_SMC_RETURN_RPC_FREE \
+       OPTEE_SMC_RPC_VAL(OPTEE_SMC_RPC_FUNC_FREE)
+
+/*
+ * Deliver an IRQ in normal world.
+ *
+ * "Call" register usage:
+ * a0  OPTEE_SMC_RETURN_RPC_IRQ
+ * a1-7        Resume information, must be preserved
+ *
+ * "Return" register usage:
+ * a0  SMC Function ID, OPTEE_SMC_CALL_RETURN_FROM_RPC.
+ * a1-7        Preserved
+ */
+#define OPTEE_SMC_RPC_FUNC_IRQ         4
+#define OPTEE_SMC_RETURN_RPC_IRQ \
+       OPTEE_SMC_RPC_VAL(OPTEE_SMC_RPC_FUNC_IRQ)
+
+/*
+ * Do an RPC request. The supplied struct optee_msg_arg tells which
+ * request to do and the parameters for the request. The following fields
+ * are used (the rest are unused):
+ * - cmd               the Request ID
+ * - ret               return value of the request, filled in by normal world
+ * - num_params                number of parameters for the request
+ * - params            the parameters
+ * - param_attrs       attributes of the parameters
+ *
+ * "Call" register usage:
+ * a0  OPTEE_SMC_RETURN_RPC_CMD
+ * a1  Upper 32bit of a 64bit Shared memory cookie holding a
+ *     struct optee_msg_arg, must be preserved, only the data should
+ *     be updated
+ * a2  Lower 32bit of a 64bit Shared memory cookie holding a
+ *     struct optee_msg_arg, must be preserved, only the data should
+ *     be updated
+ * a3-7        Resume information, must be preserved
+ *
+ * "Return" register usage:
+ * a0  SMC Function ID, OPTEE_SMC_CALL_RETURN_FROM_RPC.
+ * a1-2        Not used
+ * a3-7        Preserved
+ */
+#define OPTEE_SMC_RPC_FUNC_CMD         5
+#define OPTEE_SMC_RETURN_RPC_CMD \
+       OPTEE_SMC_RPC_VAL(OPTEE_SMC_RPC_FUNC_CMD)
+
+/* Returned in a0 */
+#define OPTEE_SMC_RETURN_UNKNOWN_FUNCTION 0xFFFFFFFF
+
+/* Returned in a0 only from Trusted OS functions */
+#define OPTEE_SMC_RETURN_OK            0x0
+#define OPTEE_SMC_RETURN_ETHREAD_LIMIT 0x1
+#define OPTEE_SMC_RETURN_EBUSY         0x2
+#define OPTEE_SMC_RETURN_ERESUME       0x3
+#define OPTEE_SMC_RETURN_EBADADDR      0x4
+#define OPTEE_SMC_RETURN_EBADCMD       0x5
+#define OPTEE_SMC_RETURN_ENOMEM                0x6
+#define OPTEE_SMC_RETURN_ENOTAVAIL     0x7
+#define OPTEE_SMC_RETURN_IS_RPC(ret)   __optee_smc_return_is_rpc((ret))
+
+static inline bool __optee_smc_return_is_rpc(u32 ret)
+{
+       return ret != OPTEE_SMC_RETURN_UNKNOWN_FUNCTION &&
+              (ret & OPTEE_SMC_RETURN_RPC_PREFIX_MASK) ==
+                       OPTEE_SMC_RETURN_RPC_PREFIX;
+}
+
+#endif /* OPTEE_SMC_H */
diff --git a/optee/rpc.c b/optee/rpc.c
new file mode 100644 (file)
index 0000000..9ed6311
--- /dev/null
@@ -0,0 +1,396 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include <linux/delay.h>
+#include <linux/device.h>
+#include <linux/slab.h>
+#include "tee_drv.h"
+#include "optee_private.h"
+#include "optee_smc.h"
+
+struct wq_entry {
+       struct list_head link;
+       struct completion c;
+       u32 key;
+};
+
+void optee_wait_queue_init(struct optee_wait_queue *priv)
+{
+       mutex_init(&priv->mu);
+       INIT_LIST_HEAD(&priv->db);
+}
+
+void optee_wait_queue_exit(struct optee_wait_queue *priv)
+{
+       mutex_destroy(&priv->mu);
+}
+
+static void handle_rpc_func_cmd_get_time(struct optee_msg_arg *arg)
+{
+       struct timespec ts;
+
+       if (arg->num_params != 1)
+               goto bad;
+       if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) !=
+                       OPTEE_MSG_ATTR_TYPE_VALUE_OUTPUT)
+               goto bad;
+
+       getnstimeofday(&ts);
+       arg->params[0].u.value.a = ts.tv_sec;
+       arg->params[0].u.value.b = ts.tv_nsec;
+
+       arg->ret = TEEC_SUCCESS;
+       return;
+bad:
+       arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+}
+
+static struct wq_entry *wq_entry_get(struct optee_wait_queue *wq, u32 key)
+{
+       struct wq_entry *w;
+
+       mutex_lock(&wq->mu);
+
+       list_for_each_entry(w, &wq->db, link)
+               if (w->key == key)
+                       goto out;
+
+       w = kmalloc(sizeof(*w), GFP_KERNEL);
+       if (w) {
+               init_completion(&w->c);
+               w->key = key;
+               list_add_tail(&w->link, &wq->db);
+       }
+out:
+       mutex_unlock(&wq->mu);
+       return w;
+}
+
+static void wq_sleep(struct optee_wait_queue *wq, u32 key)
+{
+       struct wq_entry *w = wq_entry_get(wq, key);
+
+       if (w) {
+               wait_for_completion(&w->c);
+               mutex_lock(&wq->mu);
+               list_del(&w->link);
+               mutex_unlock(&wq->mu);
+               kfree(w);
+       }
+}
+
+static void wq_wakeup(struct optee_wait_queue *wq, u32 key)
+{
+       struct wq_entry *w = wq_entry_get(wq, key);
+
+       if (w)
+               complete(&w->c);
+}
+
+static void handle_rpc_func_cmd_wq(struct optee *optee,
+                                  struct optee_msg_arg *arg)
+{
+       if (arg->num_params != 1)
+               goto bad;
+
+       if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) !=
+                       OPTEE_MSG_ATTR_TYPE_VALUE_INPUT)
+               goto bad;
+
+       switch (arg->params[0].u.value.a) {
+       case OPTEE_MSG_RPC_WAIT_QUEUE_SLEEP:
+               wq_sleep(&optee->wait_queue, arg->params[0].u.value.b);
+               break;
+       case OPTEE_MSG_RPC_WAIT_QUEUE_WAKEUP:
+               wq_wakeup(&optee->wait_queue, arg->params[0].u.value.b);
+               break;
+       default:
+               goto bad;
+       }
+
+       arg->ret = TEEC_SUCCESS;
+       return;
+bad:
+       arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+}
+
+static void handle_rpc_func_cmd_wait(struct optee_msg_arg *arg)
+{
+       u32 msec_to_wait;
+
+       if (arg->num_params != 1)
+               goto bad;
+
+       if ((arg->params[0].attr & OPTEE_MSG_ATTR_TYPE_MASK) !=
+                       OPTEE_MSG_ATTR_TYPE_VALUE_INPUT)
+               goto bad;
+
+       msec_to_wait = arg->params[0].u.value.a;
+
+       /* set task's state to interruptible sleep */
+       set_current_state(TASK_INTERRUPTIBLE);
+
+       /* take a nap */
+       msleep(msec_to_wait);
+
+       arg->ret = TEEC_SUCCESS;
+       return;
+bad:
+       arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+}
+
+static void handle_rpc_supp_cmd(struct tee_context *ctx,
+                               struct optee_msg_arg *arg)
+{
+       struct tee_param *params;
+
+       arg->ret_origin = TEEC_ORIGIN_COMMS;
+
+       params = kmalloc_array(arg->num_params, sizeof(struct tee_param),
+                              GFP_KERNEL);
+       if (!params) {
+               arg->ret = TEEC_ERROR_OUT_OF_MEMORY;
+               return;
+       }
+
+       if (optee_from_msg_param(params, arg->num_params, arg->params)) {
+               arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+               goto out;
+       }
+
+       arg->ret = optee_supp_thrd_req(ctx, arg->cmd, arg->num_params, params);
+
+       if (optee_to_msg_param(arg->params, arg->num_params, params))
+               arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+out:
+       kfree(params);
+}
+
+static struct tee_shm *cmd_alloc_suppl(struct tee_context *ctx, size_t sz)
+{
+       u32 ret;
+       struct tee_param param;
+       struct optee *optee = tee_get_drvdata(ctx->teedev);
+       struct tee_shm *shm;
+
+       param.attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT;
+       param.u.value.a = OPTEE_MSG_RPC_SHM_TYPE_APPL;
+       param.u.value.b = sz;
+       param.u.value.c = 0;
+
+       ret = optee_supp_thrd_req(ctx, OPTEE_MSG_RPC_CMD_SHM_ALLOC, 1, &param);
+       if (ret)
+               return ERR_PTR(-ENOMEM);
+
+       mutex_lock(&optee->supp.mutex);
+       /* Increases count as secure world doesn't have a reference */
+       shm = tee_shm_get_from_id(optee->supp.ctx, param.u.value.c);
+       mutex_unlock(&optee->supp.mutex);
+       return shm;
+}
+
+static void handle_rpc_func_cmd_shm_alloc(struct tee_context *ctx,
+                                         struct optee_msg_arg *arg)
+{
+       phys_addr_t pa;
+       struct tee_shm *shm;
+       size_t sz;
+       size_t n;
+
+       arg->ret_origin = TEEC_ORIGIN_COMMS;
+
+       if (!arg->num_params ||
+           arg->params[0].attr != OPTEE_MSG_ATTR_TYPE_VALUE_INPUT) {
+               arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+               return;
+       }
+
+       for (n = 1; n < arg->num_params; n++) {
+               if (arg->params[n].attr != OPTEE_MSG_ATTR_TYPE_NONE) {
+                       arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+                       return;
+               }
+       }
+
+       sz = arg->params[0].u.value.b;
+       switch (arg->params[0].u.value.a) {
+       case OPTEE_MSG_RPC_SHM_TYPE_APPL:
+               shm = cmd_alloc_suppl(ctx, sz);
+               break;
+       case OPTEE_MSG_RPC_SHM_TYPE_KERNEL:
+               shm = tee_shm_alloc(ctx, sz, TEE_SHM_MAPPED);
+               break;
+       default:
+               arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+               return;
+       }
+
+       if (IS_ERR(shm)) {
+               arg->ret = TEEC_ERROR_OUT_OF_MEMORY;
+               return;
+       }
+
+       if (tee_shm_get_pa(shm, 0, &pa)) {
+               arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+               goto bad;
+       }
+
+       arg->params[0].attr = OPTEE_MSG_ATTR_TYPE_TMEM_OUTPUT;
+       arg->params[0].u.tmem.buf_ptr = pa;
+       arg->params[0].u.tmem.size = sz;
+       arg->params[0].u.tmem.shm_ref = (unsigned long)shm;
+       arg->ret = TEEC_SUCCESS;
+       return;
+bad:
+       tee_shm_free(shm);
+}
+
+static void cmd_free_suppl(struct tee_context *ctx, struct tee_shm *shm)
+{
+       struct tee_param param;
+
+       param.attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT;
+       param.u.value.a = OPTEE_MSG_RPC_SHM_TYPE_APPL;
+       param.u.value.b = tee_shm_get_id(shm);
+       param.u.value.c = 0;
+
+       /*
+        * Match the tee_shm_get_from_id() in cmd_alloc_suppl() as secure
+        * world has released its reference.
+        *
+        * It's better to do this before sending the request to supplicant
+        * as we'd like to let the process doing the initial allocation to
+        * do release the last reference too in order to avoid stacking
+        * many pending fput() on the client process. This could otherwise
+        * happen if secure world does many allocate and free in a single
+        * invoke.
+        */
+       tee_shm_put(shm);
+
+       optee_supp_thrd_req(ctx, OPTEE_MSG_RPC_CMD_SHM_FREE, 1, &param);
+}
+
+static void handle_rpc_func_cmd_shm_free(struct tee_context *ctx,
+                                        struct optee_msg_arg *arg)
+{
+       struct tee_shm *shm;
+
+       arg->ret_origin = TEEC_ORIGIN_COMMS;
+
+       if (arg->num_params != 1 ||
+           arg->params[0].attr != OPTEE_MSG_ATTR_TYPE_VALUE_INPUT) {
+               arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+               return;
+       }
+
+       shm = (struct tee_shm *)(unsigned long)arg->params[0].u.value.b;
+       switch (arg->params[0].u.value.a) {
+       case OPTEE_MSG_RPC_SHM_TYPE_APPL:
+               cmd_free_suppl(ctx, shm);
+               break;
+       case OPTEE_MSG_RPC_SHM_TYPE_KERNEL:
+               tee_shm_free(shm);
+               break;
+       default:
+               arg->ret = TEEC_ERROR_BAD_PARAMETERS;
+       }
+       arg->ret = TEEC_SUCCESS;
+}
+
+static void handle_rpc_func_cmd(struct tee_context *ctx, struct optee *optee,
+                               struct tee_shm *shm)
+{
+       struct optee_msg_arg *arg;
+
+       arg = tee_shm_get_va(shm, 0);
+       if (IS_ERR(arg)) {
+               pr_err("%s: tee_shm_get_va %p failed\n", __func__, shm);
+               return;
+       }
+
+       switch (arg->cmd) {
+       case OPTEE_MSG_RPC_CMD_GET_TIME:
+               handle_rpc_func_cmd_get_time(arg);
+               break;
+       case OPTEE_MSG_RPC_CMD_WAIT_QUEUE:
+               handle_rpc_func_cmd_wq(optee, arg);
+               break;
+       case OPTEE_MSG_RPC_CMD_SUSPEND:
+               handle_rpc_func_cmd_wait(arg);
+               break;
+       case OPTEE_MSG_RPC_CMD_SHM_ALLOC:
+               handle_rpc_func_cmd_shm_alloc(ctx, arg);
+               break;
+       case OPTEE_MSG_RPC_CMD_SHM_FREE:
+               handle_rpc_func_cmd_shm_free(ctx, arg);
+               break;
+       default:
+               handle_rpc_supp_cmd(ctx, arg);
+       }
+}
+
+/**
+ * optee_handle_rpc() - handle RPC from secure world
+ * @ctx:       context doing the RPC
+ * @param:     value of registers for the RPC
+ *
+ * Result of RPC is written back into @param.
+ */
+void optee_handle_rpc(struct tee_context *ctx, struct optee_rpc_param *param)
+{
+       struct tee_device *teedev = ctx->teedev;
+       struct optee *optee = tee_get_drvdata(teedev);
+       struct tee_shm *shm;
+       phys_addr_t pa;
+
+       switch (OPTEE_SMC_RETURN_GET_RPC_FUNC(param->a0)) {
+       case OPTEE_SMC_RPC_FUNC_ALLOC:
+               shm = tee_shm_alloc(ctx, param->a1, TEE_SHM_MAPPED);
+               if (!IS_ERR(shm) && !tee_shm_get_pa(shm, 0, &pa)) {
+                       reg_pair_from_64(&param->a1, &param->a2, pa);
+                       reg_pair_from_64(&param->a4, &param->a5,
+                                        (unsigned long)shm);
+               } else {
+                       param->a1 = 0;
+                       param->a2 = 0;
+                       param->a4 = 0;
+                       param->a5 = 0;
+               }
+               break;
+       case OPTEE_SMC_RPC_FUNC_FREE:
+               shm = reg_pair_to_ptr(param->a1, param->a2);
+               tee_shm_free(shm);
+               break;
+       case OPTEE_SMC_RPC_FUNC_IRQ:
+               /*
+                * An IRQ was raised while secure world was executing,
+                * since all IRQs are handled in Linux a dummy RPC is
+                * performed to let Linux take the IRQ through the normal
+                * vector.
+                */
+               break;
+       case OPTEE_SMC_RPC_FUNC_CMD:
+               shm = reg_pair_to_ptr(param->a1, param->a2);
+               handle_rpc_func_cmd(ctx, optee, shm);
+               break;
+       default:
+               pr_warn("Unknown RPC func 0x%x\n",
+                       (u32)OPTEE_SMC_RETURN_GET_RPC_FUNC(param->a0));
+               break;
+       }
+
+       param->a0 = OPTEE_SMC_CALL_RETURN_FROM_RPC;
+}
diff --git a/optee/rpc.o b/optee/rpc.o
new file mode 100644 (file)
index 0000000..02aaa58
Binary files /dev/null and b/optee/rpc.o differ
diff --git a/optee/smccc-call.S b/optee/smccc-call.S
new file mode 100755 (executable)
index 0000000..81087ce
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * 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>
+
+#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)
+ */
+ENTRY(arm_smccc_smc)
+       SMCCC   smc
+ENDPROC(arm_smccc_smc)
+
+/*
+ * 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)
+ */
+ENTRY(arm_smccc_hvc)
+       SMCCC   hvc
+ENDPROC(arm_smccc_hvc)
diff --git a/optee/smccc-call.o b/optee/smccc-call.o
new file mode 100644 (file)
index 0000000..d94d87a
Binary files /dev/null and b/optee/smccc-call.o differ
diff --git a/optee/supp.c b/optee/supp.c
new file mode 100755 (executable)
index 0000000..02b1219
--- /dev/null
@@ -0,0 +1,382 @@
+/*
+ * Copyright (c) 2015, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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/device.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+#include "optee_private.h"
+
+struct optee_supp_req {
+       struct list_head link;
+
+       bool busy;
+       u32 func;
+       u32 ret;
+       size_t num_params;
+       struct tee_param *param;
+
+       struct completion c;
+};
+
+void optee_supp_init(struct optee_supp *supp)
+{
+       memset(supp, 0, sizeof(*supp));
+       mutex_init(&supp->mutex);
+       init_completion(&supp->reqs_c);
+       idr_init(&supp->idr);
+       INIT_LIST_HEAD(&supp->reqs);
+       supp->req_id = -1;
+}
+
+void optee_supp_uninit(struct optee_supp *supp)
+{
+       mutex_destroy(&supp->mutex);
+       idr_destroy(&supp->idr);
+}
+
+void optee_supp_release(struct optee_supp *supp)
+{
+       int id;
+       struct optee_supp_req *req;
+       struct optee_supp_req *req_tmp;
+
+       mutex_lock(&supp->mutex);
+
+       /* Abort all request retrieved by supplicant */
+       idr_for_each_entry(&supp->idr, req, id) {
+               req->busy = false;
+               idr_remove(&supp->idr, id);
+               req->ret = TEEC_ERROR_COMMUNICATION;
+               complete(&req->c);
+       }
+
+       /* Abort all queued requests */
+       list_for_each_entry_safe(req, req_tmp, &supp->reqs, link) {
+               list_del(&req->link);
+               req->ret = TEEC_ERROR_COMMUNICATION;
+               complete(&req->c);
+       }
+
+       supp->ctx = NULL;
+       supp->req_id = -1;
+
+       mutex_unlock(&supp->mutex);
+}
+
+/**
+ * optee_supp_thrd_req() - request service from supplicant
+ * @ctx:       context doing the request
+ * @func:      function requested
+ * @num_params:        number of elements in @param array
+ * @param:     parameters for function
+ *
+ * Returns result of operation to be passed to secure world
+ */
+u32 optee_supp_thrd_req(struct tee_context *ctx, u32 func, size_t num_params,
+                       struct tee_param *param)
+
+{
+       struct optee *optee = tee_get_drvdata(ctx->teedev);
+       struct optee_supp *supp = &optee->supp;
+       struct optee_supp_req *req = kzalloc(sizeof(*req), GFP_KERNEL);
+       bool interruptable;
+       u32 ret;
+
+       if (!req)
+               return TEEC_ERROR_OUT_OF_MEMORY;
+
+       init_completion(&req->c);
+       req->func = func;
+       req->num_params = num_params;
+       req->param = param;
+
+       /* Insert the request in the request list */
+       mutex_lock(&supp->mutex);
+       list_add_tail(&req->link, &supp->reqs);
+       mutex_unlock(&supp->mutex);
+
+       /* Tell an eventual waiter there's a new request */
+       complete(&supp->reqs_c);
+
+       /*
+        * Wait for supplicant to process and return result, once we've
+        * returned from wait_for_completion(&req->c) successfully we have
+        * exclusive access again.
+        */
+       while (wait_for_completion_interruptible(&req->c)) {
+               mutex_lock(&supp->mutex);
+               interruptable = !supp->ctx;
+               if (interruptable) {
+                       /*
+                        * There's no supplicant available and since the
+                        * supp->mutex currently is held none can
+                        * become available until the mutex released
+                        * again.
+                        *
+                        * Interrupting an RPC to supplicant is only
+                        * allowed as a way of slightly improving the user
+                        * experience in case the supplicant hasn't been
+                        * started yet. During normal operation the supplicant
+                        * will serve all requests in a timely manner and
+                        * interrupting then wouldn't make sense.
+                        */
+                       interruptable = !req->busy;
+                       if ((!req->busy) && (req->ret != TEEC_ERROR_COMMUNICATION))
+                               list_del(&req->link);
+               }
+               mutex_unlock(&supp->mutex);
+
+               if (interruptable) {
+                       req->ret = TEEC_ERROR_COMMUNICATION;
+                       break;
+               }
+       }
+
+       ret = req->ret;
+       kfree(req);
+
+       return ret;
+}
+
+static struct optee_supp_req  *supp_pop_entry(struct optee_supp *supp,
+                                             int num_params, int *id)
+{
+       struct optee_supp_req *req;
+
+       if (supp->req_id != -1) {
+               /*
+                * Supplicant should not mix synchronous and asnynchronous
+                * requests.
+                */
+               return ERR_PTR(-EINVAL);
+       }
+
+       if (list_empty(&supp->reqs))
+               return NULL;
+
+       req = list_first_entry(&supp->reqs, struct optee_supp_req, link);
+
+       if (num_params < req->num_params) {
+               /* Not enough room for parameters */
+               return ERR_PTR(-EINVAL);
+       }
+
+       *id = idr_alloc(&supp->idr, req, 1, 0, GFP_KERNEL);
+       if (*id < 0)
+               return ERR_PTR(-ENOMEM);
+
+       list_del(&req->link);
+       req->busy = true;
+
+       return req;
+}
+
+static int supp_check_recv_params(size_t num_params, struct tee_param *params,
+                                 size_t *num_meta)
+{
+       size_t n;
+
+       if (!num_params)
+               return -EINVAL;
+
+       /*
+        * If there's memrefs we need to decrease those as they where
+        * increased earlier and we'll even refuse to accept any below.
+        */
+       for (n = 0; n < num_params; n++)
+               if (tee_param_is_memref(params + n) && params[n].u.memref.shm)
+                       tee_shm_put(params[n].u.memref.shm);
+
+       /*
+        * We only expect parameters as TEE_IOCTL_PARAM_ATTR_TYPE_NONE with
+        * or without the TEE_IOCTL_PARAM_ATTR_META bit set.
+        */
+       for (n = 0; n < num_params; n++)
+               if (params[n].attr &&
+                   params[n].attr != TEE_IOCTL_PARAM_ATTR_META)
+                       return -EINVAL;
+
+       /* At most we'll need one meta parameter so no need to check for more */
+       if (params->attr == TEE_IOCTL_PARAM_ATTR_META)
+               *num_meta = 1;
+       else
+               *num_meta = 0;
+
+       return 0;
+}
+
+/**
+ * optee_supp_recv() - receive request for supplicant
+ * @ctx:       context receiving the request
+ * @func:      requested function in supplicant
+ * @num_params:        number of elements allocated in @param, updated with number
+ *             used elements
+ * @param:     space for parameters for @func
+ *
+ * Returns 0 on success or <0 on failure
+ */
+int optee_supp_recv(struct tee_context *ctx, u32 *func, u32 *num_params,
+                   struct tee_param *param)
+{
+       struct tee_device *teedev = ctx->teedev;
+       struct optee *optee = tee_get_drvdata(teedev);
+       struct optee_supp *supp = &optee->supp;
+       struct optee_supp_req *req = NULL;
+       int id;
+       size_t num_meta;
+       int rc;
+
+       rc = supp_check_recv_params(*num_params, param, &num_meta);
+       if (rc)
+               return rc;
+
+       while (true) {
+               mutex_lock(&supp->mutex);
+               req = supp_pop_entry(supp, *num_params - num_meta, &id);
+               mutex_unlock(&supp->mutex);
+
+               if (req) {
+                       if (IS_ERR(req))
+                               return PTR_ERR(req);
+                       break;
+               }
+
+               /*
+                * If we didn't get a request we'll block in
+                * wait_for_completion() to avoid needless spinning.
+                *
+                * This is where supplicant will be hanging most of
+                * the time, let's make this interruptable so we
+                * can easily restart supplicant if needed.
+                */
+               if (wait_for_completion_interruptible(&supp->reqs_c))
+                       return -ERESTARTSYS;
+       }
+
+       if (num_meta) {
+               /*
+                * tee-supplicant support meta parameters -> requsts can be
+                * processed asynchronously.
+                */
+               param->attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT |
+                             TEE_IOCTL_PARAM_ATTR_META;
+               param->u.value.a = id;
+               param->u.value.b = 0;
+               param->u.value.c = 0;
+       } else {
+               mutex_lock(&supp->mutex);
+               supp->req_id = id;
+               mutex_unlock(&supp->mutex);
+       }
+
+       *func = req->func;
+       *num_params = req->num_params + num_meta;
+       memcpy(param + num_meta, req->param,
+              sizeof(struct tee_param) * req->num_params);
+
+       return 0;
+}
+
+static struct optee_supp_req *supp_pop_req(struct optee_supp *supp,
+                                          size_t num_params,
+                                          struct tee_param *param,
+                                          size_t *num_meta)
+{
+       struct optee_supp_req *req;
+       int id;
+       size_t nm;
+       const u32 attr = TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT |
+                        TEE_IOCTL_PARAM_ATTR_META;
+
+       if (!num_params)
+               return ERR_PTR(-EINVAL);
+
+       if (supp->req_id == -1) {
+               if (param->attr != attr)
+                       return ERR_PTR(-EINVAL);
+               id = param->u.value.a;
+               nm = 1;
+       } else {
+               id = supp->req_id;
+               nm = 0;
+       }
+
+       req = idr_find(&supp->idr, id);
+       if (!req)
+               return ERR_PTR(-ENOENT);
+
+       if ((num_params - nm) != req->num_params)
+               return ERR_PTR(-EINVAL);
+
+       req->busy = false;
+       idr_remove(&supp->idr, id);
+       supp->req_id = -1;
+       *num_meta = nm;
+
+       return req;
+}
+
+/**
+ * optee_supp_send() - send result of request from supplicant
+ * @ctx:       context sending result
+ * @ret:       return value of request
+ * @num_params:        number of parameters returned
+ * @param:     returned parameters
+ *
+ * Returns 0 on success or <0 on failure.
+ */
+int optee_supp_send(struct tee_context *ctx, u32 ret, u32 num_params,
+                   struct tee_param *param)
+{
+       struct tee_device *teedev = ctx->teedev;
+       struct optee *optee = tee_get_drvdata(teedev);
+       struct optee_supp *supp = &optee->supp;
+       struct optee_supp_req *req;
+       size_t n;
+       size_t num_meta;
+
+       mutex_lock(&supp->mutex);
+       req = supp_pop_req(supp, num_params, param, &num_meta);
+       mutex_unlock(&supp->mutex);
+
+       if (IS_ERR(req)) {
+               /* Something is wrong, let supplicant restart. */
+               return PTR_ERR(req);
+       }
+
+       /* Update out and in/out parameters */
+       for (n = 0; n < req->num_params; n++) {
+               struct tee_param *p = req->param + n;
+
+               switch (p->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
+                       p->u.value.a = param[n + num_meta].u.value.a;
+                       p->u.value.b = param[n + num_meta].u.value.b;
+                       p->u.value.c = param[n + num_meta].u.value.c;
+                       break;
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
+                       p->u.memref.size = param[n + num_meta].u.memref.size;
+                       break;
+               default:
+                       break;
+               }
+       }
+       req->ret = ret;
+
+       /* Let the requesting thread continue */
+       complete(&req->c);
+
+       return 0;
+}
diff --git a/optee/supp.o b/optee/supp.o
new file mode 100644 (file)
index 0000000..801128b
Binary files /dev/null and b/optee/supp.o differ
diff --git a/tee_core.c b/tee_core.c
new file mode 100755 (executable)
index 0000000..0dc456d
--- /dev/null
@@ -0,0 +1,1037 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+
+#define pr_fmt(fmt) "%s: " fmt, __func__
+
+#include <linux/cdev.h>
+#include <linux/device.h>
+#include <linux/fs.h>
+#include <linux/idr.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+#include "tee_drv.h"
+#include "tee_private.h"
+
+#define TEE_NUM_DEVICES        32
+
+#define TEE_IOCTL_PARAM_SIZE(x) (sizeof(struct tee_param) * (x))
+
+#define u64_to_user_ptr(x) ( \
+               { \
+                   typecheck(u64, x);      \
+                           (void __user *)(uintptr_t)x; \
+               } \
+               )
+/*
+ * Unprivileged devices in the lower half range and privileged devices in
+ * the upper half range.
+ */
+static DECLARE_BITMAP(dev_mask, TEE_NUM_DEVICES);
+static DEFINE_SPINLOCK(driver_lock);
+
+static struct class *tee_class;
+static dev_t tee_devt;
+
+static struct tee_context *teedev_open(struct tee_device *teedev)
+{
+       int rc;
+       struct tee_context *ctx;
+
+       if (!tee_device_get(teedev))
+               return ERR_PTR(-EINVAL);
+
+       ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
+       if (!ctx) {
+               rc = -ENOMEM;
+               goto err;
+       }
+
+       ctx->teedev = teedev;
+       INIT_LIST_HEAD(&ctx->list_shm);
+       rc = teedev->desc->ops->open(ctx);
+       if (rc)
+               goto err;
+
+       return ctx;
+err:
+       kfree(ctx);
+       tee_device_put(teedev);
+       return ERR_PTR(rc);
+
+}
+
+static void teedev_close_context(struct tee_context *ctx)
+{
+       struct tee_shm *shm;
+
+       ctx->teedev->desc->ops->release(ctx);
+       mutex_lock(&ctx->teedev->mutex);
+       list_for_each_entry(shm, &ctx->list_shm, link)
+               shm->ctx = NULL;
+       mutex_unlock(&ctx->teedev->mutex);
+       tee_device_put(ctx->teedev);
+       kfree(ctx);
+}
+
+static int tee_open(struct inode *inode, struct file *filp)
+{
+       struct tee_context *ctx;
+
+       ctx = teedev_open(container_of(inode->i_cdev, struct tee_device, cdev));
+       if (IS_ERR(ctx))
+               return PTR_ERR(ctx);
+
+       filp->private_data = ctx;
+       return 0;
+}
+
+static int tee_release(struct inode *inode, struct file *filp)
+{
+       teedev_close_context(filp->private_data);
+       return 0;
+}
+
+static int tee_ioctl_version(struct tee_context *ctx,
+                            struct tee_ioctl_version_data __user *uvers)
+{
+       struct tee_ioctl_version_data vers;
+
+       ctx->teedev->desc->ops->get_version(ctx->teedev, &vers);
+
+       if (ctx->teedev->desc->flags & TEE_DESC_PRIVILEGED)
+               vers.gen_caps |= TEE_GEN_CAP_PRIVILEGED;
+
+       if (copy_to_user(uvers, &vers, sizeof(vers)))
+               return -EFAULT;
+
+       return 0;
+}
+
+static int tee_ioctl_shm_alloc(struct tee_context *ctx,
+                              struct tee_ioctl_shm_alloc_data __user *udata)
+{
+       long ret;
+       struct tee_ioctl_shm_alloc_data data;
+       struct tee_shm *shm;
+
+       if (copy_from_user(&data, udata, sizeof(data)))
+               return -EFAULT;
+
+       /* Currently no input flags are supported */
+       if (data.flags)
+               return -EINVAL;
+
+       data.id = -1;
+
+       shm = tee_shm_alloc(ctx, data.size, TEE_SHM_MAPPED | TEE_SHM_DMA_BUF);
+       if (IS_ERR(shm))
+               return PTR_ERR(shm);
+
+       data.id = shm->id;
+       data.flags = shm->flags;
+       data.size = shm->size;
+
+       if (copy_to_user(udata, &data, sizeof(data)))
+               ret = -EFAULT;
+       else
+               ret = tee_shm_get_fd(shm);
+
+       /*
+        * When user space closes the file descriptor the shared memory
+        * should be freed or if tee_shm_get_fd() failed then it will
+        * be freed immediately.
+        */
+       tee_shm_put(shm);
+       return ret;
+}
+
+static int tee_ioctl_shm_register_fd(struct tee_context *ctx,
+                       struct tee_ioctl_shm_register_fd_data __user *udata)
+{
+       struct tee_ioctl_shm_register_fd_data data;
+       struct tee_shm *shm;
+       long ret;
+
+       if (copy_from_user(&data, udata, sizeof(data)))
+               return -EFAULT;
+
+       /* Currently no input flags are supported */
+       if (data.flags)
+               return -EINVAL;
+
+       shm = tee_shm_register_fd(ctx, data.fd);
+       if (IS_ERR_OR_NULL(shm))
+               return -EINVAL;
+
+       data.id = shm->id;
+       data.flags = shm->flags;
+       data.size = shm->size;
+
+       if (copy_to_user(udata, &data, sizeof(data)))
+               ret = -EFAULT;
+       else
+               ret = tee_shm_get_fd(shm);
+
+       /*
+        * When user space closes the file descriptor the shared memory
+        * should be freed or if tee_shm_get_fd() failed then it will
+        * be freed immediately.
+        */
+       tee_shm_put(shm);
+       return ret;
+}
+
+static int params_from_user(struct tee_context *ctx, struct tee_param *params,
+                           size_t num_params,
+                           struct tee_ioctl_param __user *uparams)
+{
+       size_t n;
+
+       for (n = 0; n < num_params; n++) {
+               struct tee_shm *shm;
+               struct tee_ioctl_param ip;
+
+               if (copy_from_user(&ip, uparams + n, sizeof(ip)))
+                       return -EFAULT;
+
+               /* All unused attribute bits has to be zero */
+               if (ip.attr & ~TEE_IOCTL_PARAM_ATTR_MASK)
+                       return -EINVAL;
+
+               params[n].attr = ip.attr;
+               switch (ip.attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
+               case TEE_IOCTL_PARAM_ATTR_TYPE_NONE:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
+                       break;
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
+                       params[n].u.value.a = ip.a;
+                       params[n].u.value.b = ip.b;
+                       params[n].u.value.c = ip.c;
+                       break;
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
+                       /*
+                        * If we fail to get a pointer to a shared memory
+                        * object (and increase the ref count) from an
+                        * identifier we return an error. All pointers that
+                        * has been added in params have an increased ref
+                        * count. It's the callers responibility to do
+                        * tee_shm_put() on all resolved pointers.
+                        */
+                       shm = tee_shm_get_from_id(ctx, ip.c);
+                       if (IS_ERR(shm))
+                               return PTR_ERR(shm);
+
+                       params[n].u.memref.shm_offs = ip.a;
+                       params[n].u.memref.size = ip.b;
+                       params[n].u.memref.shm = shm;
+                       break;
+               default:
+                       /* Unknown attribute */
+                       return -EINVAL;
+               }
+       }
+       return 0;
+}
+
+static int params_to_user(struct tee_ioctl_param __user *uparams,
+                         size_t num_params, struct tee_param *params)
+{
+       size_t n;
+
+       for (n = 0; n < num_params; n++) {
+               struct tee_ioctl_param __user *up = uparams + n;
+               struct tee_param *p = params + n;
+
+               switch (p->attr) {
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
+                       if (put_user(p->u.value.a, &up->a) ||
+                           put_user(p->u.value.b, &up->b) ||
+                           put_user(p->u.value.c, &up->c))
+                               return -EFAULT;
+                       break;
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
+                       if (put_user((u64)p->u.memref.size, &up->b))
+                               return -EFAULT;
+               default:
+                       break;
+               }
+       }
+       return 0;
+}
+
+static int tee_ioctl_open_session(struct tee_context *ctx,
+                                 struct tee_ioctl_buf_data __user *ubuf)
+{
+       int rc;
+       size_t n;
+       struct tee_ioctl_buf_data buf;
+       struct tee_ioctl_open_session_arg __user *uarg;
+       struct tee_ioctl_open_session_arg arg;
+       struct tee_ioctl_param __user *uparams = NULL;
+       struct tee_param *params = NULL;
+       bool have_session = false;
+
+       if (!ctx->teedev->desc->ops->open_session)
+               return -EINVAL;
+
+       if (copy_from_user(&buf, ubuf, sizeof(buf)))
+               return -EFAULT;
+
+       if (buf.buf_len > TEE_MAX_ARG_SIZE ||
+           buf.buf_len < sizeof(struct tee_ioctl_open_session_arg))
+               return -EINVAL;
+
+       uarg = u64_to_user_ptr(buf.buf_ptr);
+       if (copy_from_user(&arg, uarg, sizeof(arg)))
+               return -EFAULT;
+
+       if (sizeof(arg) + TEE_IOCTL_PARAM_SIZE(arg.num_params) != buf.buf_len)
+               return -EINVAL;
+
+       if (arg.num_params) {
+               params = kcalloc(arg.num_params, sizeof(struct tee_param),
+                                GFP_KERNEL);
+               if (!params)
+                       return -ENOMEM;
+               uparams = uarg->params;
+               rc = params_from_user(ctx, params, arg.num_params, uparams);
+               if (rc)
+                       goto out;
+       }
+
+       rc = ctx->teedev->desc->ops->open_session(ctx, &arg, params);
+       if (rc)
+               goto out;
+       have_session = true;
+
+       if (put_user(arg.session, &uarg->session) ||
+           put_user(arg.ret, &uarg->ret) ||
+           put_user(arg.ret_origin, &uarg->ret_origin)) {
+               rc = -EFAULT;
+               goto out;
+       }
+       rc = params_to_user(uparams, arg.num_params, params);
+out:
+       /*
+        * If we've succeeded to open the session but failed to communicate
+        * it back to user space, close the session again to avoid leakage.
+        */
+       if (rc && have_session && ctx->teedev->desc->ops->close_session)
+               ctx->teedev->desc->ops->close_session(ctx, arg.session);
+
+       if (params) {
+               /* Decrease ref count for all valid shared memory pointers */
+               for (n = 0; n < arg.num_params; n++)
+                       if (tee_param_is_memref(params + n) &&
+                           params[n].u.memref.shm)
+                               tee_shm_put(params[n].u.memref.shm);
+               kfree(params);
+       }
+
+       return rc;
+}
+
+static int tee_ioctl_invoke(struct tee_context *ctx,
+                           struct tee_ioctl_buf_data __user *ubuf)
+{
+       int rc;
+       size_t n;
+       struct tee_ioctl_buf_data buf;
+       struct tee_ioctl_invoke_arg __user *uarg;
+       struct tee_ioctl_invoke_arg arg;
+       struct tee_ioctl_param __user *uparams = NULL;
+       struct tee_param *params = NULL;
+
+       if (!ctx->teedev->desc->ops->invoke_func)
+               return -EINVAL;
+
+       if (copy_from_user(&buf, ubuf, sizeof(buf)))
+               return -EFAULT;
+
+       if (buf.buf_len > TEE_MAX_ARG_SIZE ||
+           buf.buf_len < sizeof(struct tee_ioctl_invoke_arg))
+               return -EINVAL;
+
+       uarg = u64_to_user_ptr(buf.buf_ptr);
+       if (copy_from_user(&arg, uarg, sizeof(arg)))
+               return -EFAULT;
+
+       if (sizeof(arg) + TEE_IOCTL_PARAM_SIZE(arg.num_params) != buf.buf_len)
+               return -EINVAL;
+
+       if (arg.num_params) {
+               params = kcalloc(arg.num_params, sizeof(struct tee_param),
+                                GFP_KERNEL);
+               if (!params)
+                       return -ENOMEM;
+               uparams = uarg->params;
+               rc = params_from_user(ctx, params, arg.num_params, uparams);
+               if (rc)
+                       goto out;
+       }
+
+       rc = ctx->teedev->desc->ops->invoke_func(ctx, &arg, params);
+       if (rc)
+               goto out;
+
+       if (put_user(arg.ret, &uarg->ret) ||
+           put_user(arg.ret_origin, &uarg->ret_origin)) {
+               rc = -EFAULT;
+               goto out;
+       }
+       rc = params_to_user(uparams, arg.num_params, params);
+out:
+       if (params) {
+               /* Decrease ref count for all valid shared memory pointers */
+               for (n = 0; n < arg.num_params; n++)
+                       if (tee_param_is_memref(params + n) &&
+                           params[n].u.memref.shm)
+                               tee_shm_put(params[n].u.memref.shm);
+               kfree(params);
+       }
+       return rc;
+}
+
+static int tee_ioctl_cancel(struct tee_context *ctx,
+                           struct tee_ioctl_cancel_arg __user *uarg)
+{
+       struct tee_ioctl_cancel_arg arg;
+
+       if (!ctx->teedev->desc->ops->cancel_req)
+               return -EINVAL;
+
+       if (copy_from_user(&arg, uarg, sizeof(arg)))
+               return -EFAULT;
+
+       return ctx->teedev->desc->ops->cancel_req(ctx, arg.cancel_id,
+                                                 arg.session);
+}
+
+static int
+tee_ioctl_close_session(struct tee_context *ctx,
+                       struct tee_ioctl_close_session_arg __user *uarg)
+{
+       struct tee_ioctl_close_session_arg arg;
+
+       if (!ctx->teedev->desc->ops->close_session)
+               return -EINVAL;
+
+       if (copy_from_user(&arg, uarg, sizeof(arg)))
+               return -EFAULT;
+
+       return ctx->teedev->desc->ops->close_session(ctx, arg.session);
+}
+
+static int params_to_supp(struct tee_context *ctx,
+                         struct tee_ioctl_param __user *uparams,
+                         size_t num_params, struct tee_param *params)
+{
+       size_t n;
+
+       for (n = 0; n < num_params; n++) {
+               struct tee_ioctl_param ip;
+               struct tee_param *p = params + n;
+
+               ip.attr = p->attr;
+               switch (p->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
+                       ip.a = p->u.value.a;
+                       ip.b = p->u.value.b;
+                       ip.c = p->u.value.c;
+                       break;
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
+                       ip.b = p->u.memref.size;
+                       if (!p->u.memref.shm) {
+                               ip.a = 0;
+                               ip.c = (u64)-1; /* invalid shm id */
+                               break;
+                       }
+                       ip.a = p->u.memref.shm_offs;
+                       ip.c = p->u.memref.shm->id;
+                       break;
+               default:
+                       ip.a = 0;
+                       ip.b = 0;
+                       ip.c = 0;
+                       break;
+               }
+
+               if (copy_to_user(uparams + n, &ip, sizeof(ip)))
+                       return -EFAULT;
+       }
+
+       return 0;
+}
+
+static int tee_ioctl_supp_recv(struct tee_context *ctx,
+                              struct tee_ioctl_buf_data __user *ubuf)
+{
+       int rc;
+       struct tee_ioctl_buf_data buf;
+       struct tee_iocl_supp_recv_arg __user *uarg;
+       struct tee_param *params;
+       u32 num_params;
+       u32 func;
+
+       if (!ctx->teedev->desc->ops->supp_recv)
+               return -EINVAL;
+
+       if (copy_from_user(&buf, ubuf, sizeof(buf)))
+               return -EFAULT;
+
+       if (buf.buf_len > TEE_MAX_ARG_SIZE ||
+           buf.buf_len < sizeof(struct tee_iocl_supp_recv_arg))
+               return -EINVAL;
+
+       uarg = u64_to_user_ptr(buf.buf_ptr);
+       if (get_user(num_params, &uarg->num_params))
+               return -EFAULT;
+
+       if (sizeof(*uarg) + TEE_IOCTL_PARAM_SIZE(num_params) != buf.buf_len)
+               return -EINVAL;
+
+       params = kcalloc(num_params, sizeof(struct tee_param), GFP_KERNEL);
+       if (!params)
+               return -ENOMEM;
+
+       rc = params_from_user(ctx, params, num_params, uarg->params);
+       if (rc)
+               goto out;
+
+       rc = ctx->teedev->desc->ops->supp_recv(ctx, &func, &num_params, params);
+       if (rc)
+               goto out;
+
+       if (put_user(func, &uarg->func) ||
+           put_user(num_params, &uarg->num_params)) {
+               rc = -EFAULT;
+               goto out;
+       }
+
+       rc = params_to_supp(ctx, uarg->params, num_params, params);
+out:
+       kfree(params);
+       return rc;
+}
+
+static int params_from_supp(struct tee_param *params, size_t num_params,
+                           struct tee_ioctl_param __user *uparams)
+{
+       size_t n;
+
+       for (n = 0; n < num_params; n++) {
+               struct tee_param *p = params + n;
+               struct tee_ioctl_param ip;
+
+               if (copy_from_user(&ip, uparams + n, sizeof(ip)))
+                       return -EFAULT;
+
+               /* All unused attribute bits has to be zero */
+               if (ip.attr & ~TEE_IOCTL_PARAM_ATTR_MASK)
+                       return -EINVAL;
+
+               p->attr = ip.attr;
+               switch (ip.attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) {
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_VALUE_INOUT:
+                       /* Only out and in/out values can be updated */
+                       p->u.value.a = ip.a;
+                       p->u.value.b = ip.b;
+                       p->u.value.c = ip.c;
+                       break;
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT:
+               case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT:
+                       /*
+                        * Only the size of the memref can be updated.
+                        * Since we don't have access to the original
+                        * parameters here, only store the supplied size.
+                        * The driver will copy the updated size into the
+                        * original parameters.
+                        */
+                       p->u.memref.shm = NULL;
+                       p->u.memref.shm_offs = 0;
+                       p->u.memref.size = ip.b;
+                       break;
+               default:
+                       memset(&p->u, 0, sizeof(p->u));
+                       break;
+               }
+       }
+       return 0;
+}
+
+static int tee_ioctl_supp_send(struct tee_context *ctx,
+                              struct tee_ioctl_buf_data __user *ubuf)
+{
+       long rc;
+       struct tee_ioctl_buf_data buf;
+       struct tee_iocl_supp_send_arg __user *uarg;
+       struct tee_param *params;
+       u32 num_params;
+       u32 ret;
+
+       /* Not valid for this driver */
+       if (!ctx->teedev->desc->ops->supp_send)
+               return -EINVAL;
+
+       if (copy_from_user(&buf, ubuf, sizeof(buf)))
+               return -EFAULT;
+
+       if (buf.buf_len > TEE_MAX_ARG_SIZE ||
+           buf.buf_len < sizeof(struct tee_iocl_supp_send_arg))
+               return -EINVAL;
+
+       uarg = u64_to_user_ptr(buf.buf_ptr);
+       if (get_user(ret, &uarg->ret) ||
+           get_user(num_params, &uarg->num_params))
+               return -EFAULT;
+
+       if (sizeof(*uarg) + TEE_IOCTL_PARAM_SIZE(num_params) > buf.buf_len)
+               return -EINVAL;
+
+       params = kcalloc(num_params, sizeof(struct tee_param), GFP_KERNEL);
+       if (!params)
+               return -ENOMEM;
+
+       rc = params_from_supp(params, num_params, uarg->params);
+       if (rc)
+               goto out;
+
+       rc = ctx->teedev->desc->ops->supp_send(ctx, ret, num_params, params);
+out:
+       kfree(params);
+       return rc;
+}
+
+static long tee_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
+{
+       struct tee_context *ctx = filp->private_data;
+       void __user *uarg = (void __user *)arg;
+
+       switch (cmd) {
+       case TEE_IOC_VERSION:
+               return tee_ioctl_version(ctx, uarg);
+       case TEE_IOC_SHM_ALLOC:
+               return tee_ioctl_shm_alloc(ctx, uarg);
+       case TEE_IOC_SHM_REGISTER_FD:
+               return tee_ioctl_shm_register_fd(ctx, uarg);
+       case TEE_IOC_OPEN_SESSION:
+               return tee_ioctl_open_session(ctx, uarg);
+       case TEE_IOC_INVOKE:
+               return tee_ioctl_invoke(ctx, uarg);
+       case TEE_IOC_CANCEL:
+               return tee_ioctl_cancel(ctx, uarg);
+       case TEE_IOC_CLOSE_SESSION:
+               return tee_ioctl_close_session(ctx, uarg);
+       case TEE_IOC_SUPPL_RECV:
+               return tee_ioctl_supp_recv(ctx, uarg);
+       case TEE_IOC_SUPPL_SEND:
+               return tee_ioctl_supp_send(ctx, uarg);
+       default:
+               return -EINVAL;
+       }
+}
+
+static const struct file_operations tee_fops = {
+       .owner = THIS_MODULE,
+       .open = tee_open,
+       .release = tee_release,
+       .unlocked_ioctl = tee_ioctl,
+       .compat_ioctl = tee_ioctl,
+};
+
+static void tee_release_device(struct device *dev)
+{
+       struct tee_device *teedev = container_of(dev, struct tee_device, dev);
+
+       spin_lock(&driver_lock);
+       clear_bit(teedev->id, dev_mask);
+       spin_unlock(&driver_lock);
+       mutex_destroy(&teedev->mutex);
+       idr_destroy(&teedev->idr);
+       kfree(teedev);
+}
+
+/**
+ * tee_device_alloc() - Allocate a new struct tee_device instance
+ * @teedesc:   Descriptor for this driver
+ * @dev:       Parent device for this device
+ * @pool:      Shared memory pool, NULL if not used
+ * @driver_data: Private driver data for this device
+ *
+ * Allocates a new struct tee_device instance. The device is
+ * removed by tee_device_unregister().
+ *
+ * @returns a pointer to a 'struct tee_device' or an ERR_PTR on failure
+ */
+struct tee_device *tee_device_alloc(const struct tee_desc *teedesc,
+                                   struct device *dev,
+                                   struct tee_shm_pool *pool,
+                                   void *driver_data)
+{
+       struct tee_device *teedev;
+       void *ret;
+       int rc;
+       int offs = 0;
+
+       if (!teedesc || !teedesc->name || !teedesc->ops ||
+           !teedesc->ops->get_version || !teedesc->ops->open ||
+           !teedesc->ops->release || !pool)
+               return ERR_PTR(-EINVAL);
+
+       teedev = kzalloc(sizeof(*teedev), GFP_KERNEL);
+       if (!teedev) {
+               ret = ERR_PTR(-ENOMEM);
+               goto err;
+       }
+
+       if (teedesc->flags & TEE_DESC_PRIVILEGED)
+               offs = TEE_NUM_DEVICES / 2;
+
+       spin_lock(&driver_lock);
+       teedev->id = find_next_zero_bit(dev_mask, TEE_NUM_DEVICES, offs);
+       if (teedev->id < TEE_NUM_DEVICES)
+               set_bit(teedev->id, dev_mask);
+       spin_unlock(&driver_lock);
+
+       if (teedev->id >= TEE_NUM_DEVICES) {
+               ret = ERR_PTR(-ENOMEM);
+               goto err;
+       }
+
+       snprintf(teedev->name, sizeof(teedev->name), "tee%s%d",
+                teedesc->flags & TEE_DESC_PRIVILEGED ? "priv" : "",
+                teedev->id - offs);
+
+       teedev->dev.class = tee_class;
+       teedev->dev.release = tee_release_device;
+       teedev->dev.parent = dev;
+
+       teedev->dev.devt = MKDEV(MAJOR(tee_devt), teedev->id);
+
+       rc = dev_set_name(&teedev->dev, "%s", teedev->name);
+       if (rc) {
+               ret = ERR_PTR(rc);
+               goto err_devt;
+       }
+
+       cdev_init(&teedev->cdev, &tee_fops);
+       teedev->cdev.owner = teedesc->owner;
+       teedev->cdev.kobj.parent = &teedev->dev.kobj;
+
+       dev_set_drvdata(&teedev->dev, driver_data);
+       device_initialize(&teedev->dev);
+
+       /* 1 as tee_device_unregister() does one final tee_device_put() */
+       teedev->num_users = 1;
+       init_completion(&teedev->c_no_users);
+       mutex_init(&teedev->mutex);
+       idr_init(&teedev->idr);
+
+       teedev->desc = teedesc;
+       teedev->pool = pool;
+
+       return teedev;
+err_devt:
+       unregister_chrdev_region(teedev->dev.devt, 1);
+err:
+       pr_err("could not register %s driver\n",
+              teedesc->flags & TEE_DESC_PRIVILEGED ? "privileged" : "client");
+       if (teedev && teedev->id < TEE_NUM_DEVICES) {
+               spin_lock(&driver_lock);
+               clear_bit(teedev->id, dev_mask);
+               spin_unlock(&driver_lock);
+       }
+       kfree(teedev);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(tee_device_alloc);
+
+static ssize_t implementation_id_show(struct device *dev,
+                                     struct device_attribute *attr, char *buf)
+{
+       struct tee_device *teedev = container_of(dev, struct tee_device, dev);
+       struct tee_ioctl_version_data vers;
+
+       teedev->desc->ops->get_version(teedev, &vers);
+       return scnprintf(buf, PAGE_SIZE, "%d\n", vers.impl_id);
+}
+static DEVICE_ATTR_RO(implementation_id);
+
+static struct attribute *tee_dev_attrs[] = {
+       &dev_attr_implementation_id.attr,
+       NULL
+};
+
+static const struct attribute_group tee_dev_group = {
+       .attrs = tee_dev_attrs,
+};
+
+/**
+ * tee_device_register() - Registers a TEE device
+ * @teedev:    Device to register
+ *
+ * tee_device_unregister() need to be called to remove the @teedev if
+ * this function fails.
+ *
+ * @returns < 0 on failure
+ */
+int tee_device_register(struct tee_device *teedev)
+{
+       int rc;
+
+       if (teedev->flags & TEE_DEVICE_FLAG_REGISTERED) {
+               dev_err(&teedev->dev, "attempt to register twice\n");
+               return -EINVAL;
+       }
+
+       rc = cdev_add(&teedev->cdev, teedev->dev.devt, 1);
+       if (rc) {
+               dev_err(&teedev->dev,
+                       "unable to cdev_add() %s, major %d, minor %d, err=%d\n",
+                       teedev->name, MAJOR(teedev->dev.devt),
+                       MINOR(teedev->dev.devt), rc);
+               return rc;
+       }
+
+       rc = device_add(&teedev->dev);
+       if (rc) {
+               dev_err(&teedev->dev,
+                       "unable to device_add() %s, major %d, minor %d, err=%d\n",
+                       teedev->name, MAJOR(teedev->dev.devt),
+                       MINOR(teedev->dev.devt), rc);
+               goto err_device_add;
+       }
+
+       rc = sysfs_create_group(&teedev->dev.kobj, &tee_dev_group);
+       if (rc) {
+               dev_err(&teedev->dev,
+                       "failed to create sysfs attributes, err=%d\n", rc);
+               goto err_sysfs_create_group;
+       }
+
+       teedev->flags |= TEE_DEVICE_FLAG_REGISTERED;
+       return 0;
+
+err_sysfs_create_group:
+       device_del(&teedev->dev);
+err_device_add:
+       cdev_del(&teedev->cdev);
+       return rc;
+}
+EXPORT_SYMBOL_GPL(tee_device_register);
+
+void tee_device_put(struct tee_device *teedev)
+{
+       mutex_lock(&teedev->mutex);
+       /* Shouldn't put in this state */
+       if (!WARN_ON(!teedev->desc)) {
+               teedev->num_users--;
+               if (!teedev->num_users) {
+                       teedev->desc = NULL;
+                       complete(&teedev->c_no_users);
+               }
+       }
+       mutex_unlock(&teedev->mutex);
+}
+
+bool tee_device_get(struct tee_device *teedev)
+{
+       mutex_lock(&teedev->mutex);
+       if (!teedev->desc) {
+               mutex_unlock(&teedev->mutex);
+               return false;
+       }
+       teedev->num_users++;
+       mutex_unlock(&teedev->mutex);
+       return true;
+}
+
+/**
+ * tee_device_unregister() - Removes a TEE device
+ * @teedev:    Device to unregister
+ *
+ * This function should be called to remove the @teedev even if
+ * tee_device_register() hasn't been called yet. Does nothing if
+ * @teedev is NULL.
+ */
+void tee_device_unregister(struct tee_device *teedev)
+{
+       if (!teedev)
+               return;
+
+       if (teedev->flags & TEE_DEVICE_FLAG_REGISTERED) {
+               sysfs_remove_group(&teedev->dev.kobj, &tee_dev_group);
+               cdev_del(&teedev->cdev);
+               device_del(&teedev->dev);
+       }
+
+       tee_device_put(teedev);
+       wait_for_completion(&teedev->c_no_users);
+
+       /*
+        * No need to take a mutex any longer now since teedev->desc was
+        * set to NULL before teedev->c_no_users was completed.
+        */
+
+       teedev->pool = NULL;
+
+       put_device(&teedev->dev);
+}
+EXPORT_SYMBOL_GPL(tee_device_unregister);
+
+/**
+ * tee_get_drvdata() - Return driver_data pointer
+ * @teedev:    Device containing the driver_data pointer
+ * @returns the driver_data pointer supplied to tee_register().
+ */
+void *tee_get_drvdata(struct tee_device *teedev)
+{
+       return dev_get_drvdata(&teedev->dev);
+}
+EXPORT_SYMBOL_GPL(tee_get_drvdata);
+
+struct match_dev_data {
+       struct tee_ioctl_version_data *vers;
+       const void *data;
+       int (*match)(struct tee_ioctl_version_data *, const void *);
+};
+
+static int match_dev(struct device *dev, const void *data)
+{
+       const struct match_dev_data *match_data = data;
+       struct tee_device *teedev = container_of(dev, struct tee_device, dev);
+
+       teedev->desc->ops->get_version(teedev, match_data->vers);
+       return match_data->match(match_data->vers, match_data->data);
+}
+
+struct tee_context *tee_client_open_context(struct tee_context *start,
+                       int (*match)(struct tee_ioctl_version_data *,
+                               const void *),
+                       const void *data, struct tee_ioctl_version_data *vers)
+{
+       struct device *dev = NULL;
+       struct device *put_dev = NULL;
+       struct tee_context *ctx = NULL;
+       struct tee_ioctl_version_data v;
+       struct match_dev_data match_data = { vers ? vers : &v, data, match };
+
+       if (start)
+               dev = &start->teedev->dev;
+
+       do {
+               dev = class_find_device(tee_class, dev, &match_data, match_dev);
+               if (!dev) {
+                       ctx = ERR_PTR(-ENOENT);
+                       break;
+               }
+
+               put_device(put_dev);
+               put_dev = dev;
+
+               ctx = teedev_open(container_of(dev, struct tee_device, dev));
+       } while (IS_ERR(ctx) && PTR_ERR(ctx) != -ENOMEM);
+
+       put_device(put_dev);
+       return ctx;
+}
+EXPORT_SYMBOL_GPL(tee_client_open_context);
+
+void tee_client_close_context(struct tee_context *ctx)
+{
+       teedev_close_context(ctx);
+}
+
+EXPORT_SYMBOL_GPL(tee_client_close_context);
+
+void tee_client_get_version(struct tee_context *ctx,
+                       struct tee_ioctl_version_data *vers)
+{
+       ctx->teedev->desc->ops->get_version(ctx->teedev, vers);
+}
+EXPORT_SYMBOL_GPL(tee_client_get_version);
+
+
+int tee_client_open_session(struct tee_context *ctx,
+                       struct tee_ioctl_open_session_arg *arg,
+                       struct tee_param *param)
+{
+       if (!ctx->teedev->desc->ops->open_session)
+               return -EINVAL;
+       return ctx->teedev->desc->ops->open_session(ctx, arg, param);
+}
+EXPORT_SYMBOL_GPL(tee_client_open_session);
+
+int tee_client_close_session(struct tee_context *ctx, u32 session)
+{
+       if (!ctx->teedev->desc->ops->close_session)
+               return -EINVAL;
+       return ctx->teedev->desc->ops->close_session(ctx, session);
+}
+EXPORT_SYMBOL_GPL(tee_client_close_session);
+
+int tee_client_invoke_func(struct tee_context *ctx,
+                       struct tee_ioctl_invoke_arg *arg,
+                       struct tee_param *param)
+{
+       if (!ctx->teedev->desc->ops->invoke_func)
+               return -EINVAL;
+       return ctx->teedev->desc->ops->invoke_func(ctx, arg, param);
+}
+EXPORT_SYMBOL_GPL(tee_client_invoke_func);
+
+static int __init tee_init(void)
+{
+       int rc;
+
+       tee_class = class_create(THIS_MODULE, "tee");
+       if (IS_ERR(tee_class)) {
+               pr_err("couldn't create class\n");
+               return PTR_ERR(tee_class);
+       }
+
+       rc = alloc_chrdev_region(&tee_devt, 0, TEE_NUM_DEVICES, "tee");
+       if (rc) {
+               pr_err("failed to allocate char dev region\n");
+               class_destroy(tee_class);
+               tee_class = NULL;
+       }
+
+       return rc;
+}
+
+static void __exit tee_exit(void)
+{
+       class_destroy(tee_class);
+       tee_class = NULL;
+       unregister_chrdev_region(tee_devt, TEE_NUM_DEVICES);
+}
+
+subsys_initcall(tee_init);
+module_exit(tee_exit);
+
+MODULE_AUTHOR("Linaro");
+MODULE_DESCRIPTION("TEE Driver");
+MODULE_VERSION("1.0");
+MODULE_LICENSE("GPL v2");
diff --git a/tee_core.o b/tee_core.o
new file mode 100644 (file)
index 0000000..3b14afc
Binary files /dev/null and b/tee_core.o differ
diff --git a/tee_private.h b/tee_private.h
new file mode 100755 (executable)
index 0000000..21cb6be
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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.
+ *
+ */
+#ifndef TEE_PRIVATE_H
+#define TEE_PRIVATE_H
+
+#include <linux/cdev.h>
+#include <linux/completion.h>
+#include <linux/device.h>
+#include <linux/kref.h>
+#include <linux/mutex.h>
+#include <linux/types.h>
+
+struct tee_device;
+
+/**
+ * struct tee_shm - shared memory object
+ * @teedev:    device used to allocate the object
+ * @ctx:       context using the object, if NULL the context is gone
+ * @link       link element
+ * @paddr:     physical address of the shared memory
+ * @kaddr:     virtual address of the shared memory
+ * @size:      size of shared memory
+ * @dmabuf:    dmabuf used to for exporting to user space
+ * @flags:     defined by TEE_SHM_* in tee_drv.h
+ * @id:                unique id of a shared memory object on this device
+ */
+struct tee_shm {
+       struct tee_device *teedev;
+       struct tee_context *ctx;
+       struct list_head link;
+       phys_addr_t paddr;
+       void *kaddr;
+       size_t size;
+       struct dma_buf *dmabuf;
+       u32 flags;
+       int id;
+};
+
+struct tee_shm_pool_mgr;
+
+/**
+ * struct tee_shm_pool_mgr_ops - shared memory pool manager operations
+ * @alloc:     called when allocating shared memory
+ * @free:      called when freeing shared memory
+ */
+struct tee_shm_pool_mgr_ops {
+       int (*alloc)(struct tee_shm_pool_mgr *poolmgr, struct tee_shm *shm,
+                    size_t size);
+       void (*free)(struct tee_shm_pool_mgr *poolmgr, struct tee_shm *shm);
+};
+
+/**
+ * struct tee_shm_pool_mgr - shared memory manager
+ * @ops:               operations
+ * @private_data:      private data for the shared memory manager
+ */
+struct tee_shm_pool_mgr {
+       const struct tee_shm_pool_mgr_ops *ops;
+       void *private_data;
+};
+
+/**
+ * struct tee_shm_pool - shared memory pool
+ * @private_mgr:       pool manager for shared memory only between kernel
+ *                     and secure world
+ * @dma_buf_mgr:       pool manager for shared memory exported to user space
+ * @destroy:           called when destroying the pool
+ * @private_data:      private data for the pool
+ */
+struct tee_shm_pool {
+       struct tee_shm_pool_mgr private_mgr;
+       struct tee_shm_pool_mgr dma_buf_mgr;
+       void (*destroy)(struct tee_shm_pool *pool);
+       void *private_data;
+};
+
+#define TEE_DEVICE_FLAG_REGISTERED     0x1
+#define TEE_MAX_DEV_NAME_LEN           32
+
+/**
+ * struct tee_device - TEE Device representation
+ * @name:      name of device
+ * @desc:      description of device
+ * @id:                unique id of device
+ * @flags:     represented by TEE_DEVICE_FLAG_REGISTERED above
+ * @dev:       embedded basic device structure
+ * @cdev:      embedded cdev
+ * @num_users: number of active users of this device
+ * @c_no_user: completion used when unregistering the device
+ * @mutex:     mutex protecting @num_users and @idr
+ * @idr:       register of shared memory object allocated on this device
+ * @pool:      shared memory pool
+ */
+struct tee_device {
+       char name[TEE_MAX_DEV_NAME_LEN];
+       const struct tee_desc *desc;
+       int id;
+       unsigned int flags;
+
+       struct device dev;
+       struct cdev cdev;
+
+       size_t num_users;
+       struct completion c_no_users;
+       struct mutex mutex;     /* protects num_users and idr */
+
+       struct idr idr;
+       struct tee_shm_pool *pool;
+};
+
+int tee_shm_init(void);
+
+int tee_shm_get_fd(struct tee_shm *shm);
+
+bool tee_device_get(struct tee_device *teedev);
+void tee_device_put(struct tee_device *teedev);
+
+#endif /*TEE_PRIVATE_H*/
diff --git a/tee_shm.c b/tee_shm.c
new file mode 100755 (executable)
index 0000000..b820d4b
--- /dev/null
+++ b/tee_shm.c
@@ -0,0 +1,488 @@
+/*
+ * Copyright (c) 2015-2016, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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/device.h>
+#include <linux/dma-buf.h>
+#include <linux/fdtable.h>
+#include <linux/idr.h>
+#include <linux/sched.h>
+#include <linux/slab.h>
+#include <generated/uapi/linux/version.h>
+#include "tee_drv.h"
+#include "tee_private.h"
+
+/* extra references appended to shm object for registered shared memory */
+struct tee_shm_dmabuf_ref {
+     struct tee_shm shm;
+     struct dma_buf *dmabuf;
+     struct dma_buf_attachment *attach;
+     struct sg_table *sgt;
+};
+
+static void tee_shm_release(struct tee_shm *shm)
+{
+       struct tee_device *teedev = shm->teedev;
+
+       mutex_lock(&teedev->mutex);
+       idr_remove(&teedev->idr, shm->id);
+       if (shm->ctx)
+               list_del(&shm->link);
+       mutex_unlock(&teedev->mutex);
+
+       if (shm->flags & TEE_SHM_EXT_DMA_BUF) {
+               struct tee_shm_dmabuf_ref *ref;
+
+               ref = container_of(shm, struct tee_shm_dmabuf_ref, shm);
+               dma_buf_unmap_attachment(ref->attach, ref->sgt,
+                                        DMA_BIDIRECTIONAL);
+               dma_buf_detach(shm->dmabuf, ref->attach);
+               dma_buf_put(ref->dmabuf);
+       } else {
+               struct tee_shm_pool_mgr *poolm;
+
+               if (shm->flags & TEE_SHM_DMA_BUF)
+                       poolm = &teedev->pool->dma_buf_mgr;
+               else
+                       poolm = &teedev->pool->private_mgr;
+
+               poolm->ops->free(poolm, shm);
+       }
+
+       kfree(shm);
+       tee_device_put(teedev);
+}
+
+static struct sg_table *tee_shm_op_map_dma_buf(struct dma_buf_attachment
+                       *attach, enum dma_data_direction dir)
+{
+       return NULL;
+}
+
+static void tee_shm_op_unmap_dma_buf(struct dma_buf_attachment *attach,
+                                    struct sg_table *table,
+                                    enum dma_data_direction dir)
+{
+}
+
+static void tee_shm_op_release(struct dma_buf *dmabuf)
+{
+       struct tee_shm *shm = dmabuf->priv;
+
+       tee_shm_release(shm);
+}
+
+static void *tee_shm_op_kmap_atomic(struct dma_buf *dmabuf, unsigned long pgnum)
+{
+       return NULL;
+}
+
+static void *tee_shm_op_kmap(struct dma_buf *dmabuf, unsigned long pgnum)
+{
+       return NULL;
+}
+
+static int tee_shm_op_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
+{
+       struct tee_shm *shm = dmabuf->priv;
+       size_t size = vma->vm_end - vma->vm_start;
+
+       return remap_pfn_range(vma, vma->vm_start, shm->paddr >> PAGE_SHIFT,
+                              size, vma->vm_page_prot);
+}
+
+static struct dma_buf_ops tee_shm_dma_buf_ops = {
+       .map_dma_buf = tee_shm_op_map_dma_buf,
+       .unmap_dma_buf = tee_shm_op_unmap_dma_buf,
+       .release = tee_shm_op_release,
+       .kmap_atomic = tee_shm_op_kmap_atomic,
+       .kmap = tee_shm_op_kmap,
+       .mmap = tee_shm_op_mmap,
+};
+
+/**
+ * tee_shm_alloc() - Allocate shared memory
+ * @ctx:       Context that allocates the shared memory
+ * @size:      Requested size of shared memory
+ * @flags:     Flags setting properties for the requested shared memory.
+ *
+ * Memory allocated as global shared memory is automatically freed when the
+ * TEE file pointer is closed. The @flags field uses the bits defined by
+ * TEE_SHM_* in <linux/tee_drv.h>. TEE_SHM_MAPPED must currently always be
+ * set. If TEE_SHM_DMA_BUF global shared memory will be allocated and
+ * associated with a dma-buf handle, else driver private memory.
+ */
+struct tee_shm *tee_shm_alloc(struct tee_context *ctx, size_t size, u32 flags)
+{
+       struct tee_device *teedev = ctx->teedev;
+       struct tee_shm_pool_mgr *poolm = NULL;
+       struct tee_shm *shm;
+       void *ret;
+       int rc;
+
+       if (!(flags & TEE_SHM_MAPPED)) {
+               dev_err(teedev->dev.parent,
+                       "only mapped allocations supported\n");
+               return ERR_PTR(-EINVAL);
+       }
+
+       if ((flags & ~(TEE_SHM_MAPPED | TEE_SHM_DMA_BUF))) {
+               dev_err(teedev->dev.parent, "invalid shm flags 0x%x", flags);
+               return ERR_PTR(-EINVAL);
+       }
+
+       if (!tee_device_get(teedev))
+               return ERR_PTR(-EINVAL);
+
+       if (!teedev->pool) {
+               /* teedev has been detached from driver */
+               ret = ERR_PTR(-EINVAL);
+               goto err_dev_put;
+       }
+
+       shm = kzalloc(sizeof(*shm), GFP_KERNEL);
+       if (!shm) {
+               ret = ERR_PTR(-ENOMEM);
+               goto err_dev_put;
+       }
+
+       shm->flags = flags;
+       shm->teedev = teedev;
+       shm->ctx = ctx;
+       if (flags & TEE_SHM_DMA_BUF)
+               poolm = &teedev->pool->dma_buf_mgr;
+       else
+               poolm = &teedev->pool->private_mgr;
+
+       rc = poolm->ops->alloc(poolm, shm, size);
+       if (rc) {
+               ret = ERR_PTR(rc);
+               goto err_kfree;
+       }
+
+       mutex_lock(&teedev->mutex);
+       shm->id = idr_alloc(&teedev->idr, shm, 1, 0, GFP_KERNEL);
+       mutex_unlock(&teedev->mutex);
+       if (shm->id < 0) {
+               ret = ERR_PTR(shm->id);
+               goto err_pool_free;
+       }
+
+       if (flags & TEE_SHM_DMA_BUF) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,16))
+               DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
+
+               exp_info.ops = &tee_shm_dma_buf_ops;
+               exp_info.size = shm->size;
+               exp_info.flags = O_RDWR;
+               exp_info.priv = shm;
+
+               shm->dmabuf = dma_buf_export(&exp_info);
+#else
+               shm->dmabuf = dma_buf_export(shm, &tee_shm_dma_buf_ops,
+                                            shm->size, O_RDWR);
+#endif
+               if (IS_ERR(shm->dmabuf)) {
+                       ret = ERR_CAST(shm->dmabuf);
+                       goto err_rem;
+               }
+       }
+       mutex_lock(&teedev->mutex);
+       list_add_tail(&shm->link, &ctx->list_shm);
+       mutex_unlock(&teedev->mutex);
+
+       return shm;
+err_rem:
+       mutex_lock(&teedev->mutex);
+       idr_remove(&teedev->idr, shm->id);
+       mutex_unlock(&teedev->mutex);
+err_pool_free:
+       poolm->ops->free(poolm, shm);
+err_kfree:
+       kfree(shm);
+err_dev_put:
+       tee_device_put(teedev);
+       return ret;
+}
+EXPORT_SYMBOL_GPL(tee_shm_alloc);
+
+struct tee_shm *tee_shm_register_fd(struct tee_context *ctx, int fd)
+{
+       struct tee_shm_dmabuf_ref *ref;
+       void *rc;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,16))
+       DEFINE_DMA_BUF_EXPORT_INFO(exp_info);
+#endif
+
+       if (!tee_device_get(ctx->teedev))
+               return ERR_PTR(-EINVAL);
+
+       ref = kzalloc(sizeof(*ref), GFP_KERNEL);
+       if (!ref) {
+               rc = ERR_PTR(-ENOMEM);
+               goto err;
+       }
+
+       ref->shm.ctx = ctx;
+       ref->shm.teedev = ctx->teedev;
+       ref->shm.id = -1;
+
+       ref->dmabuf = dma_buf_get(fd);
+       if (!ref->dmabuf) {
+               rc = ERR_PTR(-EINVAL);
+               goto err;
+       }
+
+       ref->attach = dma_buf_attach(ref->dmabuf, &ref->shm.teedev->dev);
+       if (IS_ERR_OR_NULL(ref->attach)) {
+               rc = ERR_PTR(-EINVAL);
+               goto err;
+       }
+
+       ref->sgt = dma_buf_map_attachment(ref->attach, DMA_BIDIRECTIONAL);
+       if (IS_ERR_OR_NULL(ref->sgt)) {
+               rc = ERR_PTR(-EINVAL);
+               goto err;
+       }
+
+       if (sg_nents(ref->sgt->sgl) != 1) {
+               rc = ERR_PTR(-EINVAL);
+               goto err;
+       }
+
+       ref->shm.paddr = sg_dma_address(ref->sgt->sgl);
+       ref->shm.size = sg_dma_len(ref->sgt->sgl);
+       ref->shm.flags = TEE_SHM_DMA_BUF | TEE_SHM_EXT_DMA_BUF;
+
+       mutex_lock(&ref->shm.teedev->mutex);
+       ref->shm.id = idr_alloc(&ref->shm.teedev->idr, &ref->shm,
+                               1, 0, GFP_KERNEL);
+       mutex_unlock(&ref->shm.teedev->mutex);
+       if (ref->shm.id < 0) {
+               rc = ERR_PTR(ref->shm.id);
+               goto err;
+       }
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,16))
+       /* export a dmabuf to later get a userland ref */
+       exp_info.ops = &tee_shm_dma_buf_ops;
+       exp_info.size = ref->shm.size;
+       exp_info.flags = O_RDWR;
+       exp_info.priv = &ref->shm;
+
+       ref->shm.dmabuf = dma_buf_export(&exp_info);
+#else
+       ref->shm.dmabuf = dma_buf_export(&ref->shm, &tee_shm_dma_buf_ops,
+                                            ref->shm.size, O_RDWR);
+#endif
+       if (IS_ERR(ref->shm.dmabuf)) {
+               rc = ERR_PTR(-EINVAL);
+               goto err;
+       }
+
+       mutex_lock(&ref->shm.teedev->mutex);
+       list_add_tail(&ref->shm.link, &ctx->list_shm);
+       mutex_unlock(&ref->shm.teedev->mutex);
+
+       return &ref->shm;
+
+err:
+       if (ref) {
+               if (ref->shm.id >= 0) {
+                       mutex_lock(&ctx->teedev->mutex);
+                       idr_remove(&ctx->teedev->idr, ref->shm.id);
+                       mutex_unlock(&ctx->teedev->mutex);
+               }
+               if (ref->sgt)
+                       dma_buf_unmap_attachment(ref->attach, ref->sgt,
+                                                DMA_BIDIRECTIONAL);
+               if (ref->attach)
+                       dma_buf_detach(ref->dmabuf, ref->attach);
+               if (ref->dmabuf)
+                       dma_buf_put(ref->dmabuf);
+       }
+       kfree(ref);
+       tee_device_put(ctx->teedev);
+       return rc;
+}
+EXPORT_SYMBOL_GPL(tee_shm_register_fd);
+
+/**
+ * tee_shm_get_fd() - Increase reference count and return file descriptor
+ * @shm:       Shared memory handle
+ * @returns user space file descriptor to shared memory
+ */
+int tee_shm_get_fd(struct tee_shm *shm)
+{
+       int fd;
+
+       if (!(shm->flags & TEE_SHM_DMA_BUF))
+               return -EINVAL;
+
+       fd = dma_buf_fd(shm->dmabuf, O_CLOEXEC);
+       if (fd >= 0)
+               get_dma_buf(shm->dmabuf);
+       return fd;
+}
+
+/**
+ * tee_shm_free() - Free shared memory
+ * @shm:       Handle to shared memory to free
+ */
+void tee_shm_free(struct tee_shm *shm)
+{
+       /*
+        * dma_buf_put() decreases the dmabuf reference counter and will
+        * call tee_shm_release() when the last reference is gone.
+        *
+        * In the case of driver private memory we call tee_shm_release
+        * directly instead as it doesn't have a reference counter.
+        */
+       if (shm->flags & TEE_SHM_DMA_BUF)
+               dma_buf_put(shm->dmabuf);
+       else
+               tee_shm_release(shm);
+}
+EXPORT_SYMBOL_GPL(tee_shm_free);
+
+/**
+ * tee_shm_va2pa() - Get physical address of a virtual address
+ * @shm:       Shared memory handle
+ * @va:                Virtual address to tranlsate
+ * @pa:                Returned physical address
+ * @returns 0 on success and < 0 on failure
+ */
+int tee_shm_va2pa(struct tee_shm *shm, void *va, phys_addr_t *pa)
+{
+       if (!(shm->flags & TEE_SHM_MAPPED))
+               return -EINVAL;
+       /* Check that we're in the range of the shm */
+       if ((char *)va < (char *)shm->kaddr)
+               return -EINVAL;
+       if ((char *)va >= ((char *)shm->kaddr + shm->size))
+               return -EINVAL;
+
+       return tee_shm_get_pa(
+                       shm, (unsigned long)va - (unsigned long)shm->kaddr, pa);
+}
+EXPORT_SYMBOL_GPL(tee_shm_va2pa);
+
+/**
+ * tee_shm_pa2va() - Get virtual address of a physical address
+ * @shm:       Shared memory handle
+ * @pa:                Physical address to tranlsate
+ * @va:                Returned virtual address
+ * @returns 0 on success and < 0 on failure
+ */
+int tee_shm_pa2va(struct tee_shm *shm, phys_addr_t pa, void **va)
+{
+       if (!(shm->flags & TEE_SHM_MAPPED))
+               return -EINVAL;
+       /* Check that we're in the range of the shm */
+       if (pa < shm->paddr)
+               return -EINVAL;
+       if (pa >= (shm->paddr + shm->size))
+               return -EINVAL;
+
+       if (va) {
+               void *v = tee_shm_get_va(shm, pa - shm->paddr);
+
+               if (IS_ERR(v))
+                       return PTR_ERR(v);
+               *va = v;
+       }
+       return 0;
+}
+EXPORT_SYMBOL_GPL(tee_shm_pa2va);
+
+/**
+ * tee_shm_get_va() - Get virtual address of a shared memory plus an offset
+ * @shm:       Shared memory handle
+ * @offs:      Offset from start of this shared memory
+ * @returns virtual address of the shared memory + offs if offs is within
+ *     the bounds of this shared memory, else an ERR_PTR
+ */
+void *tee_shm_get_va(struct tee_shm *shm, size_t offs)
+{
+       if (!(shm->flags & TEE_SHM_MAPPED))
+               return ERR_PTR(-EINVAL);
+       if (offs >= shm->size)
+               return ERR_PTR(-EINVAL);
+       return (char *)shm->kaddr + offs;
+}
+EXPORT_SYMBOL_GPL(tee_shm_get_va);
+
+/**
+ * tee_shm_get_pa() - Get physical address of a shared memory plus an offset
+ * @shm:       Shared memory handle
+ * @offs:      Offset from start of this shared memory
+ * @pa:                Physical address to return
+ * @returns 0 if offs is within the bounds of this shared memory, else an
+ *     error code.
+ */
+int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa)
+{
+       if (offs >= shm->size)
+               return -EINVAL;
+       if (pa)
+               *pa = shm->paddr + offs;
+       return 0;
+}
+EXPORT_SYMBOL_GPL(tee_shm_get_pa);
+
+/**
+ * tee_shm_get_from_id() - Find shared memory object and increase reference
+ * count
+ * @ctx:       Context owning the shared memory
+ * @id:                Id of shared memory object
+ * @returns a pointer to 'struct tee_shm' on success or an ERR_PTR on failure
+ */
+struct tee_shm *tee_shm_get_from_id(struct tee_context *ctx, int id)
+{
+       struct tee_device *teedev;
+       struct tee_shm *shm;
+
+       if (!ctx)
+               return ERR_PTR(-EINVAL);
+
+       teedev = ctx->teedev;
+       mutex_lock(&teedev->mutex);
+       shm = idr_find(&teedev->idr, id);
+       if (!shm || shm->ctx != ctx)
+               shm = ERR_PTR(-EINVAL);
+       else if (shm->flags & TEE_SHM_DMA_BUF)
+               get_dma_buf(shm->dmabuf);
+       mutex_unlock(&teedev->mutex);
+       return shm;
+}
+EXPORT_SYMBOL_GPL(tee_shm_get_from_id);
+
+/**
+ * tee_shm_get_id() - Get id of a shared memory object
+ * @shm:       Shared memory handle
+ * @returns id
+ */
+int tee_shm_get_id(struct tee_shm *shm)
+{
+       return shm->id;
+}
+EXPORT_SYMBOL_GPL(tee_shm_get_id);
+
+/**
+ * tee_shm_put() - Decrease reference count on a shared memory handle
+ * @shm:       Shared memory handle
+ */
+void tee_shm_put(struct tee_shm *shm)
+{
+       if (shm->flags & TEE_SHM_DMA_BUF)
+               dma_buf_put(shm->dmabuf);
+}
+EXPORT_SYMBOL_GPL(tee_shm_put);
diff --git a/tee_shm.o b/tee_shm.o
new file mode 100644 (file)
index 0000000..3aab9a4
Binary files /dev/null and b/tee_shm.o differ
diff --git a/tee_shm_pool.c b/tee_shm_pool.c
new file mode 100644 (file)
index 0000000..825169c
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2015, Linaro Limited
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * 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/device.h>
+#include <linux/dma-buf.h>
+#include <linux/genalloc.h>
+#include <linux/slab.h>
+#include "tee_drv.h"
+#include "tee_private.h"
+
+static int pool_op_gen_alloc(struct tee_shm_pool_mgr *poolm,
+                            struct tee_shm *shm, size_t size)
+{
+       unsigned long va;
+       struct gen_pool *genpool = poolm->private_data;
+       size_t s = roundup(size, 1 << genpool->min_alloc_order);
+
+       va = gen_pool_alloc(genpool, s);
+       if (!va)
+               return -ENOMEM;
+
+       memset((void *)va, 0, s);
+       shm->kaddr = (void *)va;
+       shm->paddr = gen_pool_virt_to_phys(genpool, va);
+       shm->size = s;
+       return 0;
+}
+
+static void pool_op_gen_free(struct tee_shm_pool_mgr *poolm,
+                            struct tee_shm *shm)
+{
+       gen_pool_free(poolm->private_data, (unsigned long)shm->kaddr,
+                     shm->size);
+       shm->kaddr = NULL;
+}
+
+static const struct tee_shm_pool_mgr_ops pool_ops_generic = {
+       .alloc = pool_op_gen_alloc,
+       .free = pool_op_gen_free,
+};
+
+static void pool_res_mem_destroy(struct tee_shm_pool *pool)
+{
+       gen_pool_destroy(pool->private_mgr.private_data);
+       gen_pool_destroy(pool->dma_buf_mgr.private_data);
+}
+
+static int pool_res_mem_mgr_init(struct tee_shm_pool_mgr *mgr,
+                                struct tee_shm_pool_mem_info *info,
+                                int min_alloc_order)
+{
+       size_t page_mask = PAGE_SIZE - 1;
+       struct gen_pool *genpool = NULL;
+       int rc;
+
+       /*
+        * Start and end must be page aligned
+        */
+       if ((info->vaddr & page_mask) || (info->paddr & page_mask) ||
+           (info->size & page_mask))
+               return -EINVAL;
+
+       genpool = gen_pool_create(min_alloc_order, -1);
+       if (!genpool)
+               return -ENOMEM;
+
+       gen_pool_set_algo(genpool, gen_pool_best_fit, NULL);
+       rc = gen_pool_add_virt(genpool, info->vaddr, info->paddr, info->size,
+                              -1);
+       if (rc) {
+               gen_pool_destroy(genpool);
+               return rc;
+       }
+
+       mgr->private_data = genpool;
+       mgr->ops = &pool_ops_generic;
+       return 0;
+}
+
+/**
+ * tee_shm_pool_alloc_res_mem() - Create a shared memory pool from reserved
+ * memory range
+ * @priv_info: Information for driver private shared memory pool
+ * @dmabuf_info: Information for dma-buf shared memory pool
+ *
+ * Start and end of pools will must be page aligned.
+ *
+ * Allocation with the flag TEE_SHM_DMA_BUF set will use the range supplied
+ * in @dmabuf, others will use the range provided by @priv.
+ *
+ * @returns pointer to a 'struct tee_shm_pool' or an ERR_PTR on failure.
+ */
+struct tee_shm_pool *
+tee_shm_pool_alloc_res_mem(struct tee_shm_pool_mem_info *priv_info,
+                          struct tee_shm_pool_mem_info *dmabuf_info)
+{
+       struct tee_shm_pool *pool = NULL;
+       int ret;
+
+       pool = kzalloc(sizeof(*pool), GFP_KERNEL);
+       if (!pool) {
+               ret = -ENOMEM;
+               goto err;
+       }
+
+       /*
+        * Create the pool for driver private shared memory
+        */
+       ret = pool_res_mem_mgr_init(&pool->private_mgr, priv_info,
+                                   3 /* 8 byte aligned */);
+       if (ret)
+               goto err;
+
+       /*
+        * Create the pool for dma_buf shared memory
+        */
+       ret = pool_res_mem_mgr_init(&pool->dma_buf_mgr, dmabuf_info,
+                                   PAGE_SHIFT);
+       if (ret)
+               goto err;
+
+       pool->destroy = pool_res_mem_destroy;
+       return pool;
+err:
+       if (ret == -ENOMEM)
+               pr_err("%s: can't allocate memory for res_mem shared memory pool\n", __func__);
+       if (pool && pool->private_mgr.private_data)
+               gen_pool_destroy(pool->private_mgr.private_data);
+       kfree(pool);
+       return ERR_PTR(ret);
+}
+EXPORT_SYMBOL_GPL(tee_shm_pool_alloc_res_mem);
+
+/**
+ * tee_shm_pool_free() - Free a shared memory pool
+ * @pool:      The shared memory pool to free
+ *
+ * There must be no remaining shared memory allocated from this pool when
+ * this function is called.
+ */
+void tee_shm_pool_free(struct tee_shm_pool *pool)
+{
+       pool->destroy(pool);
+       kfree(pool);
+}
+EXPORT_SYMBOL_GPL(tee_shm_pool_free);
diff --git a/tee_shm_pool.o b/tee_shm_pool.o
new file mode 100644 (file)
index 0000000..1b5d22b
Binary files /dev/null and b/tee_shm_pool.o differ