sysdep.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* Assembler macros for m68k.
  2. Copyright (C) 1998-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. #include <sysdeps/generic/sysdep.h>
  16. #ifdef __ASSEMBLER__
  17. /* Define an entry point visible from C.
  18. There is currently a bug in gdb which prevents us from specifying
  19. incomplete stabs information. Fake some entries here which specify
  20. the current source file. */
  21. # define ENTRY(name) \
  22. .globl C_SYMBOL_NAME(name); \
  23. .type C_SYMBOL_NAME(name),@function; \
  24. .p2align 2; \
  25. C_LABEL(name) \
  26. cfi_startproc; \
  27. CALL_MCOUNT
  28. # undef END
  29. # define END(name) \
  30. cfi_endproc; \
  31. .size name,.-name
  32. /* If compiled for profiling, call `_mcount' at the start of each function. */
  33. # ifdef PROF
  34. /* The mcount code relies on a normal frame pointer being on the stack
  35. to locate our caller, so push one just for its benefit. */
  36. # define CALL_MCOUNT \
  37. move.l %fp, -(%sp); \
  38. cfi_adjust_cfa_offset (4); cfi_rel_offset (%a6, 0); \
  39. move.l %sp, %fp; \
  40. jbsr JUMPTARGET (_mcount); \
  41. move.l (%sp)+, %fp; \
  42. cfi_adjust_cfa_offset (-4); cfi_restore (%a6);
  43. # else
  44. # define CALL_MCOUNT /* Do nothing. */
  45. # endif
  46. # define PSEUDO(name, syscall_name, args) \
  47. .globl __syscall_error; \
  48. ENTRY (name) \
  49. DO_CALL (syscall_name, args); \
  50. jcc JUMPTARGET(__syscall_error)
  51. # undef PSEUDO_END
  52. # define PSEUDO_END(name) \
  53. END (name)
  54. # undef JUMPTARGET
  55. # ifdef PIC
  56. # define JUMPTARGET(name) name##@PLTPC
  57. # else
  58. # define JUMPTARGET(name) name
  59. # endif
  60. #endif /* __ASSEMBLER__ */