blob: e463f965721bb6aaef0b7651e7da6fdd0ff609df [file] [log] [blame]
Sughosh Ganu1c47f642021-07-02 16:00:40 +05301/*
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 <string.h>
12
13#include <tools_share/uuid.h>
14
15#define EFI_NAMELEN 36
16
17static inline int guidcmp(const void *g1, const void *g2)
18{
19 return memcmp(g1, g2, sizeof(struct efi_guid));
20}
21
22static inline void *guidcpy(void *dst, const void *src)
23{
24 return memcpy(dst, src, sizeof(struct efi_guid));
25}
26
27#define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
28 { (a) & 0xffffffff, \
29 (b) & 0xffff, \
30 (c) & 0xffff, \
31 { (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } }
32
33#define NULL_GUID \
34 EFI_GUID(0x00000000, 0x0000, 0x0000, 0x00, 0x00, \
35 0x00, 0x00, 0x00, 0x00, 0x00, 0x00)
36
37#endif /* DRIVERS_PARTITION_EFI_H */