sysdep.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /* Copyright (C) 1992-2019 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. Contributed by Alexandre Oliva <aoliva@redhat.com>.
  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/unix/mips/sysdep.h>
  16. #ifdef __ASSEMBLER__
  17. /* Note that while it's better structurally, going back to call __syscall_error
  18. can make things confusing if you're debugging---it looks like it's jumping
  19. backwards into the previous fn. */
  20. #ifdef __PIC__
  21. #define PSEUDO(name, syscall_name, args) \
  22. .align 2; \
  23. .set nomips16; \
  24. cfi_startproc; \
  25. 99:; \
  26. .set noat; \
  27. .cpsetup t9, $1, name; \
  28. cfi_register (gp, $1); \
  29. .set at; \
  30. dla t9,__syscall_error; \
  31. .cpreturn; \
  32. cfi_restore (gp); \
  33. jr t9; \
  34. cfi_endproc; \
  35. ENTRY(name) \
  36. li v0, SYS_ify(syscall_name); \
  37. syscall; \
  38. bne a3, zero, 99b; \
  39. L(syse1):
  40. #else
  41. #define PSEUDO(name, syscall_name, args) \
  42. .set noreorder; \
  43. .align 2; \
  44. .set nomips16; \
  45. cfi_startproc; \
  46. 99: j __syscall_error; \
  47. nop; \
  48. cfi_endproc; \
  49. ENTRY(name) \
  50. .set noreorder; \
  51. li v0, SYS_ify(syscall_name); \
  52. syscall; \
  53. .set reorder; \
  54. bne a3, zero, 99b; \
  55. L(syse1):
  56. #endif
  57. #endif