pipe.S 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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, see
  14. <http://www.gnu.org/licenses/>.
  15. Ported to uClibc by:
  16. Austin Foxley, Ceton Corporation <austinf@cetoncorp.com>
  17. */
  18. #include <features.h>
  19. #include <sys/syscall.h>
  20. #include <asm/errno.h>
  21. .text
  22. .global pipe
  23. .type pipe, @function
  24. .align 4
  25. pipe:
  26. save %sp,-96,%sp
  27. /* sanity check arguments */
  28. tst %i0
  29. be .Lerror
  30. mov %i2,%o0
  31. /* Do the system call */
  32. set __NR_pipe,%g1
  33. ta 0x10
  34. bcs .Lerror
  35. nop
  36. st %o0,[%i0]
  37. st %o1,[%i0+4]
  38. ret
  39. restore %g0,%g0,%o0
  40. .Lerror:
  41. call __errno_location
  42. or %g0,EINVAL,%i0
  43. st %i0,[%o0]
  44. ret
  45. restore %g0,-1,%o0
  46. .size pipe,.-pipe
  47. libc_hidden_def(pipe)