pipe.S 705 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /* pipe system call for Linux/MIPS */
  2. /*
  3. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  4. *
  5. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. */
  7. /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  8. #include <features.h>
  9. #include <sys/asm.h>
  10. #include <asm/unistd.h>
  11. #include <sys/regdef.h>
  12. .globl pipe
  13. .ent pipe, 0
  14. pipe:
  15. li v0,__NR_pipe
  16. syscall
  17. bnez a3, 1f
  18. sw v0, 0(a0)
  19. sw v1, 4(a0)
  20. li v0, 0
  21. j ra
  22. 1:
  23. /* uClibc change -- start */
  24. move a0,v0 /* Pass return val to C function. */
  25. /* uClibc change -- stop */
  26. #ifdef __PIC__
  27. PTR_LA t9, __syscall_error
  28. jr t9
  29. #else
  30. j __syscall_error
  31. #endif
  32. 1:
  33. .end pipe
  34. .size pipe,.-pipe
  35. libc_hidden_def(pipe)