sysdep.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. #define C_LABEL(name) __C_SYMBOL_PREFIX__ name
  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 ASM_GLOBAL_DIRECTIVE
  26. #define ASM_GLOBAL_DIRECTIVE .global
  27. #endif
  28. #ifndef C_SYMBOL_NAME
  29. #define C_SYMBOL_NAME(name) name
  30. #endif
  31. #ifdef __ASSEMBLER__
  32. /* Syntactic details of assembler. */
  33. #ifdef __HAVE_ELF__
  34. #define ALIGNARG(log2) log2
  35. /* For ELF we need the `.type' directive to make shared libs work right. */
  36. #define ASM_TYPE_DIRECTIVE(name,typearg) .type name,@##typearg;
  37. #define ASM_SIZE_DIRECTIVE(name) .size name,.-name
  38. #ifdef SHARED
  39. #define PLTJMP(_x) _x##@PLT
  40. #else
  41. #define PLTJMP(_x) _x
  42. #endif
  43. #else
  44. #define ALIGNARG(log2) log2
  45. #define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified. */
  46. #define ASM_SIZE_DIRECTIVE(name) /* Nothing is specified. */
  47. #define C_SYMBOL_NAME(name) name /* Nothing is specified. */
  48. #define PLTJMP(_x) _x
  49. #endif
  50. /* Define an entry point visible from C. */
  51. #define ENTRY(name) \
  52. ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
  53. ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),function) \
  54. .align ALIGNARG(5); \
  55. C_LABEL(name) \
  56. CALL_MCOUNT
  57. #undef END
  58. #define END(name) \
  59. ASM_SIZE_DIRECTIVE(C_SYMBOL_NAME(name))
  60. /* If compiled for profiling, call `_mcount' at the start of each function. */
  61. #ifdef PROF
  62. #define CALL_MCOUNT /* NOTYET */
  63. #else
  64. #define CALL_MCOUNT /* Do nothing. */
  65. #endif
  66. #endif /* __ASSEMBLER__ */