pipe.S 817 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* pipe system call for Linux/MIPS */
  2. /*
  3. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  4. *
  5. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. */
  7. /*see uClibc's sh/pipe.c and glibc-2.2.4's mips/pipe.S */
  8. #include <features.h>
  9. #include <asm/asm.h>
  10. #include <asm/unistd.h>
  11. #include <asm/regdef.h>
  12. .globl pipe
  13. .ent pipe, 0
  14. pipe:
  15. addiu sp,sp,-24
  16. sw a0,16(sp)
  17. li v0,__NR_pipe
  18. syscall
  19. beqz a3, 1f
  20. la t3, errno
  21. sw v0, (t3)
  22. li v0, -1
  23. b 2f
  24. 1:
  25. lw a0, 16(sp)
  26. sw v0, 0(a0)
  27. sw v1, 4(a0)
  28. li v0, 0
  29. 2:
  30. addiu sp,sp,24
  31. j ra
  32. .end pipe
  33. .size pipe,.-pipe
  34. libc_hidden_def(pipe)