sysdep.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /* Generic asm macros used on many machines.
  2. Copyright (C) 1991,92,93,96,98,2002,2003 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #ifndef C_LABEL
  17. /* Define a macro we can use to construct the asm name for a C symbol. */
  18. #ifdef NO_UNDERSCORES
  19. #ifdef __STDC__
  20. #define C_LABEL(name) name##:
  21. #else
  22. #define C_LABEL(name) name/**/:
  23. #endif
  24. #else
  25. #ifdef __STDC__
  26. #define C_LABEL(name) _##name##:
  27. #else
  28. #define C_LABEL(name) _/**/name/**/:
  29. #endif
  30. #endif
  31. #endif
  32. #ifdef __ASSEMBLER__
  33. /* Mark the end of function named SYM. This is used on some platforms
  34. to generate correct debugging information. */
  35. #ifndef END
  36. #define END(sym)
  37. #endif
  38. #ifndef JUMPTARGET
  39. #define JUMPTARGET(sym) sym
  40. #endif
  41. /* Makros to generate eh_frame unwind information. */
  42. # ifdef HAVE_ASM_CFI_DIRECTIVES
  43. # define cfi_startproc .cfi_startproc
  44. # define cfi_endproc .cfi_endproc
  45. # define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off
  46. # define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
  47. # define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off
  48. # define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
  49. # define cfi_offset(reg, off) .cfi_offset reg, off
  50. # define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
  51. # define cfi_register(r1, r2) .cfi_register r1, r2
  52. # define cfi_return_column(reg) .cfi_return_column reg
  53. # define cfi_restore(reg) .cfi_restore reg
  54. # define cfi_same_value(reg) .cfi_same_value reg
  55. # define cfi_undefined(reg) .cfi_undefined reg
  56. # define cfi_remember_state .cfi_remember_state
  57. # define cfi_restore_state .cfi_restore_state
  58. # define cfi_window_save .cfi_window_save
  59. # else
  60. # define cfi_startproc
  61. # define cfi_endproc
  62. # define cfi_def_cfa(reg, off)
  63. # define cfi_def_cfa_register(reg)
  64. # define cfi_def_cfa_offset(off)
  65. # define cfi_adjust_cfa_offset(off)
  66. # define cfi_offset(reg, off)
  67. # define cfi_rel_offset(reg, off)
  68. # define cfi_register(r1, r2)
  69. # define cfi_return_column(reg)
  70. # define cfi_restore(reg)
  71. # define cfi_same_value(reg)
  72. # define cfi_undefined(reg)
  73. # define cfi_remember_state
  74. # define cfi_restore_state
  75. # define cfi_window_save
  76. # endif
  77. #else /* ! ASSEMBLER */
  78. # ifdef HAVE_ASM_CFI_DIRECTIVES
  79. # define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
  80. # define CFI_STRINGIFY2(Name) #Name
  81. # define CFI_STARTPROC ".cfi_startproc"
  82. # define CFI_ENDPROC ".cfi_endproc"
  83. # define CFI_DEF_CFA(reg, off) \
  84. ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
  85. # define CFI_DEF_CFA_REGISTER(reg) \
  86. ".cfi_def_cfa_register " CFI_STRINGIFY(reg)
  87. # define CFI_DEF_CFA_OFFSET(off) \
  88. ".cfi_def_cfa_offset " CFI_STRINGIFY(off)
  89. # define CFI_ADJUST_CFA_OFFSET(off) \
  90. ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off)
  91. # define CFI_OFFSET(reg, off) \
  92. ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
  93. # define CFI_REL_OFFSET(reg, off) \
  94. ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
  95. # define CFI_REGISTER(r1, r2) \
  96. ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
  97. # define CFI_RETURN_COLUMN(reg) \
  98. ".cfi_return_column " CFI_STRINGIFY(reg)
  99. # define CFI_RESTORE(reg) \
  100. ".cfi_restore " CFI_STRINGIFY(reg)
  101. # define CFI_UNDEFINED(reg) \
  102. ".cfi_undefined " CFI_STRINGIFY(reg)
  103. # define CFI_REMEMBER_STATE \
  104. ".cfi_remember_state"
  105. # define CFI_RESTORE_STATE \
  106. ".cfi_restore_state"
  107. # define CFI_WINDOW_SAVE \
  108. ".cfi_window_save"
  109. # else
  110. # define CFI_STARTPROC
  111. # define CFI_ENDPROC
  112. # define CFI_DEF_CFA(reg, off)
  113. # define CFI_DEF_CFA_REGISTER(reg)
  114. # define CFI_DEF_CFA_OFFSET(off)
  115. # define CFI_ADJUST_CFA_OFFSET(off)
  116. # define CFI_OFFSET(reg, off)
  117. # define CFI_REL_OFFSET(reg, off)
  118. # define CFI_REGISTER(r1, r2)
  119. # define CFI_RETURN_COLUMN(reg)
  120. # define CFI_RESTORE(reg)
  121. # define CFI_UNDEFINED(reg)
  122. # define CFI_REMEMBER_STATE
  123. # define CFI_RESTORE_STATE
  124. # define CFI_WINDOW_SAVE
  125. # endif
  126. #endif /* __ASSEMBLER__ */