asm-compat.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef _ASM_POWERPC_ASM_COMPAT_H
  2. #define _ASM_POWERPC_ASM_COMPAT_H
  3. #include <linux/config.h>
  4. #include <asm/types.h>
  5. #ifdef __ASSEMBLY__
  6. # define stringify_in_c(...) __VA_ARGS__
  7. # define ASM_CONST(x) x
  8. #else
  9. /* This version of stringify will deal with commas... */
  10. # define __stringify_in_c(...) #__VA_ARGS__
  11. # define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " "
  12. # define __ASM_CONST(x) x##UL
  13. # define ASM_CONST(x) __ASM_CONST(x)
  14. #endif
  15. #ifdef __powerpc64__
  16. /* operations for longs and pointers */
  17. #define PPC_LL stringify_in_c(ld)
  18. #define PPC_STL stringify_in_c(std)
  19. #define PPC_LCMPI stringify_in_c(cmpdi)
  20. #define PPC_LONG stringify_in_c(.llong)
  21. #define PPC_TLNEI stringify_in_c(tdnei)
  22. #define PPC_LLARX stringify_in_c(ldarx)
  23. #define PPC_STLCX stringify_in_c(stdcx.)
  24. #define PPC_CNTLZL stringify_in_c(cntlzd)
  25. #else /* 32-bit */
  26. /* operations for longs and pointers */
  27. #define PPC_LL stringify_in_c(lwz)
  28. #define PPC_STL stringify_in_c(stw)
  29. #define PPC_LCMPI stringify_in_c(cmpwi)
  30. #define PPC_LONG stringify_in_c(.long)
  31. #define PPC_TLNEI stringify_in_c(twnei)
  32. #define PPC_LLARX stringify_in_c(lwarx)
  33. #define PPC_STLCX stringify_in_c(stwcx.)
  34. #define PPC_CNTLZL stringify_in_c(cntlzw)
  35. #endif
  36. #ifdef CONFIG_IBM405_ERR77
  37. /* Erratum #77 on the 405 means we need a sync or dcbt before every
  38. * stwcx. The old ATOMIC_SYNC_FIX covered some but not all of this.
  39. */
  40. #define PPC405_ERR77(ra,rb) stringify_in_c(dcbt ra, rb;)
  41. #define PPC405_ERR77_SYNC stringify_in_c(sync;)
  42. #else
  43. #define PPC405_ERR77(ra,rb)
  44. #define PPC405_ERR77_SYNC
  45. #endif
  46. #endif /* _ASM_POWERPC_ASM_COMPAT_H */