__uClibc_syscall.S 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * $Id: __uClibc_syscall.S,v 1.1 2002/08/09 13:43:21 andersen Exp $
  3. *
  4. * __uClibc_syscall.S - MIPS version.
  5. *
  6. * Derived from x86 implementation to reduce memory footprint
  7. * for syscalls.
  8. *
  9. * Mark Rustad, 03/21/2002
  10. * Copyright 2002 BRECIS Communications Corp.
  11. *
  12. * uClibc is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with uClibc; if not, write to the Free
  19. * Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  20. * 02111-1307 USA.
  21. */
  22. #include <sys/regdef.h>
  23. .text
  24. .align 4
  25. .globl __uClibc_syscall
  26. .ent __uClibc_syscall,0
  27. .type __uClibc_syscall,@function
  28. __uClibc_syscall:
  29. syscall
  30. .set noreorder
  31. beqz a3, 1f
  32. lui t3, %hi(errno)
  33. .set reorder
  34. negu a1, v0
  35. sw a1, %lo(errno)(t3)
  36. li v0, -1
  37. 1:
  38. j ra
  39. .end __uClibc_syscall
  40. .Lsize:
  41. .size __uClibc_syscall,.Lsize-__uClibc_syscall