linkage.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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 asmlinkage_protect
  16. # define asmlinkage_protect(n, ret, args...) 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. /* If symbol 'name' is treated as a subroutine (gets called, and returns)
  47. * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
  48. * static analysis tools such as stack depth analyzer.
  49. */
  50. #ifndef ENDPROC
  51. #define ENDPROC(name) \
  52. .type name, @function; \
  53. END(name)
  54. #endif
  55. #endif
  56. #define NORET_TYPE /**/
  57. #define ATTRIB_NORET __attribute__((noreturn))
  58. #define NORET_AND noreturn,
  59. #endif