logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0001-Revert-Use-__builtin_bswap16-in-EFI_GUID-and-other-p.patch (2618B)


  1. From 44f9caeedfaa265b1ced2b77e232ffc94b610b12 Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Fri, 31 Jan 2020 13:51:55 -0800
  4. Subject: [PATCH] Revert "Use __builtin_bswap16() in EFI_GUID and other
  5. places."
  6. This reverts commit 8dddb5e8da3cabb5927b839d6faaa42b48b58a87.
  7. ---
  8. src/efivar_endian.h | 24 ++++++++++++------------
  9. src/include/efivar/efivar.h | 2 +-
  10. 2 files changed, 13 insertions(+), 13 deletions(-)
  11. diff --git a/src/efivar_endian.h b/src/efivar_endian.h
  12. index b8e6a31..ce37019 100644
  13. --- a/src/efivar_endian.h
  14. +++ b/src/efivar_endian.h
  15. @@ -29,12 +29,12 @@
  16. #define le16_to_cpu(x) (x)
  17. #define le32_to_cpu(x) (x)
  18. #define le64_to_cpu(x) ((uint64_t)x)
  19. -#define cpu_to_be16(x) __builtin_bswap16(x)
  20. -#define cpu_to_be32(x) __builtin_bswap32(x)
  21. -#define cpu_to_be64(x) ((uint64_t)__builtin_bswap64(x))
  22. -#define be16_to_cpu(x) __builtin_bswap16(x)
  23. -#define be32_to_cpu(x) __builtin_bswap32(x)
  24. -#define be64_to_cpu(x) ((uint64_t)__builtin_bswap64(x))
  25. +#define cpu_to_be16(x) __bswap_16(x)
  26. +#define cpu_to_be32(x) __bswap_32(x)
  27. +#define cpu_to_be64(x) ((uint64_t)__bswap_64(x))
  28. +#define be16_to_cpu(x) __bswap_16(x)
  29. +#define be32_to_cpu(x) __bswap_32(x)
  30. +#define be64_to_cpu(x) ((uint64_t)__bswap_64(x))
  31. #else
  32. #define cpu_to_be16(x) (x)
  33. #define cpu_to_be32(x) (x)
  34. @@ -42,12 +42,12 @@
  35. #define be16_to_cpu(x) (x)
  36. #define be32_to_cpu(x) (x)
  37. #define be64_to_cpu(x) ((uint64_t)x)
  38. -#define cpu_to_le16(x) __builtin_bswap16(x)
  39. -#define cpu_to_le32(x) __builtin_bswap32(x)
  40. -#define cpu_to_le64(x) ((uint64_t)__builtin_bswap64(x))
  41. -#define le16_to_cpu(x) __builtin_bswap16(x)
  42. -#define le32_to_cpu(x) __builtin_bswap32(x)
  43. -#define le64_to_cpu(x) ((uint64_t)__builtin_bswap64(x))
  44. +#define cpu_to_le16(x) __bswap_16(x)
  45. +#define cpu_to_le32(x) __bswap_32(x)
  46. +#define cpu_to_le64(x) ((uint64_t)__bswap_64(x))
  47. +#define le16_to_cpu(x) __bswap_16(x)
  48. +#define le32_to_cpu(x) __bswap_32(x)
  49. +#define le64_to_cpu(x) ((uint64_t)__bswap_64(x))
  50. #endif
  51. #endif /* _EFIVAR_ENDIAN_H */
  52. diff --git a/src/include/efivar/efivar.h b/src/include/efivar/efivar.h
  53. index 316891c..32d8a29 100644
  54. --- a/src/include/efivar/efivar.h
  55. +++ b/src/include/efivar/efivar.h
  56. @@ -63,7 +63,7 @@ typedef struct {
  57. #if BYTE_ORDER == LITTLE_ENDIAN
  58. #define EFI_GUID(a,b,c,d,e0,e1,e2,e3,e4,e5) \
  59. -((efi_guid_t) {(a), (b), (c), __builtin_bswap16(d), { (e0), (e1), (e2), (e3), (e4), (e5) }})
  60. +((efi_guid_t) {(a), (b), (c), bswap_16(d), { (e0), (e1), (e2), (e3), (e4), (e5) }})
  61. #else
  62. #define EFI_GUID(a,b,c,d,e0,e1,e2,e3,e4,e5) \
  63. ((efi_guid_t) {(a), (b), (c), (d), { (e0), (e1), (e2), (e3), (e4), (e5) }})
  64. --
  65. 2.25.0