summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorVolodymyr Babchuk <vlad.babchuk@gmail.com>2017-11-29 15:48:27 +0300
committerJens Wiklander <jens.wiklander@linaro.org>2017-12-15 15:32:30 +0300
commitb25946ad951c013c31d0a0e82d2017004bdc8fed (patch)
treece99ba3d66290c6a9d26300279fa0cbcc8fa52ba /include
parent033ddf12bcf5326b93bd604f50a7474a434a35f9 (diff)
downloadlinux-b25946ad951c013c31d0a0e82d2017004bdc8fed.tar.xz
tee: shm: add accessors for buffer size and page offset
These two function will be needed for shared memory registration in OP-TEE Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/tee_drv.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
index 7c8495607b99..6838f25e1421 100644
--- a/include/linux/tee_drv.h
+++ b/include/linux/tee_drv.h
@@ -394,6 +394,26 @@ void *tee_shm_get_va(struct tee_shm *shm, size_t offs);
int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa);
/**
+ * tee_shm_get_size() - Get size of shared memory buffer
+ * @shm: Shared memory handle
+ * @returns size of shared memory
+ */
+static inline size_t tee_shm_get_size(struct tee_shm *shm)
+{
+ return shm->size;
+}
+
+/**
+ * tee_shm_get_page_offset() - Get shared buffer offset from page start
+ * @shm: Shared memory handle
+ * @returns page offset of shared buffer
+ */
+static inline size_t tee_shm_get_page_offset(struct tee_shm *shm)
+{
+ return shm->offset;
+}
+
+/**
* tee_shm_get_id() - Get id of a shared memory object
* @shm: Shared memory handle
* @returns id