summaryrefslogtreecommitdiff
path: root/include/linux/tee_drv.h
diff options
context:
space:
mode:
authorVolodymyr Babchuk <vlad.babchuk@gmail.com>2017-11-29 14:48:28 +0200
committerJens Wiklander <jens.wiklander@linaro.org>2017-12-15 13:32:30 +0100
commite0c69ae8bfb500facebe1fa331f9400c216eaab0 (patch)
treec0627b195d99acb65278bb16edd518b314f0ea30 /include/linux/tee_drv.h
parentb25946ad951c013c31d0a0e82d2017004bdc8fed (diff)
tee: shm: add page accessor functions
In order to register a shared buffer in TEE, we need accessor function that return list of pages for that buffer. Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'include/linux/tee_drv.h')
-rw-r--r--include/linux/tee_drv.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
index 6838f25e1421..0f86a480c204 100644
--- a/include/linux/tee_drv.h
+++ b/include/linux/tee_drv.h
@@ -404,6 +404,19 @@ static inline size_t tee_shm_get_size(struct tee_shm *shm)
}
/**
+ * tee_shm_get_pages() - Get list of pages that hold shared buffer
+ * @shm: Shared memory handle
+ * @num_pages: Number of pages will be stored there
+ * @returns pointer to pages array
+ */
+static inline struct page **tee_shm_get_pages(struct tee_shm *shm,
+ size_t *num_pages)
+{
+ *num_pages = shm->num_pages;
+ return shm->pages;
+}
+
+/**
* tee_shm_get_page_offset() - Get shared buffer offset from page start
* @shm: Shared memory handle
* @returns page offset of shared buffer