barrier.h 697 B

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