summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/tee.h
diff options
context:
space:
mode:
authorJens Wiklander2017-11-29 13:48:26 +0100
committerJens Wiklander2017-12-15 13:32:20 +0100
commit033ddf12bcf5326b93bd604f50a7474a434a35f9 (patch)
tree522e379496852ccd5db9569296192213f3bed0fd /include/uapi/linux/tee.h
parenttee: flexible shared memory pool creation (diff)
downloadkernel-qcow2-linux-033ddf12bcf5326b93bd604f50a7474a434a35f9.tar.gz
kernel-qcow2-linux-033ddf12bcf5326b93bd604f50a7474a434a35f9.tar.xz
kernel-qcow2-linux-033ddf12bcf5326b93bd604f50a7474a434a35f9.zip
tee: add register user memory
Added new ioctl to allow users register own buffers as a shared memory. Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> [jw: moved tee_shm_is_registered() declaration] [jw: added space after __tee_shm_alloc() implementation] Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'include/uapi/linux/tee.h')
-rw-r--r--include/uapi/linux/tee.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/uapi/linux/tee.h b/include/uapi/linux/tee.h
index 688782e90140..d41a07afe3fc 100644
--- a/include/uapi/linux/tee.h
+++ b/include/uapi/linux/tee.h
@@ -50,6 +50,7 @@
#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */
#define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */
+#define TEE_GEN_CAP_REG_MEM (1 << 2)/* Supports registering shared memory */
/*
* TEE Implementation ID
@@ -332,6 +333,35 @@ struct tee_iocl_supp_send_arg {
#define TEE_IOC_SUPPL_SEND _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \
struct tee_ioctl_buf_data)
+/**
+ * struct tee_ioctl_shm_register_data - Shared memory register argument
+ * @addr: [in] Start address of shared memory to register
+ * @length: [in/out] Length of shared memory to register
+ * @flags: [in/out] Flags to/from registration.
+ * @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_REGISTER below.
+ */
+struct tee_ioctl_shm_register_data {
+ __u64 addr;
+ __u64 length;
+ __u32 flags;
+ __s32 id;
+};
+
+/**
+ * TEE_IOC_SHM_REGISTER - Register shared memory argument
+ *
+ * Registers shared memory between the user space process and secure OS.
+ *
+ * Returns a file descriptor on success or < 0 on failure
+ *
+ * The shared memory is unregisterred when the descriptor is closed.
+ */
+#define TEE_IOC_SHM_REGISTER _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 9, \
+ struct tee_ioctl_shm_register_data)
/*
* Five syscalls are used when communicating with the TEE driver.
* open(): opens the device associated with the driver