include: uapi: Fix UUID to FFA tuple conversion helper FFA needs the UUID to be in two 64 bit words. The first of those words holds byte swapped and shifted components of the UUID. This change ensures the byte swapping alway happens. Bug: 380065728 Change-Id: I060e41bcde6e25d2d03bf59fafdf183e2cbd3db2 Signed-off-by: Jay Monkman <jmonkman@google.com>
diff --git a/lib/arm_ffa/arm_ffa.c b/lib/arm_ffa/arm_ffa.c index e2c68c4..4bc440d 100644 --- a/lib/arm_ffa/arm_ffa.c +++ b/lib/arm_ffa/arm_ffa.c
@@ -67,9 +67,9 @@ */ static inline void uuid_to_le64_pair(uuid_t uuid_obj, uint64_t uuid_lo_hi[static 2]) { - uuid_lo_hi[0] = (((uint64_t)htole16(uuid_obj.time_hi_and_version) << 48) | - ((uint64_t)htole16(uuid_obj.time_mid) << 32) | - ((uint64_t)htole32(uuid_obj.time_low))); + uuid_lo_hi[0] = (((uint64_t)__bswap16(uuid_obj.time_hi_and_version) << 48) | + ((uint64_t)__bswap16(uuid_obj.time_mid) << 32) | + ((uint64_t)__bswap32(uuid_obj.time_low))); for (int i = 0; i < 8; i++) { uuid_lo_hi[1] |= ((uint64_t)uuid_obj.clock_seq_and_node[i]) << (i * 8);