sysdep.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* Generic asm macros used on many machines.
  2. Copyright (C) 1991-2019 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, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef C_LABEL
  16. /* Define a macro we can use to construct the asm name for a C symbol. */
  17. # define C_LABEL(name) name##:
  18. #endif
  19. #ifdef __ASSEMBLER__
  20. /* Mark the end of function named SYM. This is used on some platforms
  21. to generate correct debugging information. */
  22. # ifndef END
  23. # define END(sym)
  24. # endif
  25. # ifndef JUMPTARGET
  26. # define JUMPTARGET(sym) sym
  27. # endif
  28. #endif
  29. /* Makros to generate eh_frame unwind information. */
  30. #ifdef __ASSEMBLER__
  31. # define cfi_startproc .cfi_startproc
  32. # define cfi_endproc .cfi_endproc
  33. # define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off
  34. # define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg
  35. # define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off
  36. # define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off
  37. # define cfi_offset(reg, off) .cfi_offset reg, off
  38. # define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off
  39. # define cfi_register(r1, r2) .cfi_register r1, r2
  40. # define cfi_return_column(reg) .cfi_return_column reg
  41. # define cfi_restore(reg) .cfi_restore reg
  42. # define cfi_same_value(reg) .cfi_same_value reg
  43. # define cfi_undefined(reg) .cfi_undefined reg
  44. # define cfi_remember_state .cfi_remember_state
  45. # define cfi_restore_state .cfi_restore_state
  46. # define cfi_window_save .cfi_window_save
  47. # define cfi_personality(enc, exp) .cfi_personality enc, exp
  48. # define cfi_lsda(enc, exp) .cfi_lsda enc, exp
  49. #else /* ! ASSEMBLER */
  50. # define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name)
  51. # define CFI_STRINGIFY2(Name) #Name
  52. # define CFI_STARTPROC ".cfi_startproc"
  53. # define CFI_ENDPROC ".cfi_endproc"
  54. # define CFI_DEF_CFA(reg, off) \
  55. ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
  56. # define CFI_DEF_CFA_REGISTER(reg) \
  57. ".cfi_def_cfa_register " CFI_STRINGIFY(reg)
  58. # define CFI_DEF_CFA_OFFSET(off) \
  59. ".cfi_def_cfa_offset " CFI_STRINGIFY(off)
  60. # define CFI_ADJUST_CFA_OFFSET(off) \
  61. ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off)
  62. # define CFI_OFFSET(reg, off) \
  63. ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
  64. # define CFI_REL_OFFSET(reg, off) \
  65. ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
  66. # define CFI_REGISTER(r1, r2) \
  67. ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
  68. # define CFI_RETURN_COLUMN(reg) \
  69. ".cfi_return_column " CFI_STRINGIFY(reg)
  70. # define CFI_RESTORE(reg) \
  71. ".cfi_restore " CFI_STRINGIFY(reg)
  72. # define CFI_UNDEFINED(reg) \
  73. ".cfi_undefined " CFI_STRINGIFY(reg)
  74. # define CFI_REMEMBER_STATE \
  75. ".cfi_remember_state"
  76. # define CFI_RESTORE_STATE \
  77. ".cfi_restore_state"
  78. # define CFI_WINDOW_SAVE \
  79. ".cfi_window_save"
  80. # define CFI_PERSONALITY(enc, exp) \
  81. ".cfi_personality " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
  82. # define CFI_LSDA(enc, exp) \
  83. ".cfi_lsda " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp)
  84. #endif
  85. #include "dwarf2.h"