Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7bc05256 authored by Volodymyr Babchuk's avatar Volodymyr Babchuk Committed by Victor Chong
Browse files

BACKPORT: 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.

Change-Id: I34630ae5d69813639ac8f0988631a65c16432846
Signed-off-by: default avatarVolodymyr Babchuk <vlad.babchuk@gmail.com>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit e0c69ae8bfb500facebe1fa331f9400c216eaab0)
Signed-off-by: default avatarVictor Chong <victor.chong@linaro.org>
parent 006c193d
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -403,6 +403,19 @@ static inline size_t tee_shm_get_size(struct tee_shm *shm)
	return shm->size;
}

/**
 * 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