vfork.S 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #
  2. # clone.S, part of the i960 support for the uClibc library.
  3. #
  4. # Copyright (C) 2002 by Okiok Data Ltd. http://www.okiok.com/
  5. #
  6. # This program is free software; you can redistribute it and/or modify it under
  7. # the terms of the GNU Library General Public License as published by the Free
  8. # Software Foundation; either version 2 of the License, or (at your option) any
  9. # later version.
  10. #
  11. # This program is distributed in the hope that it will be useful, but WITHOUT
  12. # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. # FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
  14. # details.
  15. #
  16. # You should have received a copy of the GNU Library General Public License
  17. # along with this program; if not, write to the Free Software Foundation, Inc.,
  18. # at 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. #
  20. # Derived from an old port of uC-libc to the i960 by Keith Adams (kma@cse.ogi.edu).
  21. #
  22. #include <sys/syscall.h>
  23. #ifndef __NR_vfork
  24. #define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
  25. #endif
  26. .globl _vfork
  27. _vfork:
  28. mov g13, r3
  29. ldconst __NR_vfork, g13
  30. calls 0
  31. mov r3, g13
  32. cmpible 0, g0, 1f
  33. subo g0, 0, r3
  34. st r3, _errno
  35. 1:
  36. ret