pipe.S 439 B

1234567891011121314151617181920212223242526272829
  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. li v0,__NR_pipe
  11. syscall
  12. beqz a3, 1f
  13. #ifdef __PIC__
  14. la t9, __syscall_error
  15. jr t9
  16. #else
  17. j __syscall_error
  18. #endif
  19. 1:
  20. sw v0, 0(a0)
  21. sw v1, 4(a0)
  22. li v0, 0
  23. j ra
  24. .end pipe
  25. .size pipe,.-pipe
  26. libc_hidden_def(pipe)