Commit e80d6661c3a5caa0cebec0853c6cb0db090fb506

Authored by Al Viro
1 parent 18c26c27ae

flagday: kill pt_regs argument of do_fork()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Showing 9 changed files with 19 additions and 26 deletions Side-by-side Diff

arch/blackfin/kernel/process.c
... ... @@ -135,7 +135,7 @@
135 135 #endif
136 136 if (newsp)
137 137 newsp -= 12;
138   - return do_fork(clone_flags, newsp, regs, 0, NULL, NULL);
  138 + return do_fork(clone_flags, newsp, 0, NULL, NULL);
139 139 }
140 140  
141 141 int
arch/ia64/kernel/entry.S
... ... @@ -116,13 +116,12 @@
116 116 mov loc1=r16 // save ar.pfs across do_fork
117 117 .body
118 118 mov out1=in1
119   - mov out3=in2
  119 + mov out2=in2
120 120 tbit.nz p6,p0=in0,CLONE_SETTLS_BIT
121   - mov out4=in3 // parent_tidptr: valid only w/CLONE_PARENT_SETTID
  121 + mov out3=in3 // parent_tidptr: valid only w/CLONE_PARENT_SETTID
122 122 ;;
123 123 (p6) st8 [r2]=in5 // store TLS in r16 for copy_thread()
124   - mov out5=in4 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
125   - adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = &regs
  124 + mov out4=in4 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
126 125 mov out0=in0 // out0 = clone_flags
127 126 br.call.sptk.many rp=do_fork
128 127 .ret1: .restore sp
129 128  
130 129  
... ... @@ -148,13 +147,12 @@
148 147 mov loc1=r16 // save ar.pfs across do_fork
149 148 .body
150 149 mov out1=in1
151   - mov out3=16 // stacksize (compensates for 16-byte scratch area)
  150 + mov out2=16 // stacksize (compensates for 16-byte scratch area)
152 151 tbit.nz p6,p0=in0,CLONE_SETTLS_BIT
153   - mov out4=in2 // parent_tidptr: valid only w/CLONE_PARENT_SETTID
  152 + mov out3=in2 // parent_tidptr: valid only w/CLONE_PARENT_SETTID
154 153 ;;
155 154 (p6) st8 [r2]=in4 // store TLS in r13 (tp)
156   - mov out5=in3 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
157   - adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = &regs
  155 + mov out4=in3 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
