synch.h 642 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef _ASM_POWERPC_SYNCH_H
  2. #define _ASM_POWERPC_SYNCH_H
  3. #ifdef __KERNEL__
  4. #include <linux/stringify.h>
  5. #ifdef __powerpc64__
  6. #define __SUBARCH_HAS_LWSYNC
  7. #endif
  8. #ifdef __SUBARCH_HAS_LWSYNC
  9. # define LWSYNC lwsync
  10. #else
  11. # define LWSYNC sync
  12. #endif
  13. #ifdef CONFIG_SMP
  14. #define ISYNC_ON_SMP "\n\tisync\n"
  15. #define LWSYNC_ON_SMP __stringify(LWSYNC) "\n"
  16. #else
  17. #define ISYNC_ON_SMP
  18. #define LWSYNC_ON_SMP
  19. #endif
  20. static inline void eieio(void)
  21. {
  22. __asm__ __volatile__ ("eieio" : : : "memory");
  23. }
  24. static inline void isync(void)
  25. {
  26. __asm__ __volatile__ ("isync" : : : "memory");
  27. }
  28. #endif /* __KERNEL__ */
  29. #endif /* _ASM_POWERPC_SYNCH_H */