OSDN Git Service

tee: replace tee_shm_alloc()
authorJens Wiklander <jens.wiklander@linaro.org>
Fri, 4 Feb 2022 09:33:54 +0000 (10:33 +0100)
committerJens Wiklander <jens.wiklander@linaro.org>
Wed, 16 Feb 2022 06:49:41 +0000 (07:49 +0100)
commit5d41f1b3e3282909b6bbceacb9aebe1d3c849a49
treeac0cfba8dc01820f55079584830fad7f44afca5d
parentd88e0493a054c9fe72ade41a42d42e958ee6503d
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>
drivers/tee/optee/call.c
drivers/tee/optee/device.c
drivers/tee/optee/ffa_abi.c
drivers/tee/optee/smc_abi.c
drivers/tee/tee_shm.c
include/linux/tee_drv.h