158 156 mov out0=in0 // out0 = clone_flags
159 157 br.call.sptk.many rp=do_fork
160 158 .ret2: .restore sp
arch/m68k/kernel/process.c
... ... @@ -149,7 +149,7 @@
149 149 asmlinkage int m68k_clone(struct pt_regs *regs)
150 150 {
151 151 /* regs will be equal to current_pt_regs() */
152   - return do_fork(regs->d1, regs->d2, regs, 0,
  152 + return do_fork(regs->d1, regs->d2, 0,
153 153 (int __user *)regs->d3, (int __user *)regs->d4);
154 154 }
155 155  
arch/mips/kernel/linux32.c
... ... @@ -312,7 +312,7 @@
312 312 /* Use __dummy4 instead of getting it off the stack, so that
313 313 syscall() works. */
314 314 child_tidptr = (int __user *) __dummy4;
315   - return do_fork(clone_flags, newsp, &regs, 0,
  315 + return do_fork(clone_flags, newsp, 0,
316 316 parent_tidptr, child_tidptr);
317 317 }
318 318  
arch/mips/kernel/syscall.c
... ... @@ -92,7 +92,7 @@
92 92 static int __used noinline
93 93 _sys_fork(nabi_no_regargs struct pt_regs regs)
94 94 {
95   - return do_fork(SIGCHLD, regs.regs[29], &regs, 0, NULL, NULL);
  95 + return do_fork(SIGCHLD, regs.regs[29], 0, NULL, NULL);
96 96 }
97 97  
98 98 save_static_function(sys_clone);
... ... @@ -123,7 +123,7 @@
123 123 #else
124 124 child_tidptr = (int __user *) regs.regs[8];
125 125 #endif
126   - return do_fork(clone_flags, newsp, &regs, 0,
  126 + return do_fork(clone_flags, newsp, 0,
127 127 parent_tidptr, child_tidptr);
128 128 }
129 129  
arch/sparc/kernel/process_32.c
... ... @@ -286,8 +286,7 @@
286 286 parent_tid_ptr = regs->u_regs[UREG_I2];
287 287 child_tid_ptr = regs->u_regs[UREG_I4];
288 288  
289   - ret = do_fork(clone_flags, stack_start,
290   - regs, stack_size,
  289 + ret = do_fork(clone_flags, stack_start, stack_size,
291 290 (int __user *) parent_tid_ptr,
292 291 (int __user *) child_tid_ptr);
293 292  
arch/sparc/kernel/process_64.c
... ... @@ -601,8 +601,7 @@
601 601 child_tid_ptr = (int __user *) regs->u_regs[UREG_I4];
602 602 }
603 603  
604   - ret = do_fork(clone_flags, stack_start,
605   - regs, stack_size,
  604 + ret = do_fork(clone_flags, stack_start, stack_size,
606 605 parent_tid_ptr, child_tid_ptr);
607 606  
608 607 /* If we get an error and potentially restart the system
include/linux/sched.h
... ... @@ -2289,7 +2289,7 @@
2289 2289 extern int do_execve(const char *,
2290 2290 const char __user * const __user *,
2291 2291 const char __user * const __user *);
2292   -extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
  2292 +extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
2293 2293 struct task_struct *fork_idle(int);
2294 2294 #ifdef CONFIG_GENERIC_KERNEL_THREAD
2295 2295 extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
... ... @@ -1527,8 +1527,6 @@
1527 1527 struct task_struct * __cpuinit fork_idle(int cpu)
1528 1528 {
1529 1529 struct task_struct *task;
1530   - struct pt_regs regs;
1531   -
1532 1530 task = copy_process(CLONE_VM, 0, 0, NULL, &init_struct_pid, 0);
1533 1531 if (!IS_ERR(task)) {
1534 1532 init_idle_pids(task->pids);
... ... @@ -1546,7 +1544,6 @@
1546 1544 */
1547 1545 long do_fork(unsigned long clone_flags,
1548 1546 unsigned long stack_start,
1549   - struct pt_regs *regs,
1550 1547 unsigned long stack_size,
1551 1548 int __user *parent_tidptr,
1552 1549 int __user *child_tidptr)
... ... @@ -1576,7 +1573,7 @@
1576 1573 * requested, no event is reported; otherwise, report if the event
1577 1574 * for the type of forking is enabled.
1578 1575 */
1579   - if (!(clone_flags & CLONE_UNTRACED) && likely(user_mode(regs))) {
  1576 + if (!(clone_flags & CLONE_UNTRACED)) {
1580 1577 if (clone_flags & CLONE_VFORK)
1581 1578 trace = PTRACE_EVENT_VFORK;
1582 1579 else if ((clone_flags & CSIGNAL) != SIGCHLD)
... ... @@ -1632,7 +1629,7 @@
1632 1629 */
1633 1630 pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
1634 1631 {
1635   - return do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn, NULL,
  1632 + return do_fork(flags|CLONE_VM|CLONE_UNTRACED, (unsigned long)fn,
1636 1633 (unsigned long)arg, NULL, NULL);
1637 1634 }
1638 1635 #endif
... ... @@ -1641,7 +1638,7 @@
1641 1638 SYSCALL_DEFINE0(fork)
1642 1639 {
1643 1640 #ifdef CONFIG_MMU
1644   - return do_fork(SIGCHLD, 0, current_pt_regs(), 0, NULL, NULL);
  1641 + return do_fork(SIGCHLD, 0, 0, NULL, NULL);
1645 1642 #else
1646 1643 /* can not support in nommu mode */
1647 1644 return(-EINVAL);
... ... @@ -1652,7 +1649,7 @@
1652 1649 #ifdef __ARCH_WANT_SYS_VFORK
1653 1650 SYSCALL_DEFINE0(vfork)
1654 1651 {
1655   - return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0, current_pt_regs(),
  1652 + return do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, 0,
1656 1653 0, NULL, NULL);
1657 1654 }
1658 1655 #endif
... ... @@ -1675,7 +1672,7 @@
1675 1672 int, tls_val)
1676 1673 #endif
1677 1674 {
1678   - return do_fork(clone_flags, newsp, current_pt_regs(), 0,
  1675 + return do_fork(clone_flags, newsp, 0,
1679 1676 parent_tidptr, child_tidptr);
1680 1677 }
1681 1678 #endif