Skip to content

Commit e0c69ae

Browse files
lorcjenswi-linaro
authored andcommitted
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 <[email protected]> Signed-off-by: Jens Wiklander <[email protected]>
1 parent b25946a commit e0c69ae

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/linux/tee_drv.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,19 @@ static inline size_t tee_shm_get_size(struct tee_shm *shm)
403403
return shm->size;
404404
}
405405

406+
/**
407+
* tee_shm_get_pages() - Get list of pages that hold shared buffer
408+
* @shm: Shared memory handle
409+
* @num_pages: Number of pages will be stored there
410+
* @returns pointer to pages array
411+
*/
412+
static inline struct page **tee_shm_get_pages(struct tee_shm *shm,
413+
size_t *num_pages)
414+
{
415+
*num_pages = shm->num_pages;
416+
return shm->pages;
417+
}
418+
406419
/**
407420
* tee_shm_get_page_offset() - Get shared buffer offset from page start
408421
* @shm: Shared memory handle

0 commit comments

Comments
 (0)