mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-10-09 02:33:28 +00:00
hv: Move uuid_is_equal to util.h
This patch moves uuid_is_equal from vm_config.c to util.h as inline API. Tracked-On: #6320 Signed-off-by: Yifan Liu <yifan1.liu@intel.com>
This commit is contained in:
@@ -57,4 +57,17 @@ static inline uint8_t calculate_checksum8(const void *buf, uint32_t len)
|
||||
return (uint8_t)(0x100U - calculate_sum8(buf, len));
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre (uuid1 != NULL) && (uuid2 != NULL)
|
||||
*/
|
||||
static inline bool uuid_is_equal(const uint8_t *uuid1, const uint8_t *uuid2)
|
||||
{
|
||||
uint64_t uuid1_h = *(const uint64_t *)uuid1;
|
||||
uint64_t uuid1_l = *(const uint64_t *)(uuid1 + 8);
|
||||
uint64_t uuid2_h = *(const uint64_t *)uuid2;
|
||||
uint64_t uuid2_l = *(const uint64_t *)(uuid2 + 8);
|
||||
|
||||
return ((uuid1_h == uuid2_h) && (uuid1_l == uuid2_l));
|
||||
}
|
||||
|
||||
#endif /* UTIL_H */
|
||||
|
Reference in New Issue
Block a user