feat(mm): add `get_mode_partial`
Add the `get_mode_partial` function for querying the mode of a range of
pages, and returning the longest subrange of pages that have the same
mode. This is needed for the new behaviour of `FFA_MEM_PERM_GET` added
in v1.3.
Change-Id: I9bdfd7f76c45faec7793dd0023e70409ce5bea0f
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/inc/hf/mm.h b/inc/hf/mm.h
index 820e910..9129bb4 100644
--- a/inc/hf/mm.h
+++ b/inc/hf/mm.h
@@ -185,9 +185,16 @@
void mm_vm_dump(const struct mm_ptable *ptable);
bool mm_vm_get_mode(const struct mm_ptable *ptable, ipaddr_t begin,
ipaddr_t end, mm_mode_t *mode);
+
+bool mm_vm_get_mode_partial(const struct mm_ptable *ptable, ipaddr_t begin,
+ ipaddr_t end, mm_mode_t *mode, ipaddr_t *end_ret);
+
bool mm_get_mode(const struct mm_ptable *ptable, vaddr_t begin, vaddr_t end,
mm_mode_t *mode);
+bool mm_get_mode_partial(const struct mm_ptable *ptable, vaddr_t begin,
+ vaddr_t end, mm_mode_t *mode, vaddr_t *end_ret);
+
struct mm_stage1_locked mm_lock_ptable_unsafe(struct mm_ptable *ptable);
struct mm_stage1_locked mm_lock_stage1(void);
void mm_unlock_stage1(struct mm_stage1_locked *lock);