synch.h 973 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef _ASM_POWERPC_SYNCH_H
  2. #define _ASM_POWERPC_SYNCH_H
  3. #ifdef __KERNEL__
  4. #include <linux/stringify.h>
  5. #include <asm/feature-fixups.h>
  6. #ifndef __ASSEMBLY__
  7. extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
  8. extern void do_lwsync_fixups(unsigned long value, void *fixup_start,
  9. void *fixup_end);
  10. static inline void eieio(void)
  11. {
  12. __asm__ __volatile__ ("eieio" : : : "memory");
  13. }
  14. static inline void isync(void)
  15. {
  16. __asm__ __volatile__ ("isync" : : : "memory");
  17. }
  18. #endif /* __ASSEMBLY__ */
  19. #if defined(__powerpc64__)
  20. # define LWSYNC lwsync
  21. #elif defined(CONFIG_E500)
  22. # define LWSYNC \
  23. START_LWSYNC_SECTION(96); \
  24. sync; \
  25. MAKE_LWSYNC_SECTION_ENTRY(96, __lwsync_fixup);
  26. #else
  27. # define LWSYNC sync
  28. #endif
  29. #ifdef CONFIG_SMP
  30. #define ISYNC_ON_SMP "\n\tisync\n"
  31. #define LWSYNC_ON_SMP stringify_in_c(LWSYNC) "\n"
  32. #else
  33. #define ISYNC_ON_SMP
  34. #define LWSYNC_ON_SMP
  35. #endif
  36. #endif /* __KERNEL__ */
  37. #endif /* _ASM_POWERPC_SYNCH_H */