0022-compiler-rt-Use-mcr-based-barrier-on-armv6.patch 948 B

123456789101112131415161718192021222324252627282930313233343536
  1. From 0fab2593b436ef1aa87cb272297903a4e0189fd5 Mon Sep 17 00:00:00 2001
  2. From: "yang.lee" <yang.lee@starfivetech.com>
  3. Date: Thu, 26 May 2022 11:26:50 +0800
  4. Subject: [PATCH 3/3] compiler-rt: Use mcr based barrier on armv6
  5. dsb is an armv7 instruction and wont work when we are building for armv6.
  6. Rebased By Lee Yang
  7. Upstream-Status: Pending
  8. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  9. ---
  10. compiler-rt/lib/builtins/assembly.h | 8 ++++++++
  11. 1 file changed, 8 insertions(+)
  12. diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h
  13. index 69a3d8620f92..60bac86df218 100644
  14. --- a/compiler-rt/lib/builtins/assembly.h
  15. +++ b/compiler-rt/lib/builtins/assembly.h
  16. @@ -189,6 +189,14 @@
  17. JMP(ip)
  18. #endif
  19. +#if __ARM_ARCH >= 7
  20. +#define DMB dmb
  21. +#elif __ARM_ARCH >= 6
  22. +#define DMB mcr p15, #0, r0, c7, c10, #5
  23. +#else
  24. +#error Only use this with ARMv6+
  25. +#endif
  26. +
  27. #if defined(USE_THUMB_2)
  28. #define WIDE(op) op.w
  29. #else
  30. --
  31. 2.25.1