syscall.S 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Copyright (C) 2001, 2003, 2004 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. see <http://www.gnu.org/licenses/>. */
  14. #include "sysdep.h"
  15. .syntax no_register_prefix
  16. /* Make syscall (callno, ...) into a system call. */
  17. ENTRY (syscall)
  18. #ifdef __arch_v32
  19. subq 4,sp
  20. move.d r10,r9
  21. move srp,[sp]
  22. addoq 8,sp,acr
  23. move.d r11,r10
  24. move [acr],mof
  25. addoq 12,sp,acr
  26. move.d r12,r11
  27. move [acr],srp
  28. addoq 4,sp,acr
  29. move.d r13,r12
  30. move.d [acr],r13
  31. break 13
  32. cmps.w -4096,r10
  33. bhs 0f
  34. move [sp+],srp
  35. Ret
  36. nop
  37. #else
  38. push srp
  39. move.d r10,r9
  40. move.d r11,r10
  41. move.d r12,r11
  42. move.d r13,r12
  43. move.d [sp+4],r13
  44. move [sp+8],mof
  45. move [sp+12],srp
  46. break 13
  47. cmps.w -4096,r10
  48. bhs 0f
  49. pop srp
  50. Ret
  51. nop
  52. #endif
  53. PSEUDO_END (syscall)