sysdep.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /* Assembler macros for SH.
  2. Copyright (C) 1999, 2000 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 Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. 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. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public
  13. License along with the GNU C Library; see the file COPYING.LIB. If not,
  14. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  15. Boston, MA 02111-1307, USA. */
  16. #define __need_uClibc_config_h 1
  17. #include <bits/uClibc_config.h>
  18. /* Define a macro we can use to construct the asm name for a C symbol. */
  19. #ifdef NO_UNDERSCORES
  20. #ifdef __STDC__
  21. #define C_LABEL(name) name##:
  22. #else
  23. #define C_LABEL(name) name/**/:
  24. #endif
  25. #else
  26. #ifdef __STDC__
  27. #define C_LABEL(name) _##name##:
  28. #else
  29. #define C_LABEL(name) _/**/name/**/:
  30. #endif
  31. #endif
  32. /* Mark the end of function named SYM. This is used on some platforms
  33. to generate correct debugging information. */
  34. #ifndef END
  35. #define END(sym)
  36. #endif
  37. #ifndef ASM_GLOBAL_DIRECTIVE
  38. #define ASM_GLOBAL_DIRECTIVE .global
  39. #endif
  40. #ifndef C_SYMBOL_NAME
  41. #define C_SYMBOL_NAME(name) name
  42. #endif
  43. #ifdef __ASSEMBLER__
  44. /* Syntactic details of assembler. */
  45. #ifdef HAVE_ELF
  46. #define ALIGNARG(log2) log2
  47. /* For ELF we need the `.type' directive to make shared libs work right. */
  48. #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,@##typearg;
  49. #define ASM_SIZE_DIRECTIVE(name) .size name,.-name
  50. #ifdef SHARED
  51. #define PLTJMP(_x) _x##@PLT
  52. #else
  53. #define PLTJMP(_x) _x
  54. #endif
  55. #else
  56. #define ALIGNARG(log2) log2
  57. #define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified. */
  58. #define ASM_SIZE_DIRECTIVE(name) /* Nothing is specified. */
  59. #define C_SYMBOL_NAME(name) name /* Nothing is specified. */
  60. #define PLTJMP(_x) _x
  61. #endif
  62. /* Define an entry point visible from C. */
  63. #define ENTRY(name) \
  64. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
  65. ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
  66. .align ALIGNARG(5); \
  67. C_LABEL(name) \
  68. CALL_MCOUNT
  69. #undef END
  70. #define END(name) \
  71. ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name))
  72. /* If compiled for profiling, call `mcount' at the start of each function. */
  73. #ifdef PROF
  74. #define CALL_MCOUNT /* NOTYET */
  75. #else
  76. #define CALL_MCOUNT /* Do nothing. */
  77. #endif
  78. #ifdef NO_UNDERSCORES
  79. /* Since C identifiers are not normally prefixed with an underscore
  80. on this system, the asm identifier `syscall_error' intrudes on the
  81. C name space. Make sure we use an innocuous name. */
  82. #define syscall_error __syscall_error
  83. #define mcount _mcount
  84. #endif
  85. #endif /* __ASSEMBLER__ */