pipe.S 627 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. .frame sp, 24, sp
  11. #ifdef __PIC__
  12. .set noreorder
  13. .cpload $25
  14. .set reorder
  15. addiu sp,sp,-24
  16. .cprestore 16
  17. #else
  18. addiu sp,sp,-24
  19. #endif
  20. sw a0,16(sp)
  21. li v0,__NR_pipe
  22. syscall
  23. beqz a3, 1f
  24. #ifdef __PIC__
  25. la t0, __syscall_error
  26. jr t9
  27. #else
  28. j __syscall_error
  29. #endif
  30. 1:
  31. lw a0, 16(sp)
  32. sw v0, 0(a0)
  33. sw v1, 4(a0)
  34. li v0, 0
  35. 2:
  36. addiu sp,sp,24
  37. j ra
  38. .end pipe
  39. .size pipe,.-pipe
  40. libc_hidden_def(pipe)