blob: 96c2857379a19c741a510ae5200422c7e34bd57b [file] [log] [blame]
Sughosh Ganu1c47f642021-07-02 16:00:40 +05301/*
2 * Copyright (c) 2021, Linaro Limited
Yann Gautiera3efb412022-11-18 13:43:32 +01003 * Copyright (c) 2022, STMicroelectronics - All Rights Reserved
Sughosh Ganu1c47f642021-07-02 16:00:40 +05304 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 *
7 */
8
9#ifndef DRIVERS_PARTITION_EFI_H
10#define DRIVERS_PARTITION_EFI_H
11
12#include <string.h>
13
14#include <tools_share/uuid.h>
15
16#define EFI_NAMELEN 36
17
18static inline int guidcmp(const void *g1, const void *g2)
19{
20 return memcmp(g1, g2, sizeof(struct efi_guid));
21}
22
23static inline void *guidcpy(void *dst, const void *src)
24{
25 return memcpy(dst, src, sizeof(struct efi_guid));
26}
27
28#define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
Yann Gautiera3efb412022-11-18 13:43:32 +010029 { (a) & 0xffffffffU, \
30 (b) & 0xffffU, \
31 (c) & 0xffffU, \
Sughosh Ganu1c47f642021-07-02 16:00:40 +053032 { (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } }
33
34#define NULL_GUID \
Yann Gautiera3efb412022-11-18 13:43:32 +010035 EFI_GUID(0x00000000U, 0x0000U, 0x0000U, 0x00U, 0x00U, \
36 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U)
Sughosh Ganu1c47f642021-07-02 16:00:40 +053037
38#endif /* DRIVERS_PARTITION_EFI_H */