efi.h 791 B

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