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

Commit 006c193d authored by Volodymyr Babchuk's avatar Volodymyr Babchuk Committed by Victor Chong
Browse files

BACKPORT: tee: shm: add accessors for buffer size and page offset



These two function will be needed for shared memory registration in OP-TEE

Change-Id: If6a16ec82a2880c05a37c05bf00e5722b11efc64
Signed-off-by: default avatarVolodymyr Babchuk <vlad.babchuk@gmail.com>
Signed-off-by: default avatarJens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit b25946ad951c013c31d0a0e82d2017004bdc8fed)
Signed-off-by: default avatarVictor Chong <victor.chong@linaro.org>
parent f902700b
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -393,6 +393,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