diff options
| author | Volodymyr Babchuk <vlad.babchuk@gmail.com> | 2017-11-29 14:48:27 +0200 |
|---|---|---|
| committer | Victor Chong <victor.chong@linaro.org> | 2018-02-21 15:40:47 +0000 |
| commit | ba5928ca5c23ed8793288c4d19a541a8d86deb38 (patch) | |
| tree | cfb7f34bd190e3b2cefa8f6049c23fa287180670 /include/linux | |
| parent | 9b5e064b883b7a2c2cb2645d77cff59edee04b62 (diff) | |
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: Iccfbc063f90edd2f8a283bc0424d95e1f0874c8a
Signed-off-by: Volodymyr Babchuk <vlad.babchuk@gmail.com>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
(cherry picked from commit b25946ad951c013c31d0a0e82d2017004bdc8fed)
Signed-off-by: Victor Chong <victor.chong@linaro.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/tee_drv.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/tee_drv.h b/include/linux/tee_drv.h index 0f9e574299b6..71cd1f2841c9 100644 --- a/include/linux/tee_drv.h +++ b/include/linux/tee_drv.h @@ -394,6 +394,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 * @returns id |
