[parisc-linux-cvs] Patch to fix clone system call
John Marvin
jsm@udlkern.fc.hp.com
Fri, 9 Feb 2001 06:15:43 -0700 (MST)
Here's a patch that I am committing to fix the clone system call.
This is the kernel part only.
John
--- entry.S.old Fri Feb 9 00:27:33 2001
+++ entry.S Fri Feb 9 05:54:44 2001
@@ -1769,8 +1769,8 @@ sys_fork_wrapper:
also syscall-clobbered (we hope). */
STREG %r2,PT_GR19(%r1) /* save for child */
STREG %r30,PT_GR20(%r1)
- ldil L%child_return, %r3
- ldo R%child_return(%r3), %r3
+ ldil L%child_return,%r3
+ ldo R%child_return(%r3),%r3
LDIL_FIXUP(%r3)
STREG %r3,PT_GR21(%r1) /* save for child */
@@ -1807,17 +1807,18 @@ sys_clone_wrapper:
ldo -16(%r30),%r29 /* Reference param save area */
#endif
+ STREG %r2,PT_GR19(%r1) /* save for child */
STREG %r30,PT_GR20(%r1)
ldil L%child_return,%r3
ldo R%child_return(%r3),%r3
LDIL_FIXUP(%r3)
+ STREG %r3,PT_GR21(%r1) /* save for child */
bl sys_clone,%r2
- STREG %r3,PT_GR21(%r1) /* save for child */
+ copy %r1,%r24
b wrapper_exit
LDREG -RP_OFFSET-FRAME_SIZE(%r30),%r2
-
.export sys_vfork_wrapper
sys_vfork_wrapper:
--- process.c.old Fri Feb 9 03:22:06 2001
+++ process.c Fri Feb 9 03:28:50 2001
@@ -318,6 +318,7 @@ copy_thread(int nr, unsigned long clone_
cregs->ksp = ((unsigned long)(p))
+ (pregs->gr[20] & (INIT_TASK_SIZE - 1));
cregs->kpc = pregs->gr[21];
+ cregs->gr[30] = usp;
}
return 0;