refactor(ff-a): use bitfields for memory access bitmaps
Instead of doing the bit-manipulation manually, these types can be
declared as structs where the fields are given explicit bitwidths. The
compiler will generate the appropriate bit-manipulation automatically.
Change-Id: Ifb66ac6904b8c216ccc18f6f86bbf7c051178f6d
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/inc/hf/ffa_memory_internal.h b/inc/hf/ffa_memory_internal.h
index f240ca2..4df08c9 100644
--- a/inc/hf/ffa_memory_internal.h
+++ b/inc/hf/ffa_memory_internal.h
@@ -20,6 +20,7 @@
#include "hf/check.h"
#include "hf/ffa_memory.h"
+#include "hf/ffa_v1_0.h"
#include "hf/mpool.h"
#include "hf/vm.h"
@@ -53,6 +54,13 @@
"struct ffa_features_rxtx_map_params must be 4 "
"bytes long");
+static_assert(sizeof(ffa_memory_access_permissions_t) == 1,
+ "ffa_memory_access_permissions_t must be 1 byte wide");
+static_assert(sizeof(ffa_memory_attributes_t) == 2,
+ "ffa_memory_attributes_t must be 2 bytes wide");
+static_assert(sizeof(ffa_memory_attributes_v1_0) == 1,
+ "ffa_memory_attributes_v1_0 must be 1 byte wide");
+
struct ffa_memory_share_state {
/**
* The memory region being shared, or NULL if this share state is