pipe.S 713 B

12345678910111213141516171819202122232425262728293031323334
  1. /* pipe system call for Linux/MIPS */
  2. /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  3. #include <features.h>
  4. #include <asm/asm.h>
  5. #include <asm/unistd.h>
  6. #include <asm/regdef.h>
  7. .globl pipe
  8. .set pipe,__pipe
  9. .globl __pipe
  10. .hidden __pipe
  11. .ent __pipe, 0
  12. __pipe:
  13. addiu sp,sp,-24
  14. sw a0,16(sp)
  15. li v0,__NR_pipe
  16. syscall
  17. beqz a3, 1f
  18. la t3, errno
  19. sw v0, (t3)
  20. li v0, -1
  21. b 2f
  22. 1:
  23. lw a0, 16(sp)
  24. sw v0, 0(a0)
  25. sw v1, 4(a0)
  26. li v0, 0
  27. 2:
  28. addiu sp,sp,24
  29. j ra
  30. .end __pipe
  31. .size __pipe,.-__pipe