diff options
| author | Jens Wiklander <jens.wiklander@linaro.org> | 2016-12-23 13:13:27 +0100 |
|---|---|---|
| committer | Victor Chong <victor.chong@linaro.org> | 2018-02-21 15:40:47 +0000 |
| commit | fb96bdaa3aa30c7aa605b7ecf42df459b2b386e7 (patch) | |
| tree | 0e8c70bef41f1d55cf8f01e6b6016c39b1db4acd /include | |
| parent | 014c9019a2f61fe445d81676320b4d8676b3242d (diff) | |
BACKPORT: tee: add tee_param_is_memref() for driver use
Change-Id: I105eb7c113b68695c28123f520d8d9b07a1fcda4
Reviewed-by: Etienne Carriere <etienne.carriere@linaro.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit 84debcc53533f162bf11f24e6a503d227c175cbe)
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/tee_drv.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index cb889afe576b..f4a0ac05ebb4 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -275,4 +275,16 @@ int tee_shm_get_id(struct tee_shm *shm); */ struct tee_shm *tee_shm_get_from_id(struct tee_context *ctx, int id); +static inline bool tee_param_is_memref(struct tee_param *param) +{ + switch (param->attr & TEE_IOCTL_PARAM_ATTR_TYPE_MASK) { + case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INPUT: + case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_OUTPUT: + case TEE_IOCTL_PARAM_ATTR_TYPE_MEMREF_INOUT: + return true; + default: + return false; + } +} + #endif /*__TEE_DRV_H*/ |
