Sughosh Ganu | 1c47f64 | 2021-07-02 16:00:40 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2021, Linaro Limited |
Yann Gautier | a3efb41 | 2022-11-18 13:43:32 +0100 | [diff] [blame] | 3 | * Copyright (c) 2022, STMicroelectronics - All Rights Reserved |
Sughosh Ganu | 1c47f64 | 2021-07-02 16:00:40 +0530 | [diff] [blame] | 4 | * |
| 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 | |
| 18 | static inline int guidcmp(const void *g1, const void *g2) |
| 19 | { |
| 20 | return memcmp(g1, g2, sizeof(struct efi_guid)); |
| 21 | } |
| 22 | |
| 23 | static 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 Gautier | a3efb41 | 2022-11-18 13:43:32 +0100 | [diff] [blame] | 29 | { (a) & 0xffffffffU, \ |
| 30 | (b) & 0xffffU, \ |
| 31 | (c) & 0xffffU, \ |
Sughosh Ganu | 1c47f64 | 2021-07-02 16:00:40 +0530 | [diff] [blame] | 32 | { (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } } |
| 33 | |
| 34 | #define NULL_GUID \ |
Yann Gautier | a3efb41 | 2022-11-18 13:43:32 +0100 | [diff] [blame] | 35 | EFI_GUID(0x00000000U, 0x0000U, 0x0000U, 0x00U, 0x00U, \ |
| 36 | 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U) |
Sughosh Ganu | 1c47f64 | 2021-07-02 16:00:40 +0530 | [diff] [blame] | 37 | |
| 38 | #endif /* DRIVERS_PARTITION_EFI_H */ |