pipe.S 591 B

12345678910111213141516171819202122232425262728293031323334
  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. beqz a3, 1f
  18. #ifdef __PIC__
  19. PTR_LA t9, __syscall_error
  20. jr t9
  21. #else
  22. j __syscall_error
  23. #endif
  24. 1:
  25. sw v0, 0(a0)
  26. sw v1, 4(a0)
  27. li v0, 0
  28. j ra
  29. .end pipe
  30. .size pipe,.-pipe
  31. libc_hidden_def(pipe)