lkml.org 
[lkml]   [2017]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 04/14] tee: shm: add page accessor functions
Date
From: Volodymyr Babchuk <vlad.babchuk@gmail.com>

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>
---
include/linux/tee_drv.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h
index 6ba8b76..d773827 100644
--- a/include/linux/tee_drv.h
+++ b/include/linux/tee_drv.h
@@ -394,6 +394,20 @@ 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)
+{
+ if (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
--
2.7.4
\
 
 \ /
  Last update: 2017-09-28 20:08    [W:0.330 / U:11.348 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site