aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-10-22 23:10:08 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-11-29 00:01:08 -0500
commite80d6661c3a5caa0cebec0853c6cb0db090fb506 (patch)
treeefc60762bbcdf8904f9779310ac60d0131ac9f3d
parent18c26c27ae0abe82253cb2e2363df465dbbb657e (diff)
flagday: kill pt_regs argument of do_fork()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/blackfin/kernel/process.c2
-rw-r--r--arch/ia64/kernel/entry.S14
-rw-r--r--arch/m68k/kernel/process.c2
-rw-r--r--arch/mips/kernel/linux32.c2
-rw-r--r--arch/mips/kernel/syscall.c4
-rw-r--r--arch/sparc/kernel/process_32.c3
-rw-r--r--arch/sparc/kernel/process_64.c3
-rw-r--r--include/linux/sched.h2
-rw-r--r--kernel/fork.c13
9 files changed, 19 insertions, 26 deletions
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c
index 582276efaaa4..3e16ad9b0a99 100644
--- a/arch/blackfin/kernel/process.c
+++ b/arch/blackfin/kernel/process.c
@@ -135,7 +135,7 @@ asmlinkage int bfin_clone(unsigned long clone_flags, unsigned long newsp)
135#endif 135#endif
136 if (newsp) 136 if (newsp)
137 newsp -= 12; 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
141int 141int
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 940a67263629..e25b784a2b72 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -116,13 +116,12 @@ GLOBAL_ENTRY(sys_clone2)
116 mov loc1=r16 // save ar.pfs across do_fork 116 mov loc1=r16 // save ar.pfs across do_fork
117 .body 117 .body
118 mov out1=in1 118 mov out1=in1
119 mov out3=in2 119 mov out2=in2
120 tbit.nz p6,p0=in0,CLONE_SETTLS_BIT 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(p6) st8 [r2]=in5 // store TLS in r16 for copy_thread() 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 124 mov out4=in4 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
125 adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = &regs
126 mov out0=in0 // out0 = clone_flags 125 mov out0=in0 // out0 = clone_flags
127 br.call.sptk.many rp=do_fork 126 br.call.sptk.many rp=do_fork
128.ret1: .restore sp 127.ret1: .restore sp
@@ -148,13 +147,12 @@ GLOBAL_ENTRY(sys_clone)
148 mov loc1=r16 // save ar.pfs across do_fork 147 mov loc1=r16 // save ar.pfs across do_fork
149 .body 148 .body
150 mov out1=in1 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 tbit.nz p6,p0=in0,CLONE_SETTLS_BIT 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(p6) st8 [r2]=in4 // store TLS in r13 (tp) 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 155 mov out4=in3 // child_tidptr: valid only w/CLONE_CHILD_SETTID or CLONE_CHILD_CLEARTID
157 adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = &regs
158 mov out0=in0 // out0 = clone_flags 156 mov out0=in0 // out0 = clone_flags
159 br.call.sptk.many rp=do_fork 157 br.call.sptk.many rp=do_fork
160.ret2: .restore sp 158.ret2: .restore sp
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index 9a3df4df73cc..d538694ad208 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -149,7 +149,7 @@ void flush_thread(void)
149asmlinkage int m68k_clone(struct pt_regs *regs) 149asmlinkage int m68k_clone(struct pt_regs *regs)
150{ 150{
151 /* regs will be equal to current_pt_regs() */ 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 (int __user *)regs->d3, (int __user *)regs->d4); 153 (int __user *)regs->d3, (int __user *)regs->d4);
154} 154}
155 155
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index 8796dbc7e358..7adab86c632c 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -312,7 +312,7 @@ _sys32_clone(nabi_no_regargs struct pt_regs regs)
312 /* Use __dummy4 instead of getting it off the stack, so that 312 /* Use __dummy4 instead of getting it off the stack, so that
313 syscall() works. */ 313 syscall() works. */
314 child_tidptr = (int __user *) __dummy4; 314 child_tidptr = (int __user *) __dummy4;
315 return do_fork(clone_flags, newsp, &regs, 0, 315 return do_fork(clone_flags, newsp, 0,
316 parent_tidptr, child_tidptr); 316 parent_tidptr, child_tidptr);
317} 317}
318 318
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c
index c611e2df7767..201cb76b4df9 100644
--- a/arch/mips/kernel/syscall.c
+++ b/arch/mips/kernel/syscall.c
@@ -92,7 +92,7 @@ save_static_function(sys_fork);
92static int __used noinline 92static int __used noinline
93_sys_fork(nabi_no_regargs struct pt_regs regs) 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
98save_static_function(sys_clone); 98save_static_function(sys_clone);
@@ -123,7 +123,7 @@ _sys_clone(nabi_no_regargs struct pt_regs regs)
123#else 123#else
124 child_tidptr = (int __user *) regs.regs[8]; 124 child_tidptr = (int __user *) regs.regs[8];
125#endif 125#endif
126 return do_fork(clone_flags, newsp, &regs, 0, 126 return do_fork(clone_flags, newsp, 0,
127 parent_tidptr, child_tidptr); 127 parent_tidptr, child_tidptr);
128} 128}
129 129
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c
index ecde946ef834..be8e862badaf 100644
--- a/arch/sparc/kernel/process_32.c
+++ b/arch/sparc/kernel/process_32.c
@@ -286,8 +286,7 @@ asmlinkage int sparc_do_fork(unsigned long clone_flags,
286 parent_tid_ptr = regs->u_regs[UREG_I2]; 286 parent_tid_ptr = regs->u_regs[UREG_I2];
287 child_tid_ptr = regs->u_regs[UREG_I4]; 287 child_tid_ptr = regs->u_regs[UREG_I4];
288 288
289 ret = do_fork(clone_flags, stack_start, 289 ret = do_fork(clone_flags, stack_start, stack_size,
290 regs, stack_size,
291 (int __user *) parent_tid_ptr, 290 (int __user *) parent_tid_ptr,
292 (int __user *) child_tid_ptr); 291 (int __user *) child_tid_ptr);
293 292
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c
index 58ef19e7e82f..cdb80b2adbe0 100644
--- a/arch/sparc/kernel/process_64.c
+++ b/arch/sparc/kernel/process_64.c
@@ -601,8 +601,7 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags,
601 child_tid_ptr = (int __user *) regs->u_regs[UREG_I4]; 601 child_tid_ptr = (int __user *) regs->u_regs[UREG_I4];
602 } 602 }
603 603
604 ret = do_fork(clone_flags, stack_start, 604 ret = do_fork(clone_flags, stack_start, stack_size,
605 regs, stack_size,
606 parent_tid_ptr, child_tid_ptr); 605 parent_tid_ptr, child_tid_ptr);
607 606
608 /* If we get an error and potentially restart the system 607 /* If we get an error and potentially restart the system
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 78a2ae3470df..1162258bcaf0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2289,7 +2289,7 @@ extern int disallow_signal(int);
2289extern int do_execve(const char *, 2289extern int do_execve(const char *,
2290 const char __user * const __user *, 2290 const char __user * const __user *,
2291 const char __user * const __user *); 2291 const char __user * const __user *);
2292extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); 2292extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, int __user *);
2293struct task_struct *fork_idle(int); 2293struct task_struct *fork_idle(int);
2294#ifdef CONFIG_GENERIC_KERNEL_THREAD 2294#ifdef CONFIG_GENERIC_KERNEL_THREAD
2295extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); 2295extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags);
diff --git a/kernel/fork.c b/kernel/fork.c
index 0e68b6686acb..540730783433 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -1527,8 +1527,6 @@ static inline void init_idle_pids(struct pid_link *links)
1527struct task_struct * __cpuinit fork_idle(int cpu) 1527struct task_struct * __cpuinit fork_idle(int cpu)
1528{ 1528{
1529 struct task_struct *task; 1529 struct task_struct *task;
1530 struct pt_regs regs;
1531
1532 task = copy_process(CLONE_VM, 0, 0, NULL, &init_struct_pid, 0); 1530 task = copy_process(CLONE_VM, 0, 0, NULL, &init_struct_pid, 0);
1533 if (!IS_ERR(task)) { 1531 if (!IS_ERR(task)) {
1534 init_idle_pids(task->pids); 1532 init_idle_pids(task->pids);
@@ -1546,7 +1544,6 @@ struct task_struct * __cpuinit fork_idle(int cpu)
1546 */ 1544 */
1547long do_fork(unsigned long clone_flags, 1545long do_fork(unsigned long clone_flags,
1548 unsigned long stack_start, 1546 unsigned long stack_start,
1549 struct pt_regs *regs,
1550 unsigned long stack_size, 1547 unsigned long stack_size,
1551 int __user *parent_tidptr, 1548 int __user *parent_tidptr,
1552 int __user *child_tidptr) 1549 int __user *child_tidptr)
@@ -1576,7 +1573,7 @@ long do_fork(unsigned long clone_flags,
1576 * requested, no event is reported; otherwise, report if the event 1573 * requested, no event is reported; otherwise, report if the event
1577 * for the type of forking is enabled. 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 if (clone_flags & CLONE_VFORK) 1577 if (clone_flags & CLONE_VFORK)
1581 trace = PTRACE_EVENT_VFORK; 1578 trace = PTRACE_EVENT_VFORK;
1582 else if ((clone_flags & CSIGNAL) != SIGCHLD) 1579 else if ((clone_flags & CSIGNAL) != SIGCHLD)
@@ -1632,7 +1629,7 @@ long do_fork(unsigned long clone_flags,
1632 */ 1629 */
1633pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags) 1630pid_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 (unsigned long)arg, NULL, NULL); 1633 (unsigned long)arg, NULL, NULL);
1637} 1634}
1638#endif 1635#endif
@@ -1641,7 +1638,7 @@ pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags)
1641SYSCALL_DEFINE0(fork) 1638SYSCALL_DEFINE0(fork)
1642{ 1639{
1643#ifdef CONFIG_MMU 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#else 1642#else
1646 /* can not support in nommu mode */ 1643 /* can not support in nommu mode */
1647 return(-EINVAL); 1644 return(-EINVAL);
@@ -1652,7 +1649,7 @@ SYSCALL_DEFINE0(fork)
1652#ifdef __ARCH_WANT_SYS_VFORK 1649#ifdef __ARCH_WANT_SYS_VFORK
1653SYSCALL_DEFINE0(vfork) 1650SYSCALL_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 0, NULL, NULL); 1653 0, NULL, NULL);
1657} 1654}
1658#endif 1655#endif
@@ -1675,7 +1672,7 @@ SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp,
1675 int, tls_val) 1672 int, tls_val)
1676#endif 1673#endif
1677{ 1674{
1678 return do_fork(clone_flags, newsp, current_pt_regs(), 0, 1675 return do_fork(clone_flags, newsp, 0,
1679 parent_tidptr, child_tidptr); 1676 parent_tidptr, child_tidptr);
1680} 1677}
1681#endif 1678#endif