refactor(ff-a): move ffa_uuid earlier in `ffa.h`
`struct ffa_uuid` needs to be referenced by `struct
ffa_partition_rxtx_header`, but is defined after `struct
ffa_partition_rxtx_header`. Solve this by moving `struct ffa_uuid` to
earlier in `ffa.h`.
Change-Id: I3b4fdd2f3ffe537bd1a837faccf1ace4070a1a9b
Signed-off-by: Karl Meakin <karl.meakin@arm.com>
diff --git a/inc/vmapi/hf/ffa.h b/inc/vmapi/hf/ffa.h
index 25cb081..87b3576 100644
--- a/inc/vmapi/hf/ffa.h
+++ b/inc/vmapi/hf/ffa.h
@@ -396,7 +396,64 @@
}
/**
- * Partition message header as specified by table 6.2 from FF-A v1.1 EAC0
+ * Holds the UUID in a struct that is mappable directly to the SMCC calling
+ * convention, which is used for FF-A calls.
+ *
+ * Refer to table 84 of the FF-A 1.0 EAC specification as well as section 5.3
+ * of the SMCC Spec 1.2.
+ */
+struct ffa_uuid {
+ uint32_t uuid[4];
+};
+
+static inline void ffa_uuid_init(uint32_t w0, uint32_t w1, uint32_t w2,
+ uint32_t w3, struct ffa_uuid *uuid)
+{
+ uuid->uuid[0] = w0;
+ uuid->uuid[1] = w1;
+ uuid->uuid[2] = w2;
+ uuid->uuid[3] = w3;
+}
+
+static inline bool ffa_uuid_equal(const struct ffa_uuid *uuid1,
+ const struct ffa_uuid *uuid2)
+{
+ return (uuid1->uuid[0] == uuid2->uuid[0]) &&
+ (uuid1->uuid[1] == uuid2->uuid[1]) &&
+ (uuid1->uuid[2] == uuid2->uuid[2]) &&
+ (uuid1->uuid[3] == uuid2->uuid[3]);
+}
+
+static inline bool ffa_uuid_is_null(const struct ffa_uuid *uuid)
+{
+ struct ffa_uuid null = {0};
+
+ return ffa_uuid_equal(uuid, &null);
+}
+
+static inline void ffa_uuid_from_u64x2(uint64_t uuid_lo, uint64_t uuid_hi,
+ struct ffa_uuid *uuid)
+{
+ ffa_uuid_init((uint32_t)(uuid_lo & 0xFFFFFFFFU),
+ (uint32_t)(uuid_lo >> 32),
+ (uint32_t)(uuid_hi & 0xFFFFFFFFU),
+ (uint32_t)(uuid_hi >> 32), uuid);
+}
+
+/**
+ * Split `uuid` into two u64s.
+ * This function writes to pointer parameters because C does not allow returning
+ * arrays from functions.
+ */
+static inline void ffa_uuid_to_u64x2(uint64_t *lo, uint64_t *hi,
+ const struct ffa_uuid *uuid)
+{
+ *lo = (uint64_t)uuid->uuid[1] << 32 | uuid->uuid[0];
+ *hi = (uint64_t)uuid->uuid[3] << 32 | uuid->uuid[2];
+}
+
+/**
+ * Partition message header as specified by table 7.1 from FF-A v1.3 ALP0
* specification.
*/
struct ffa_partition_rxtx_header {
@@ -838,63 +895,6 @@
}
/**
- * Holds the UUID in a struct that is mappable directly to the SMCC calling
- * convention, which is used for FF-A calls.
- *
- * Refer to table 84 of the FF-A 1.0 EAC specification as well as section 5.3
- * of the SMCC Spec 1.2.
- */
-struct ffa_uuid {
- uint32_t uuid[4];
-};
-
-static inline void ffa_uuid_init(uint32_t w0, uint32_t w1, uint32_t w2,
- uint32_t w3, struct ffa_uuid *uuid)
-{
- uuid->uuid[0] = w0;
- uuid->uuid[1] = w1;
- uuid->uuid[2] = w2;
- uuid->uuid[3] = w3;
-}
-
-static inline bool ffa_uuid_equal(const struct ffa_uuid *uuid1,
- const struct ffa_uuid *uuid2)
-{
- return (uuid1->uuid[0] == uuid2->uuid[0]) &&
- (uuid1->uuid[1] == uuid2->uuid[1]) &&
- (uuid1->uuid[2] == uuid2->uuid[2]) &&
- (uuid1->uuid[3] == uuid2->uuid[3]);
-}
-
-static inline bool ffa_uuid_is_null(const struct ffa_uuid *uuid)
-{
- struct ffa_uuid null = {0};
-
- return ffa_uuid_equal(uuid, &null);
-}
-
-static inline void ffa_uuid_from_u64x2(uint64_t uuid_lo, uint64_t uuid_hi,
- struct ffa_uuid *uuid)
-{
- ffa_uuid_init((uint32_t)(uuid_lo & 0xFFFFFFFFU),
- (uint32_t)(uuid_lo >> 32),
- (uint32_t)(uuid_hi & 0xFFFFFFFFU),
- (uint32_t)(uuid_hi >> 32), uuid);
-}
-
-/**
- * Split `uuid` into two u64s.
- * This function writes to pointer parameters because C does not allow returning
- * arrays from functions.
- */
-static inline void ffa_uuid_to_u64x2(uint64_t *lo, uint64_t *hi,
- const struct ffa_uuid *uuid)
-{
- *lo = (uint64_t)uuid->uuid[1] << 32 | uuid->uuid[0];
- *hi = (uint64_t)uuid->uuid[3] << 32 | uuid->uuid[2];
-}
-
-/**
* Flags to determine the partition properties, as required by
* FFA_PARTITION_INFO_GET.
*