aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/tee_drv.h
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2022-02-04 10:33:54 +0100
committerJens Wiklander <jens.wiklander@linaro.org>2022-02-16 07:49:41 +0100
commit5d41f1b3e3282909b6bbceacb9aebe1d3c849a49 (patch)
treeac0cfba8dc01820f55079584830fad7f44afca5d /include/linux/tee_drv.h
parenttee: simplify shm pool handling (diff)
downloadwireguard-linux-5d41f1b3e3282909b6bbceacb9aebe1d3c849a49.tar.xz
wireguard-linux-5d41f1b3e3282909b6bbceacb9aebe1d3c849a49.zip
tee: replace tee_shm_alloc()
tee_shm_alloc() is replaced by three new functions, tee_shm_alloc_user_buf() - for user mode allocations, replacing passing the flags TEE_SHM_MAPPED | TEE_SHM_DMA_BUF tee_shm_alloc_kernel_buf() - for kernel mode allocations, slightly optimized compared to using the flags TEE_SHM_MAPPED | TEE_SHM_DMA_BUF. tee_shm_alloc_priv_buf() - primarily for TEE driver internal use. This also makes the interface easier to use as we can get rid of the somewhat hard to use flags parameter. The TEE subsystem and the TEE drivers are updated to use the new functions instead. Reviewed-by: Sumit Garg <sumit.garg@linaro.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'include/linux/tee_drv.h')
-rw-r--r--include/linux/tee_drv.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
index ed641dc314bd..7f038f8787c7 100644
--- a/include/linux/tee_drv.h
+++ b/include/linux/tee_drv.h
@@ -273,21 +273,7 @@ static inline void tee_shm_pool_free(struct tee_shm_pool *pool)
*/
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);
+struct tee_shm *tee_shm_alloc_priv_buf(struct tee_context *ctx, size_t size);
struct tee_shm *tee_shm_alloc_kernel_buf(struct tee_context *ctx, size_t size);
/**