aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2016-12-23 13:13:27 +0100
committerAmit Pundir <amit.pundir@linaro.org>2018-03-05 21:58:40 +0530
commitf89a269751533aba60c70f65b31d9f288e50f9bd (patch)
tree3769147855fcbc864603445da43a31a9db00a08d /include
parent10db58676e580f12a60b1cfd595adb3134e0395f (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.h12
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*/