arch-ppc.h 899 B

1234567891011121314151617181920212223242526
  1. /*-------------------------------------------------------------------------
  2. *
  3. * arch-ppc.h
  4. * Atomic operations considerations specific to PowerPC
  5. *
  6. * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
  7. * Portions Copyright (c) 1994, Regents of the University of California
  8. *
  9. * NOTES:
  10. *
  11. * src/include/port/atomics/arch-ppc.h
  12. *
  13. *-------------------------------------------------------------------------
  14. */
  15. #if defined(__GNUC__)
  16. /*
  17. * lwsync orders loads with respect to each other, and similarly with stores.
  18. * But a load can be performed before a subsequent store, so sync must be used
  19. * for a full memory barrier.
  20. */
  21. #define pg_memory_barrier_impl() __asm__ __volatile__ ("sync" : : : "memory")
  22. #define pg_read_barrier_impl() __asm__ __volatile__ ("lwsync" : : : "memory")
  23. #define pg_write_barrier_impl() __asm__ __volatile__ ("lwsync" : : : "memory")
  24. #endif