feat(memory share): define ffa_map_actions
This patch defines ffa_map_actions, which will be used to configure
the operation of 'ffa_region_group_identity_map', which updates the
page tables of FF-A endpoints for memory sharing related operations.
Up to this point the function can take two actions:
- MAP_ACTION_CHECK: that the page table entries can be allocated, and
returns true if that is the case.
- MAP_ACTION_COMMIT: the change in the memory pool for the page table
entries.
This preserves the current behaviour of the function. The actions
above were configured via boolean parameter, and now use the
enum ffa_map_actions type.
Future patches will make use of MAP_ACTION_CHECK_PROTECT and
MAP_ACTION_COMMIT_UNPROTECT.
Change-Id: I0f2f7ffd89d5d5fcf59922812dded63dc6d9cb47
Signed-off-by: J-Alves <joao.alves@arm.com>
diff --git a/inc/hf/ffa_memory_internal.h b/inc/hf/ffa_memory_internal.h
index 1861801..a478e31 100644
--- a/inc/hf/ffa_memory_internal.h
+++ b/inc/hf/ffa_memory_internal.h
@@ -104,6 +104,17 @@
};
/**
+ * Actions that can be taken by function `ffa_region_group_identity_map`.
+ */
+enum ffa_map_action {
+ MAP_ACTION_CHECK,
+ MAP_ACTION_CHECK_PROTECT,
+ MAP_ACTION_COMMIT,
+ MAP_ACTION_COMMIT_UNPROTECT,
+ MAP_ACTION_MAX,
+};
+
+/**
* Encapsulates the set of share states while the `share_states_lock` is held.
*/
struct share_states_locked {
@@ -163,6 +174,6 @@
struct vm_locked vm_locked,
struct ffa_memory_region_constituent **fragments,
const uint32_t *fragment_constituent_counts, uint32_t fragment_count,
- uint32_t mode, struct mpool *ppool, bool commit);
+ uint32_t mode, struct mpool *ppool, enum ffa_map_action action);
bool memory_region_receivers_from_other_world(
struct ffa_memory_region *memory_region);