core: rename to mobj_{inc,dec}_map()
Renames mobj_reg_shm_inc_map() and mobj_reg_shm_dec_map() to
mobj_inc_map() and mobj_dec_map() respectively. This makes room for
other implementations of registered shared memory.
Reviewed-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
diff --git a/core/arch/arm/include/mm/mobj.h b/core/arch/arm/include/mm/mobj.h
index 7a41e46..2a80aa9 100644
--- a/core/arch/arm/include/mm/mobj.h
+++ b/core/arch/arm/include/mm/mobj.h
@@ -182,7 +182,7 @@
TEE_Result mobj_reg_shm_release_by_cookie(uint64_t cookie);
/**
- * mobj_reg_shm_inc_map() - increase map count
+ * mobj_inc_map() - increase map count
* @mobj: pointer to a registered shared memory MOBJ
*
* Maps the MOBJ if it isn't mapped already and increaes the map count
@@ -191,10 +191,10 @@
*
* Returns TEE_SUCCESS on success or an error code on failure
*/
-TEE_Result mobj_reg_shm_inc_map(struct mobj *mobj);
+TEE_Result mobj_inc_map(struct mobj *mobj);
/**
- * mobj_reg_shm_dec_map() - decrease map count
+ * mobj_dec_map() - decrease map count
* @mobj: pointer to a registered shared memory MOBJ
*
* Decreases the map count and also unmaps the MOBJ if the map count
@@ -203,7 +203,7 @@
*
* Returns TEE_SUCCESS on success or an error code on failure
*/
-TEE_Result mobj_reg_shm_dec_map(struct mobj *mobj);
+TEE_Result mobj_dec_map(struct mobj *mobj);
/**
* mobj_reg_shm_unguard() - unguards a reg_shm
@@ -223,12 +223,12 @@
struct mobj *mobj_mapped_shm_alloc(paddr_t *pages, size_t num_pages,
paddr_t page_offset, uint64_t cookie);
#else
-static inline TEE_Result mobj_reg_shm_inc_map(struct mobj *mobj __unused)
+static inline TEE_Result mobj_inc_map(struct mobj *mobj __unused)
{
return TEE_ERROR_NOT_SUPPORTED;
}
-static inline TEE_Result mobj_reg_shm_dec_map(struct mobj *mobj __unused)
+static inline TEE_Result mobj_dec_map(struct mobj *mobj __unused)
{
return TEE_ERROR_NOT_SUPPORTED;
}
diff --git a/core/arch/arm/kernel/pseudo_ta.c b/core/arch/arm/kernel/pseudo_ta.c
index 5145993..196516f 100644
--- a/core/arch/arm/kernel/pseudo_ta.c
+++ b/core/arch/arm/kernel/pseudo_ta.c
@@ -79,7 +79,7 @@
if (!va && mem->size) {
TEE_Result res;
- res = mobj_reg_shm_inc_map(mem->mobj);
+ res = mobj_inc_map(mem->mobj);
if (res)
return res;
did_map[n] = true;
@@ -131,7 +131,7 @@
if (did_map[n]) {
TEE_Result res __maybe_unused;
- res = mobj_reg_shm_dec_map(param->u[n].mem.mobj);
+ res = mobj_dec_map(param->u[n].mem.mobj);
assert(!res);
}
}
diff --git a/core/arch/arm/mm/mobj_dyn_shm.c b/core/arch/arm/mm/mobj_dyn_shm.c
index 51d56d7..9373cb8 100644
--- a/core/arch/arm/mm/mobj_dyn_shm.c
+++ b/core/arch/arm/mm/mobj_dyn_shm.c
@@ -354,7 +354,7 @@
return TEE_SUCCESS;
}
-TEE_Result mobj_reg_shm_inc_map(struct mobj *mobj)
+TEE_Result mobj_inc_map(struct mobj *mobj)
{
TEE_Result res = TEE_SUCCESS;
struct mobj_reg_shm *r = to_mobj_reg_shm_may_fail(mobj);
@@ -391,7 +391,7 @@
return res;
}
-TEE_Result mobj_reg_shm_dec_map(struct mobj *mobj)
+TEE_Result mobj_dec_map(struct mobj *mobj)
{
struct mobj_reg_shm *r = to_mobj_reg_shm_may_fail(mobj);
@@ -425,7 +425,7 @@
if (!mobj)
return NULL;
- if (mobj_reg_shm_inc_map(mobj)) {
+ if (mobj_inc_map(mobj)) {
mobj_put(mobj);
return NULL;
}