pipe.S 654 B

12345678910111213141516171819202122232425262728293031
  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. .ent pipe, 0
  9. pipe:
  10. addiu sp,sp,-24
  11. sw a0,16(sp)
  12. li v0,__NR_pipe
  13. syscall
  14. beqz a3, 1f
  15. la t3, errno
  16. sw v0, (t3)
  17. li v0, -1
  18. b 2f
  19. 1:
  20. lw a0, 16(sp)
  21. sw v0, 0(a0)
  22. sw v1, 4(a0)
  23. li v0, 0
  24. 2:
  25. addiu sp,sp,24
  26. j ra
  27. .end pipe
  28. .size pipe,.-pipe