asm-compat.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef _ASM_POWERPC_ASM_COMPAT_H
  2. #define _ASM_POWERPC_ASM_COMPAT_H
  3. #include <asm/types.h>
  4. #ifdef __ASSEMBLY__
  5. # define stringify_in_c(...) __VA_ARGS__
  6. # define ASM_CONST(x) x
  7. #else
  8. /* This version of stringify will deal with commas... */
  9. # define __stringify_in_c(...) #__VA_ARGS__
  10. # define stringify_in_c(...) __stringify_in_c(__VA_ARGS__) " "
  11. # define __ASM_CONST(x) x##UL
  12. # define ASM_CONST(x) __ASM_CONST(x)
  13. #endif
  14. #ifdef __powerpc64__
  15. /* operations for longs and pointers */
  16. #define PPC_LL stringify_in_c(ld)
  17. #define PPC_STL stringify_in_c(std)
  18. #define PPC_LCMPI stringify_in_c(cmpdi)
  19. #define PPC_LONG stringify_in_c(.llong)
  20. #define PPC_TLNEI stringify_in_c(tdnei)
  21. #define PPC_LLARX stringify_in_c(ldarx)
  22. #define PPC_STLCX stringify_in_c(stdcx.)
  23. #define PPC_CNTLZL stringify_in_c(cntlzd)
  24. #else /* 32-bit */
  25. /* operations for longs and pointers */
  26. #define PPC_LL stringify_in_c(lwz)
  27. #define PPC_STL stringify_in_c(stw)
  28. #define PPC_LCMPI stringify_in_c(cmpwi)
  29. #define PPC_LONG stringify_in_c(.long)
  30. #define PPC_TLNEI stringify_in_c(twnei)
  31. #define PPC_LLARX stringify_in_c(lwarx)
  32. #define PPC_STLCX stringify_in_c(stwcx.)
  33. #define PPC_CNTLZL stringify_in_c(cntlzw)
  34. #endif
  35. #ifdef __KERNEL__
  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
  47. #endif /* _ASM_POWERPC_ASM_COMPAT_H */