sysdep.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* Copyright (C) 1992-2019 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. Contributed by Brendan Kehoe (brendan@zen.org).
  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 <sgidefs.h>
  16. #include <sysdeps/unix/sysdep.h>
  17. #ifndef __mips_isa_rev
  18. # define __mips_isa_rev 0
  19. #endif
  20. #ifdef __ASSEMBLER__
  21. #include <regdef.h>
  22. #define ENTRY(name) \
  23. .globl name; \
  24. .align 2; \
  25. .ent name,0; \
  26. name##: \
  27. cfi_startproc;
  28. #undef END
  29. #define END(function) \
  30. cfi_endproc; \
  31. .end function; \
  32. .size function,.-function
  33. #define ret j ra ; nop
  34. #undef PSEUDO_END
  35. #define PSEUDO_END(sym) cfi_endproc; .end sym; .size sym,.-sym
  36. #define PSEUDO_NOERRNO(name, syscall_name, args) \
  37. .align 2; \
  38. ENTRY(name) \
  39. .set nomips16; \
  40. .set noreorder; \
  41. li v0, SYS_ify(syscall_name); \
  42. syscall
  43. #undef PSEUDO_END_NOERRNO
  44. #define PSEUDO_END_NOERRNO(sym) cfi_endproc; .end sym; .size sym,.-sym
  45. #define ret_NOERRNO ret
  46. #define PSEUDO_ERRVAL(name, syscall_name, args) \
  47. .align 2; \
  48. ENTRY(name) \
  49. .set nomips16; \
  50. .set noreorder; \
  51. li v0, SYS_ify(syscall_name); \
  52. syscall
  53. #undef PSEUDO_END_ERRVAL
  54. #define PSEUDO_END_ERRVAL(sym) cfi_endproc; .end sym; .size sym,.-sym
  55. #define ret_ERRVAL ret
  56. #define r0 v0
  57. #define r1 v1
  58. /* The mips move insn is d,s. */
  59. #define MOVE(x,y) move y , x
  60. #if _MIPS_SIM == _ABIO32
  61. # define L(label) $L ## label
  62. #else
  63. # define L(label) .L ## label
  64. #endif
  65. #endif