1 /*
2  * Copyright (c) 2021, Linaro Limited
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef DRIVERS_PARTITION_EFI_H
9 #define DRIVERS_PARTITION_EFI_H
10 
11 #include <stdint.h>
12 #include <string.h>
13 
14 #include "uuid.h"
15 
16 #define EFI_NAMELEN 36
17 
guidcmp(const void * g1,const void * g2)18 static inline int guidcmp(const void *g1, const void *g2) {
19     return memcmp(g1, g2, sizeof(struct efi_guid));
20 }
21 
guidcpy(void * dst,const void * src)22 static inline void *guidcpy(void *dst, const void *src) {
23     return memcpy(dst, src, sizeof(struct efi_guid));
24 }
25 
26 #define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7)  \
27     {                                                      \
28         (a) & 0xffffffff, (b)&0xffff, (c)&0xffff, {        \
29             (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) \
30         }                                                  \
31     }
32 
33 #define NULL_GUID                                                            \
34     EFI_GUID(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
35              0x00, 0x00)
36 
37 #endif /* DRIVERS_PARTITION_EFI_H */
38