linkage.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
  4. */
  5. #ifndef __ASM_LINKAGE_H
  6. #define __ASM_LINKAGE_H
  7. #include <asm/dwarf.h>
  8. #define ASM_NL ` /* use '`' to mark new line in macro */
  9. #define __ALIGN .align 4
  10. #define __ALIGN_STR __stringify(__ALIGN)
  11. #ifdef __ASSEMBLY__
  12. .macro ST2 e, o, off
  13. #ifdef CONFIG_ARC_HAS_LL64
  14. std \e, [sp, \off]
  15. #else
  16. st \e, [sp, \off]
  17. st \o, [sp, \off+4]
  18. #endif
  19. .endm
  20. .macro LD2 e, o, off
  21. #ifdef CONFIG_ARC_HAS_LL64
  22. ldd \e, [sp, \off]
  23. #else
  24. ld \e, [sp, \off]
  25. ld \o, [sp, \off+4]
  26. #endif
  27. .endm
  28. /* annotation for data we want in DCCM - if enabled in .config */
  29. .macro ARCFP_DATA nm
  30. #ifdef CONFIG_ARC_HAS_DCCM
  31. .section .data.arcfp
  32. #else
  33. .section .data
  34. #endif
  35. .global \nm
  36. .endm
  37. /* annotation for data we want in DCCM - if enabled in .config */
  38. .macro ARCFP_CODE
  39. #ifdef CONFIG_ARC_HAS_ICCM
  40. .section .text.arcfp, "ax",@progbits
  41. #else
  42. .section .text, "ax",@progbits
  43. #endif
  44. .endm
  45. #define ENTRY_CFI(name) \
  46. .globl name ASM_NL \
  47. ALIGN ASM_NL \
  48. name: ASM_NL \
  49. CFI_STARTPROC ASM_NL
  50. #define END_CFI(name) \
  51. CFI_ENDPROC ASM_NL \
  52. .size name, .-name
  53. #else /* !__ASSEMBLY__ */
  54. #ifdef CONFIG_ARC_HAS_ICCM
  55. #define __arcfp_code __section(".text.arcfp")
  56. #else
  57. #define __arcfp_code __section(".text")
  58. #endif
  59. #ifdef CONFIG_ARC_HAS_DCCM
  60. #define __arcfp_data __section(".data.arcfp")
  61. #else
  62. #define __arcfp_data __section(".data")
  63. #endif
  64. #endif /* __ASSEMBLY__ */
  65. #endif