feat(api): add page count param/return to `FFA_MEM_PERM_GET`
The v1.3 specification adds a new "page count" argument and return value
to the `FFA_MEM_PERM_GET` ABI. Update `api_ffa_mem_perm_get` and
`ffa_mem_perm_get` accordingly.
Change-Id: I21a068bce2275caf5b9278ac891d686e76615560
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/inc/hf/api.h b/inc/hf/api.h
index 3e66147..8c94b68 100644
--- a/inc/hf/api.h
+++ b/inc/hf/api.h
@@ -139,7 +139,8 @@
struct ffa_value api_ffa_notification_info_get(struct vcpu *current);
-struct ffa_value api_ffa_mem_perm_get(vaddr_t base_addr, struct vcpu *current);
+struct ffa_value api_ffa_mem_perm_get(vaddr_t base_addr, uint32_t page_count,
+ struct vcpu *current);
struct ffa_value api_ffa_mem_perm_set(vaddr_t base_addr, uint32_t page_count,
enum ffa_mem_perm mem_perm,
struct vcpu *current);
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 421bcf1..7fd5f2c 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -668,10 +668,19 @@
});
}
-static inline struct ffa_value ffa_mem_perm_get(uint64_t base_va)
+static inline struct ffa_value ffa_mem_perm_get(uint64_t base_va,
+ uint32_t page_count)
{
- return ffa_call((struct ffa_value){.func = FFA_MEM_PERM_GET_32,
- .arg1 = base_va});
+ return ffa_call((struct ffa_value){
+ .func = FFA_MEM_PERM_GET_32,
+ .arg1 = base_va,
+ /**
+ * The handler for `FFA_MEM_PERM_GET` calculates the size of the
+ * region as (page_count + 1) * granule size. So we must pass in
+ * page_count - 1.
+ */
+ .arg2 = page_count - 1,
+ });
}
static inline struct ffa_value ffa_mem_perm_set(uint64_t base_va,