History

tee: add register user memory

Added new ioctl to allow users register own buffers as a shared memory.

Jens Wiklander committed 8 years ago

Commit 033ddf11 parent e2aca5d4 files · +294 −30Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/tee.h+30−0
@@ -50,6 +50,7 @@ · 49 unmodified lines
50 50
51#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */51#define TEE_GEN_CAP_GP (1 << 0)/* GlobalPlatform compliant TEE */
52#define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */52#define TEE_GEN_CAP_PRIVILEGED (1 << 1)/* Privileged device (for supplicant) */
53#define TEE_GEN_CAP_REG_MEM (1 << 2)/* Supports registering shared memory */
53 54
54/*55/*
55 * TEE Implementation ID56 * TEE Implementation ID
@@ -332,6 +333,35 @@ struct tee_iocl_supp_send_arg { · 276 unmodified lines
332#define TEE_IOC_SUPPL_SEND _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \333#define TEE_IOC_SUPPL_SEND _IOR(TEE_IOC_MAGIC, TEE_IOC_BASE + 7, \
333 struct tee_ioctl_buf_data)334 struct tee_ioctl_buf_data)
334 335
336/**
337 * struct tee_ioctl_shm_register_data - Shared memory register argument
338 * @addr: [in] Start address of shared memory to register
339 * @length: [in/out] Length of shared memory to register
340 * @flags: [in/out] Flags to/from registration.
341 * @id: [out] Identifier of the shared memory
342 *
343 * The flags field should currently be zero as input. Updated by the call
344 * with actual flags as defined by TEE_IOCTL_SHM_* above.
345 * This structure is used as argument for TEE_IOC_SHM_REGISTER below.
346 */
347struct tee_ioctl_shm_register_data {
348 __u64 addr;
349 __u64 length;
350 __u32 flags;
351 __s32 id;
352};
353
354/**
355 * TEE_IOC_SHM_REGISTER - Register shared memory argument
356 *
357 * Registers shared memory between the user space process and secure OS.
358 *
359 * Returns a file descriptor on success or < 0 on failure
360 *
361 * The shared memory is unregisterred when the descriptor is closed.
362 */
363#define TEE_IOC_SHM_REGISTER _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 9, \
364 struct tee_ioctl_shm_register_data)
335/*365/*
336 * Five syscalls are used when communicating with the TEE driver.366 * Five syscalls are used when communicating with the TEE driver.
337 * open(): opens the device associated with the driver367 * open(): opens the device associated with the driver