vfork.S 763 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
  3. *
  4. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  5. */
  6. #include <sys/syscall.h>
  7. #ifndef __NR_vfork
  8. #define __NR_vfork __NR_fork /* uClinux-2.0 only has fork which is vfork */
  9. #endif
  10. .text
  11. .align 2
  12. .globl __vfork
  13. .hidden __vfork
  14. .type __vfork,@function
  15. __vfork:
  16. /* Pop the return PC value into A0. */
  17. movel %sp@+, %a0
  18. /* Stuff the syscall number in D0 and trap into the kernel. */
  19. movel #SYS_ify (vfork), %d0
  20. trap #0
  21. tstl %d0
  22. jmi .Lerror /* Branch forward if it failed. */
  23. /* Jump to the return PC. */
  24. jmp %a0@
  25. .Lerror:
  26. /* Push back the return PC. */
  27. movel %a0,%sp@-
  28. .size __vfork,.-__vfork
  29. weak_alias(__vfork,vfork)
  30. libc_hidden_def(vfork)