linkage.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * U-Boot - linkage.h
  4. *
  5. * Copyright (c) 2005-2007 Analog Devices Inc.
  6. */
  7. #ifndef _LINUX_LINKAGE_H
  8. #define _LINUX_LINKAGE_H
  9. #include <asm/linkage.h>
  10. /* Some toolchains use other characters (e.g. '`') to mark new line in macro */
  11. #ifndef ASM_NL
  12. #define ASM_NL ;
  13. #endif
  14. #ifdef __cplusplus
  15. #define CPP_ASMLINKAGE extern "C"
  16. #else
  17. #define CPP_ASMLINKAGE
  18. #endif
  19. #ifndef asmlinkage
  20. #define asmlinkage CPP_ASMLINKAGE
  21. #endif
  22. #define SYMBOL_NAME_STR(X) #X
  23. #define SYMBOL_NAME(X) X
  24. #ifdef __STDC__
  25. #define SYMBOL_NAME_LABEL(X) X##:
  26. #else
  27. #define SYMBOL_NAME_LABEL(X) X:
  28. #endif
  29. #ifndef __ALIGN
  30. #define __ALIGN .align 4
  31. #endif
  32. #ifndef __ALIGN_STR
  33. #define __ALIGN_STR ".align 4"
  34. #endif
  35. #ifdef __ASSEMBLY__
  36. #define ALIGN __ALIGN
  37. #define ALIGN_STR __ALIGN_STR
  38. #define LENTRY(name) \
  39. ALIGN ASM_NL \
  40. SYMBOL_NAME_LABEL(name)
  41. #define ENTRY(name) \
  42. .globl SYMBOL_NAME(name) ASM_NL \
  43. LENTRY(name)
  44. #define WEAK(name) \
  45. .weak SYMBOL_NAME(name) ASM_NL \
  46. LENTRY(name)
  47. #ifndef END
  48. #define END(name) \
  49. .size name, .-name
  50. #endif
  51. #ifndef ENDPROC
  52. #define ENDPROC(name) \
  53. .type name STT_FUNC ASM_NL \
  54. END(name)
  55. #endif
  56. #endif
  57. #endif