diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/tee_drv.h | 7 | ||||
-rw-r--r-- | include/uapi/linux/tee.h | 107 |
2 files changed, 28 insertions, 86 deletions
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index f5d5f455660c..0f175b8f6456 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -164,7 +164,6 @@ struct tee_shm_pool_mem_info { /** * tee_shm_pool_alloc_res_mem() - Create a shared memory pool from reserved * memory range - * @dev: Device allocating the pool * @priv_info: Information for driver private shared memory pool * @dmabuf_info: Information for dma-buf shared memory pool * @@ -176,8 +175,7 @@ struct tee_shm_pool_mem_info { * @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 device *dev, - struct tee_shm_pool_mem_info *priv_info, +tee_shm_pool_alloc_res_mem(struct tee_shm_pool_mem_info *priv_info, struct tee_shm_pool_mem_info *dmabuf_info); /** @@ -268,7 +266,8 @@ int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa); int tee_shm_get_id(struct tee_shm *shm); /** - * tee_shm_get_from_id() - Find shared memory object and increase referece count + * 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 diff --git a/include/uapi/linux/tee.h b/include/uapi/linux/tee.h index ddc476e3c16b..370d8845ab21 100644 --- a/include/uapi/linux/tee.h +++ b/include/uapi/linux/tee.h @@ -165,54 +165,28 @@ struct tee_ioctl_buf_data { #define TEE_IOCTL_LOGIN_GROUP_APPLICATION 6 /** - * struct tee_ioctl_param_memref - memory reference - * @shm_offs: Offset into the shared memory object - * @size: Size of the buffer - * @shm_id: Shared memory identifier - * - * 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 (@shm_offs) and @size - * of the object. To supply the entire shared memory object set @shm_offs - * to 0 and @size to the previously returned size of the object. - */ -struct tee_ioctl_param_memref { - __u64 shm_offs; - __u64 size; - __s64 shm_id; -}; - -/** - * struct tee_ioctl_param_value - values - * @a: first value - * @b: second value - * @c: third value - * - * Value parameters are passed unchecked to the destination - */ -struct tee_ioctl_param_value { - __u64 a; - __u64 b; - __u64 c; -}; - -/** * struct tee_ioctl_param - parameter * @attr: attributes - * @memref: a memory reference - * @value: a value + * @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; - union { - struct tee_ioctl_param_memref memref; - struct tee_ioctl_param_value value; - } u; + __u64 a; + __u64 b; + __u64 c; }; #define TEE_IOCTL_UUID_LEN 16 @@ -237,17 +211,9 @@ struct tee_ioctl_open_session_arg { __u32 ret; __u32 ret_origin; __u32 num_params; - /* - * this struct is 8 byte aligned since the 'struct tee_ioctl_param' - * which follows requires 8 byte alignment. - * - * Commented out element used to visualize the layout dynamic part - * of the struct. This field is not available at all if - * num_params == 0. - * - * struct tee_ioctl_param params[num_params]; - */ -} __aligned(8); + /* 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 @@ -276,17 +242,9 @@ struct tee_ioctl_invoke_arg { __u32 ret; __u32 ret_origin; __u32 num_params; - /* - * this struct is 8 byte aligned since the 'struct tee_ioctl_param' - * which follows requires 8 byte alignment. - * - * Commented out element used to visualize the layout dynamic part - * of the struct. This field is not available at all if - * num_params == 0. - * - * struct tee_ioctl_param params[num_params]; - */ -} __aligned(8); + /* 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 @@ -339,17 +297,9 @@ struct tee_ioctl_close_session_arg { struct tee_iocl_supp_recv_arg { __u32 func; __u32 num_params; - /* - * this struct is 8 byte aligned since the 'struct tee_ioctl_param' - * which follows requires 8 byte alignment. - * - * Commented out element used to visualize the layout dynamic part - * of the struct. This field is not available at all if - * num_params == 0. - * - * struct tee_ioctl_param params[num_params]; - */ -} __aligned(8); + /* 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 @@ -368,17 +318,10 @@ struct tee_iocl_supp_recv_arg { struct tee_iocl_supp_send_arg { __u32 ret; __u32 num_params; - /* - * this struct is 8 byte aligned since the 'struct tee_ioctl_param' - * which follows requires 8 byte alignment. - * - * Commented out element used to visualize the layout dynamic part - * of the struct. This field is not available at all if - * num_params == 0. - * - * struct tee_ioctl_param params[num_params]; - */ -} __aligned(8); + /* 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 * |