cris-vfork.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. diff -Nur uClibc-0.9.32-rc2.orig/libc/sysdeps/linux/cris/Makefile.arch uClibc-0.9.32-rc2/libc/sysdeps/linux/cris/Makefile.arch
  2. --- uClibc-0.9.32-rc2.orig/libc/sysdeps/linux/cris/Makefile.arch 2011-01-20 15:49:47.000000000 +0100
  3. +++ uClibc-0.9.32-rc2/libc/sysdeps/linux/cris/Makefile.arch 2011-02-07 23:01:26.000000000 +0100
  4. @@ -7,7 +7,7 @@
  5. CSRC := __init_brk.c brk.c sbrk.c
  6. -SSRC := setjmp.S __longjmp.S clone.S sysdep.S syscall.S
  7. +SSRC := setjmp.S __longjmp.S clone.S sysdep.S syscall.S vfork.S
  8. ifeq ($(UNIFIED_SYSCALL),y)
  9. SSRC += __uClibc_syscall.S
  10. endif
  11. diff -Nur uClibc-0.9.32-rc2.orig/libc/sysdeps/linux/cris/vfork.S uClibc-0.9.32-rc2/libc/sysdeps/linux/cris/vfork.S
  12. --- uClibc-0.9.32-rc2.orig/libc/sysdeps/linux/cris/vfork.S 1970-01-01 01:00:00.000000000 +0100
  13. +++ uClibc-0.9.32-rc2/libc/sysdeps/linux/cris/vfork.S 2011-02-08 00:39:10.000000000 +0100
  14. @@ -0,0 +1,33 @@
  15. +/*
  16. + * vfork.S
  17. + *
  18. + * On cris, r9 contains the syscall number (set by generated stub);
  19. + * r10..r13 contain arguments 0-3 per the standard calling convention.
  20. + * The return address is in $srp; so we just need to avoid the stack
  21. + * usage of the normal syscall stubs.
  22. + */
  23. +
  24. +#include <asm/unistd.h>
  25. +#include <sys/syscall.h>
  26. +
  27. + .section ".text","ax"
  28. + .balign 4
  29. + .globl __vfork
  30. + .type __vfork,@function
  31. +__vfork:
  32. + move.d __NR_vfork, $r9
  33. + break 13
  34. +
  35. + cmps.w -4096,$r10
  36. + blo 1f
  37. + neg.d $r10,$r11
  38. + move.d $r11,[errno]
  39. + moveq -1,$r10
  40. +1:
  41. + ret
  42. + nop
  43. +
  44. + .size __vfork,.-__vfork
  45. +
  46. +weak_alias(__vfork,vfork)
  47. +libc_hidden_weak(vfork)