efi.h 869 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2021, Linaro Limited
  3. * Copyright (c) 2022, STMicroelectronics - All Rights Reserved
  4. *
  5. * SPDX-License-Identifier: BSD-3-Clause
  6. *
  7. */
  8. #ifndef DRIVERS_PARTITION_EFI_H
  9. #define DRIVERS_PARTITION_EFI_H
  10. #include <string.h>
  11. #include <tools_share/uuid.h>
  12. #define EFI_NAMELEN 36
  13. static inline int guidcmp(const void *g1, const void *g2)
  14. {
  15. return memcmp(g1, g2, sizeof(struct efi_guid));
  16. }
  17. static inline void *guidcpy(void *dst, const void *src)
  18. {
  19. return memcpy(dst, src, sizeof(struct efi_guid));
  20. }
  21. #define EFI_GUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
  22. { (a) & 0xffffffffU, \
  23. (b) & 0xffffU, \
  24. (c) & 0xffffU, \
  25. { (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } }
  26. #define NULL_GUID \
  27. EFI_GUID(0x00000000U, 0x0000U, 0x0000U, 0x00U, 0x00U, \
  28. 0x00U, 0x00U, 0x00U, 0x00U, 0x00U, 0x00U)
  29. #endif /* DRIVERS_PARTITION_EFI_H */