sysdep.S 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Copyright (C) 2001, 2003 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Library General Public License as
  5. published by the Free Software Foundation; either version 2 of the
  6. License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Library General Public License for more details.
  11. You should have received a copy of the GNU Library General Public
  12. License along with the GNU C Library; see the file COPYING.LIB. If not,
  13. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  14. Boston, MA 02111-1307, USA. */
  15. #include <features.h>
  16. #include "sysdep.h"
  17. /* The syscall stubs jump here when they detect an error, bot for PIC and
  18. non-PIC. */
  19. .syntax no_register_prefix
  20. ENTRY (__syscall_error)
  21. neg.d r10,r10
  22. #ifdef __UCLIBC_HAS_THREADS__
  23. subq 4,sp
  24. move.d r10,[sp]
  25. subq 4,sp
  26. move srp,[sp]
  27. /* Note that __syscall_error is only visible within this library,
  28. and no-one passes it on as a pointer, so can assume that R0 (GOT
  29. pointer) is correctly set up. */
  30. PLTCALL (HIDDEN_JUMPTARGET(__errno_location))
  31. move [sp+],srp
  32. move.d [sp+],r11
  33. move.d r11,[r10]
  34. #else /* not __UCLIBC_HAS_THREADS__ */
  35. #ifdef __arch_v32
  36. # ifdef __PIC__
  37. addo.d C_SYMBOL_NAME(errno:GOT),r0,acr
  38. move.d [acr],r9
  39. move.d r10,[r9]
  40. # else /* not __PIC__ */
  41. lapc C_SYMBOL_NAME(errno),acr
  42. move.d r10,[r9]
  43. # endif /* not __PIC__ */
  44. #else /* not __arch_v32 */
  45. # ifdef __PIC__
  46. move.d [r0+C_SYMBOL_NAME(errno:GOT)],r9
  47. move.d r10,[r9]
  48. # else
  49. move.d r10,[C_SYMBOL_NAME(errno)]
  50. # endif
  51. #endif /* not __arch_v32 */
  52. #endif /* __UCLIBC_HAS_THREADS__ */
  53. #ifdef __PIC__
  54. /* PIC callers are supposed to have R0 on stack, ready for us to restore.
  55. Callers are only allowed from within this DSO, so the GOT in r0 is the
  56. one we want to use.
  57. (Don't use "ret" - it's a macro). */
  58. moveq -1,r10
  59. Ret
  60. move.d [sp+],r0
  61. #else
  62. Ret
  63. moveq -1,r10
  64. #endif
  65. END (__syscall_error)