barrier.h 658 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. * Copied from the kernel sources:
  3. *
  4. * Copyright IBM Corp. 1999, 2009
  5. *
  6. * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
  7. */
  8. #ifndef __TOOLS_LINUX_ASM_BARRIER_H
  9. #define __TOOLS_LINUX_ASM_BARRIER_H
  10. /*
  11. * Force strict CPU ordering.
  12. * And yes, this is required on UP too when we're talking
  13. * to devices.
  14. */
  15. #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES
  16. /* Fast-BCR without checkpoint synchronization */
  17. #define __ASM_BARRIER "bcr 14,0\n"
  18. #else
  19. #define __ASM_BARRIER "bcr 15,0\n"
  20. #endif
  21. #define mb() do { asm volatile(__ASM_BARRIER : : : "memory"); } while (0)
  22. #define rmb() mb()
  23. #define wmb() mb()
  24. #endif /* __TOOLS_LIB_ASM_BARRIER_H */