arch-arm.h 966 B

1234567891011121314151617181920212223242526272829303132
  1. /*-------------------------------------------------------------------------
  2. *
  3. * arch-arm.h
  4. * Atomic operations considerations specific to ARM
  5. *
  6. * Portions Copyright (c) 2013-2022, PostgreSQL Global Development Group
  7. *
  8. * NOTES:
  9. *
  10. * src/include/port/atomics/arch-arm.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. /* intentionally no include guards, should only be included by atomics.h */
  15. #ifndef INSIDE_ATOMICS_H
  16. #error "should be included via atomics.h"
  17. #endif
  18. /*
  19. * 64 bit atomics on ARM32 are implemented using kernel fallbacks and thus
  20. * might be slow, so disable entirely. On ARM64 that problem doesn't exist.
  21. */
  22. #if !defined(__aarch64__) && !defined(__aarch64)
  23. #define PG_DISABLE_64_BIT_ATOMICS
  24. #else
  25. /*
  26. * Architecture Reference Manual for ARMv8 states aligned read/write to/from
  27. * general purpose register is atomic.
  28. */
  29. #define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY
  30. #endif /* __aarch64__ || __aarch64 */