linkage.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef _LINUX_LINKAGE_H
  2. #define _LINUX_LINKAGE_H
  3. #include <asm/linkage.h>
  4. #ifdef __cplusplus
  5. #define CPP_ASMLINKAGE extern "C"
  6. #else
  7. #define CPP_ASMLINKAGE
  8. #endif
  9. #ifndef asmlinkage
  10. #define asmlinkage CPP_ASMLINKAGE
  11. #endif
  12. #ifndef asmregparm
  13. # define asmregparm
  14. #endif
  15. #ifndef prevent_tail_call
  16. # define prevent_tail_call(ret) do { } while (0)
  17. #endif
  18. #ifndef __ALIGN
  19. #define __ALIGN .align 4,0x90
  20. #define __ALIGN_STR ".align 4,0x90"
  21. #endif
  22. #ifdef __ASSEMBLY__
  23. #define ALIGN __ALIGN
  24. #define ALIGN_STR __ALIGN_STR
  25. #ifndef ENTRY
  26. #define ENTRY(name) \
  27. .globl name; \
  28. ALIGN; \
  29. name:
  30. #endif
  31. #ifndef WEAK
  32. #define WEAK(name) \
  33. .weak name; \
  34. name:
  35. #endif
  36. #define KPROBE_ENTRY(name) \
  37. .pushsection .kprobes.text, "ax"; \
  38. ENTRY(name)
  39. #define KPROBE_END(name) \
  40. END(name); \
  41. .popsection
  42. #ifndef END
  43. #define END(name) \
  44. .size name, .-name
  45. #endif
  46. #ifndef ENDPROC
  47. #define ENDPROC(name) \
  48. .type name, @function; \
  49. END(name)
  50. #endif
  51. #endif
  52. #define NORET_TYPE /**/
  53. #define ATTRIB_NORET __attribute__((noreturn))
  54. #define NORET_AND noreturn,
  55. #ifndef FASTCALL
  56. #define FASTCALL(x) x
  57. #define fastcall
  58. #endif
  59. #endif