synch.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #if defined(__powerpc64__) || defined(CONFIG_PPC_E500MC)
  7. #define __SUBARCH_HAS_LWSYNC
  8. #endif
  9. #ifndef __ASSEMBLY__
  10. extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
  11. extern void do_lwsync_fixups(unsigned long value, void *fixup_start,
  12. void *fixup_end);
  13. static inline void eieio(void)
  14. {
  15. __asm__ __volatile__ ("eieio" : : : "memory");
  16. }
  17. static inline void isync(void)
  18. {
  19. __asm__ __volatile__ ("isync" : : : "memory");
  20. }
  21. #endif /* __ASSEMBLY__ */
  22. #if defined(__powerpc64__)
  23. # define LWSYNC lwsync
  24. #elif defined(CONFIG_E500)
  25. # define LWSYNC \
  26. START_LWSYNC_SECTION(96); \
  27. sync; \
  28. MAKE_LWSYNC_SECTION_ENTRY(96, __lwsync_fixup);
  29. #else
  30. # define LWSYNC sync
  31. #endif
  32. #ifdef CONFIG_SMP
  33. #define ISYNC_ON_SMP "\n\tisync\n"
  34. #define LWSYNC_ON_SMP stringify_in_c(LWSYNC) "\n"
  35. #else
  36. #define ISYNC_ON_SMP
  37. #define LWSYNC_ON_SMP
  38. #endif
  39. #endif /* __KERNEL__ */
  40. #endif /* _ASM_POWERPC_SYNCH_H */