compiler-gcc.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* Never include this file directly. Include <linux/compiler.h> instead. */
  2. /*
  3. * Common definitions for all gcc versions go here.
  4. */
  5. /* Optimization barrier */
  6. /* The "volatile" is due to gcc bugs */
  7. #define barrier() __asm__ __volatile__("": : :"memory")
  8. /* This macro obfuscates arithmetic on a variable address so that gcc
  9. shouldn't recognize the original var, and make assumptions about it */
  10. /*
  11. * Versions of the ppc64 compiler before 4.1 had a bug where use of
  12. * RELOC_HIDE could trash r30. The bug can be worked around by changing
  13. * the inline assembly constraint from =g to =r, in this particular
  14. * case either is valid.
  15. */
  16. #define RELOC_HIDE(ptr, off) \
  17. ({ unsigned long __ptr; \
  18. __asm__ ("" : "=r"(__ptr) : "0"(ptr)); \
  19. (typeof(ptr)) (__ptr + (off)); })
  20. #define inline inline __attribute__((always_inline))
  21. #define __inline__ __inline__ __attribute__((always_inline))
  22. #define __inline __inline __attribute__((always_inline))
  23. #define __deprecated __attribute__((deprecated))
  24. #define __packed __attribute__((packed))
  25. #define __weak __attribute__((weak))
  26. #define __naked __attribute__((naked))
  27. #define __noreturn __attribute__((noreturn))
  28. #define __pure __attribute__((pure))
  29. #define __aligned(x) __attribute__((aligned(x)))
  30. #define __printf(a,b) __attribute__((format(printf,a,b)))
  31. #define noinline __attribute__((noinline))
  32. #define __attribute_pure__ __attribute__((pure))
  33. #define __attribute_const__ __attribute__((__const__))