linkage.h 971 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * U-boot - linkage.h
  3. *
  4. * Copyright (c) 2005-2007 Analog Devices Inc.
  5. *
  6. * SPDX-License-Identifier: GPL-2.0+
  7. */
  8. #ifndef _LINUX_LINKAGE_H
  9. #define _LINUX_LINKAGE_H
  10. #include <asm/linkage.h>
  11. #include <linux/config.h>
  12. #ifdef __cplusplus
  13. #define CPP_ASMLINKAGE extern "C"
  14. #else
  15. #define CPP_ASMLINKAGE
  16. #endif
  17. #define asmlinkage CPP_ASMLINKAGE
  18. #define SYMBOL_NAME_STR(X) #X
  19. #define SYMBOL_NAME(X) X
  20. #ifdef __STDC__
  21. #define SYMBOL_NAME_LABEL(X) X##:
  22. #else
  23. #define SYMBOL_NAME_LABEL(X) X:
  24. #endif
  25. #ifndef __ALIGN
  26. #define __ALIGN .align 4
  27. #endif
  28. #ifndef __ALIGN_STR
  29. #define __ALIGN_STR ".align 4"
  30. #endif
  31. #ifdef __ASSEMBLY__
  32. #define ALIGN __ALIGN
  33. #define ALIGN_STR __ALIGN_STR
  34. #define LENTRY(name) \
  35. ALIGN; \
  36. SYMBOL_NAME_LABEL(name)
  37. #define ENTRY(name) \
  38. .globl SYMBOL_NAME(name); \
  39. LENTRY(name)
  40. #ifndef END
  41. #define END(name) \
  42. .size name, .-name
  43. #endif
  44. #ifndef ENDPROC
  45. #define ENDPROC(name) \
  46. .type name STT_FUNC; \
  47. END(name)
  48. #endif
  49. #endif
  50. #endif