pipe.S 664 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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)
  41. weak_alias(__pipe, pipe)