Skip to content

Commit b25946a

Browse files
lorcjenswi-linaro
authored andcommitted
tee: shm: add accessors for buffer size and page offset
These two function will be needed for shared memory registration in OP-TEE Signed-off-by: Volodymyr Babchuk <[email protected]> Signed-off-by: Jens Wiklander <[email protected]>
1 parent 033ddf1 commit b25946a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

include/linux/tee_drv.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,26 @@ void *tee_shm_get_va(struct tee_shm *shm, size_t offs);
393393
*/
394394
int tee_shm_get_pa(struct tee_shm *shm, size_t offs, phys_addr_t *pa);
395395

396+
/**
397+
* tee_shm_get_size() - Get size of shared memory buffer
398+
* @shm: Shared memory handle
399+
* @returns size of shared memory
400+
*/
401+
static inline size_t tee_shm_get_size(struct tee_shm *shm)
402+
{
403+
return shm->size;
404+
}
405+
406+
/**
407+
* tee_shm_get_page_offset() - Get shared buffer offset from page start
408+
* @shm: Shared memory handle
409+
* @returns page offset of shared buffer
410+
*/
411+
static inline size_t tee_shm_get_page_offset(struct tee_shm *shm)
412+
{
413+
return shm->offset;
414+
}
415+
396416
/**
397417
* tee_shm_get_id() - Get id of a shared memory object
398418
* @shm: Shared memory handle

0 commit comments

Comments
 (0)