pipe.S 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Copyright (C) 1999 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA.
  16. Ported to uClibc by:
  17. Austin Foxley, Ceton Corporation <austinf@cetoncorp.com>
  18. */
  19. #include <features.h>
  20. #include <sys/syscall.h>
  21. #include <asm/errno.h>
  22. .text
  23. .global pipe
  24. .type pipe, @function
  25. .align 4
  26. pipe:
  27. save %sp,-96,%sp
  28. /* sanity check arguments */
  29. tst %i0
  30. be .Lerror
  31. orcc %i1,%g0,%o1
  32. be .Lerror
  33. mov %i2,%o0
  34. /* Do the system call */
  35. set __NR_pipe,%g1
  36. ta 0x10
  37. bcs .Lerror
  38. nop
  39. st %o0,[%i0]
  40. st %o1,[%i0+4]
  41. ret
  42. restore %g0,%g0,%o0
  43. .Lerror:
  44. call HIDDEN_JUMPTARGET(__errno_location)
  45. or %g0,EINVAL,%i0
  46. st %i0,[%o0]
  47. ret
  48. restore %g0,-1,%o0
  49. .size pipe,.-pipe
  50. libc_hidden_def(pipe)