diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-22 22:51:14 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-11-28 23:43:42 -0500 |
commit | afa86fc426ff7e7f5477f15da9c405d08d5cf790 (patch) | |
tree | 0f82925269757902ce6f7c287a968f7b439d2b2d | |
parent | 135c37b83c81b79a888108e3f7c5f64423d8a851 (diff) |
flagday: don't pass regs to copy_thread()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
34 files changed, 45 insertions, 60 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c index e9705bcc96f9..b5d0d0923699 100644 --- a/arch/alpha/kernel/process.c +++ b/arch/alpha/kernel/process.c | |||
@@ -241,7 +241,7 @@ release_thread(struct task_struct *dead_task) | |||
241 | int | 241 | int |
242 | copy_thread(unsigned long clone_flags, unsigned long usp, | 242 | copy_thread(unsigned long clone_flags, unsigned long usp, |
243 | unsigned long arg, | 243 | unsigned long arg, |
244 | struct task_struct *p, struct pt_regs *wontuse) | 244 | struct task_struct *p) |
245 | { | 245 | { |
246 | extern void ret_from_fork(void); | 246 | extern void ret_from_fork(void); |
247 | extern void ret_from_kernel_thread(void); | 247 | extern void ret_from_kernel_thread(void); |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 4ab80bbb6d95..9800338c5d1b 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -376,7 +376,7 @@ asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); | |||
376 | 376 | ||
377 | int | 377 | int |
378 | copy_thread(unsigned long clone_flags, unsigned long stack_start, | 378 | copy_thread(unsigned long clone_flags, unsigned long stack_start, |
379 | unsigned long stk_sz, struct task_struct *p, struct pt_regs *unused) | 379 | unsigned long stk_sz, struct task_struct *p) |
380 | { | 380 | { |
381 | struct thread_info *thread = task_thread_info(p); | 381 | struct thread_info *thread = task_thread_info(p); |
382 | struct pt_regs *childregs = task_pt_regs(p); | 382 | struct pt_regs *childregs = task_pt_regs(p); |
diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 5a1335caf6f1..cb0956bc96ed 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c | |||
@@ -234,8 +234,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | |||
234 | asmlinkage void ret_from_fork(void) asm("ret_from_fork"); | 234 | asmlinkage void ret_from_fork(void) asm("ret_from_fork"); |
235 | 235 | ||
236 | int copy_thread(unsigned long clone_flags, unsigned long stack_start, | 236 | int copy_thread(unsigned long clone_flags, unsigned long stack_start, |
237 | unsigned long stk_sz, struct task_struct *p, | 237 | unsigned long stk_sz, struct task_struct *p) |
238 | struct pt_regs *unused) | ||
239 | { | 238 | { |
240 | struct pt_regs *childregs = task_pt_regs(p); | 239 | struct pt_regs *childregs = task_pt_regs(p); |
241 | unsigned long tls = p->thread.tp_value; | 240 | unsigned long tls = p->thread.tp_value; |
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c index 03d7aa4a4bc9..fd78f58ea79a 100644 --- a/arch/avr32/kernel/process.c +++ b/arch/avr32/kernel/process.c | |||
@@ -299,7 +299,7 @@ asmlinkage void syscall_return(void); | |||
299 | 299 | ||
300 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 300 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
301 | unsigned long arg, | 301 | unsigned long arg, |
302 | struct task_struct *p, struct pt_regs *unused) | 302 | struct task_struct *p) |
303 | { | 303 | { |
304 | struct pt_regs *childregs = task_pt_regs(p); | 304 | struct pt_regs *childregs = task_pt_regs(p); |
305 | 305 | ||
diff --git a/arch/blackfin/kernel/process.c b/arch/blackfin/kernel/process.c index e5ae8fcab438..582276efaaa4 100644 --- a/arch/blackfin/kernel/process.c +++ b/arch/blackfin/kernel/process.c | |||
@@ -141,14 +141,14 @@ asmlinkage int bfin_clone(unsigned long clone_flags, unsigned long newsp) | |||
141 | int | 141 | int |
142 | copy_thread(unsigned long clone_flags, | 142 | copy_thread(unsigned long clone_flags, |
143 | unsigned long usp, unsigned long topstk, | 143 | unsigned long usp, unsigned long topstk, |
144 | struct task_struct *p, struct pt_regs *regs) | 144 | struct task_struct *p) |
145 | { | 145 | { |
146 | struct pt_regs *childregs; | 146 | struct pt_regs *childregs; |
147 | unsigned long *v; | 147 | unsigned long *v; |
148 | 148 | ||
149 | childregs = (struct pt_regs *) (task_stack_page(p) + THREAD_SIZE) - 1; | 149 | childregs = (struct pt_regs *) (task_stack_page(p) + THREAD_SIZE) - 1; |
150 | v = ((unsigned long *)childregs) - 2; | 150 | v = ((unsigned long *)childregs) - 2; |
151 | if (unlikely(!regs)) { | 151 | if (unlikely(p->flags & PF_KTHREAD)) { |
152 | memset(childregs, 0, sizeof(struct pt_regs)); | 152 | memset(childregs, 0, sizeof(struct pt_regs)); |
153 | v[0] = usp; | 153 | v[0] = usp; |
154 | v[1] = topstk; | 154 | v[1] = topstk; |
@@ -157,7 +157,7 @@ copy_thread(unsigned long clone_flags, | |||
157 | __asm__ __volatile__("%0 = syscfg;":"=da"(childregs->syscfg):); | 157 | __asm__ __volatile__("%0 = syscfg;":"=da"(childregs->syscfg):); |
158 | p->thread.usp = 0; | 158 | p->thread.usp = 0; |
159 | } else { | 159 | } else { |
160 | *childregs = *regs; | 160 | *childregs = *current_pt_regs(); |
161 | childregs->r0 = 0; | 161 | childregs->r0 = 0; |
162 | p->thread.usp = usp ? : rdusp(); | 162 | p->thread.usp = usp ? : rdusp(); |
163 | v[0] = v[1] = 0; | 163 | v[0] = v[1] = 0; |
diff --git a/arch/c6x/kernel/process.c b/arch/c6x/kernel/process.c index a3f91895e8b4..6434df476f77 100644 --- a/arch/c6x/kernel/process.c +++ b/arch/c6x/kernel/process.c | |||
@@ -139,7 +139,7 @@ void start_thread(struct pt_regs *regs, unsigned int pc, unsigned long usp) | |||
139 | */ | 139 | */ |
140 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 140 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
141 | unsigned long ustk_size, | 141 | unsigned long ustk_size, |
142 | struct task_struct *p, struct pt_regs *unused) | 142 | struct task_struct *p) |
143 | { | 143 | { |
144 | struct pt_regs *childregs; | 144 | struct pt_regs *childregs; |
145 | 145 | ||
diff --git a/arch/cris/arch-v10/kernel/process.c b/arch/cris/arch-v10/kernel/process.c index 520547c8b196..b1018750cffb 100644 --- a/arch/cris/arch-v10/kernel/process.c +++ b/arch/cris/arch-v10/kernel/process.c | |||
@@ -94,8 +94,7 @@ asmlinkage void ret_from_fork(void); | |||
94 | asmlinkage void ret_from_kernel_thread(void); | 94 | asmlinkage void ret_from_kernel_thread(void); |
95 | 95 | ||
96 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 96 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
97 | unsigned long arg, | 97 | unsigned long arg, struct task_struct *p) |
98 | struct task_struct *p, struct pt_regs *unused) | ||
99 | { | 98 | { |
100 | struct pt_regs *childregs = task_pt_regs(p); | 99 | struct pt_regs *childregs = task_pt_regs(p); |
101 | struct switch_stack *swstack = ((struct switch_stack *)childregs) - 1; | 100 | struct switch_stack *swstack = ((struct switch_stack *)childregs) - 1; |
diff --git a/arch/cris/arch-v32/kernel/process.c b/arch/cris/arch-v32/kernel/process.c index 331e70252df0..2b23ef0e4452 100644 --- a/arch/cris/arch-v32/kernel/process.c +++ b/arch/cris/arch-v32/kernel/process.c | |||
@@ -109,8 +109,7 @@ extern asmlinkage void ret_from_kernel_thread(void); | |||
109 | 109 | ||
110 | int | 110 | int |
111 | copy_thread(unsigned long clone_flags, unsigned long usp, | 111 | copy_thread(unsigned long clone_flags, unsigned long usp, |
112 | unsigned long arg, | 112 | unsigned long arg, struct task_struct *p) |
113 | struct task_struct *p, struct pt_regs *unused) | ||
114 | { | 113 | { |
115 | struct pt_regs *childregs = task_pt_regs(p); | 114 | struct pt_regs *childregs = task_pt_regs(p); |
116 | struct switch_stack *swstack = ((struct switch_stack *) childregs) - 1; | 115 | struct switch_stack *swstack = ((struct switch_stack *) childregs) - 1; |
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c index 0039bf77b192..23916b2a12a2 100644 --- a/arch/frv/kernel/process.c +++ b/arch/frv/kernel/process.c | |||
@@ -144,7 +144,7 @@ inline unsigned long user_stack(const struct pt_regs *regs) | |||
144 | */ | 144 | */ |
145 | int copy_thread(unsigned long clone_flags, | 145 | int copy_thread(unsigned long clone_flags, |
146 | unsigned long usp, unsigned long arg, | 146 | unsigned long usp, unsigned long arg, |
147 | struct task_struct *p, struct pt_regs *unused) | 147 | struct task_struct *p) |
148 | { | 148 | { |
149 | struct pt_regs *childregs; | 149 | struct pt_regs *childregs; |
150 | 150 | ||
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index b0fb4054aee5..b609f63f1590 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
@@ -129,7 +129,7 @@ void flush_thread(void) | |||
129 | 129 | ||
130 | int copy_thread(unsigned long clone_flags, | 130 | int copy_thread(unsigned long clone_flags, |
131 | unsigned long usp, unsigned long topstk, | 131 | unsigned long usp, unsigned long topstk, |
132 | struct task_struct * p, struct pt_regs *unused) | 132 | struct task_struct * p) |
133 | { | 133 | { |
134 | struct pt_regs * childregs; | 134 | struct pt_regs * childregs; |
135 | 135 | ||
diff --git a/arch/hexagon/kernel/process.c b/arch/hexagon/kernel/process.c index 36dce17ed25c..06ae9ffcabd5 100644 --- a/arch/hexagon/kernel/process.c +++ b/arch/hexagon/kernel/process.c | |||
@@ -87,8 +87,7 @@ unsigned long thread_saved_pc(struct task_struct *tsk) | |||
87 | * Copy architecture-specific thread state | 87 | * Copy architecture-specific thread state |
88 | */ | 88 | */ |
89 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 89 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
90 | unsigned long arg, struct task_struct *p, | 90 | unsigned long arg, struct task_struct *p) |
91 | struct pt_regs *unused) | ||
92 | { | 91 | { |
93 | struct thread_info *ti = task_thread_info(p); | 92 | struct thread_info *ti = task_thread_info(p); |
94 | struct hexagon_switch_stack *ss; | 93 | struct hexagon_switch_stack *ss; |
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 25543a295ad9..31360cbbd5f8 100644 --- a/arch/ia64/kernel/process.c +++ b/arch/ia64/kernel/process.c | |||
@@ -393,12 +393,13 @@ ia64_load_extra (struct task_struct *task) | |||
393 | int | 393 | int |
394 | copy_thread(unsigned long clone_flags, | 394 | copy_thread(unsigned long clone_flags, |
395 | unsigned long user_stack_base, unsigned long user_stack_size, | 395 | unsigned long user_stack_base, unsigned long user_stack_size, |
396 | struct task_struct *p, struct pt_regs *regs) | 396 | struct task_struct *p) |
397 | { | 397 | { |
398 | extern char ia64_ret_from_clone; | 398 | extern char ia64_ret_from_clone; |
399 | struct switch_stack *child_stack, *stack; | 399 | struct switch_stack *child_stack, *stack; |
400 | unsigned long rbs, child_rbs, rbs_size; | 400 | unsigned long rbs, child_rbs, rbs_size; |
401 | struct pt_regs *child_ptregs; | 401 | struct pt_regs *child_ptregs; |
402 | struct pt_regs *regs = current_pt_regs(); | ||
402 | int retval = 0; | 403 | int retval = 0; |
403 | 404 | ||
404 | child_ptregs = (struct pt_regs *) ((unsigned long) p + IA64_STK_OFFSET) - 1; | 405 | child_ptregs = (struct pt_regs *) ((unsigned long) p + IA64_STK_OFFSET) - 1; |
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c index c37e9a9a8f27..765d0f57c787 100644 --- a/arch/m32r/kernel/process.c +++ b/arch/m32r/kernel/process.c | |||
@@ -192,7 +192,7 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu) | |||
192 | } | 192 | } |
193 | 193 | ||
194 | int copy_thread(unsigned long clone_flags, unsigned long spu, | 194 | int copy_thread(unsigned long clone_flags, unsigned long spu, |
195 | unsigned long arg, struct task_struct *tsk, struct pt_regs *unused) | 195 | unsigned long arg, struct task_struct *tsk) |
196 | { | 196 | { |
197 | struct pt_regs *childregs = task_pt_regs(tsk); | 197 | struct pt_regs *childregs = task_pt_regs(tsk); |
198 | extern void ret_from_fork(void); | 198 | extern void ret_from_fork(void); |
diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c index aa9b11000273..9a3df4df73cc 100644 --- a/arch/m68k/kernel/process.c +++ b/arch/m68k/kernel/process.c | |||
@@ -154,8 +154,7 @@ asmlinkage int m68k_clone(struct pt_regs *regs) | |||
154 | } | 154 | } |
155 | 155 | ||
156 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 156 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
157 | unsigned long arg, | 157 | unsigned long arg, struct task_struct *p) |
158 | struct task_struct * p, struct pt_regs * unused) | ||
159 | { | 158 | { |
160 | struct fork_frame { | 159 | struct fork_frame { |
161 | struct switch_stack sw; | 160 | struct switch_stack sw; |
diff --git a/arch/microblaze/kernel/process.c b/arch/microblaze/kernel/process.c index a5fed8db7263..40823fd1db0b 100644 --- a/arch/microblaze/kernel/process.c +++ b/arch/microblaze/kernel/process.c | |||
@@ -120,8 +120,7 @@ void flush_thread(void) | |||
120 | } | 120 | } |
121 | 121 | ||
122 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 122 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
123 | unsigned long arg, | 123 | unsigned long arg, struct task_struct *p) |
124 | struct task_struct *p, struct pt_regs *unused) | ||
125 | { | 124 | { |
126 | struct pt_regs *childregs = task_pt_regs(p); | 125 | struct pt_regs *childregs = task_pt_regs(p); |
127 | struct thread_info *ti = task_thread_info(p); | 126 | struct thread_info *ti = task_thread_info(p); |
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index d13720ac656f..38097652d62d 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
@@ -114,10 +114,10 @@ void flush_thread(void) | |||
114 | } | 114 | } |
115 | 115 | ||
116 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 116 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
117 | unsigned long arg, struct task_struct *p, struct pt_regs *regs) | 117 | unsigned long arg, struct task_struct *p) |
118 | { | 118 | { |
119 | struct thread_info *ti = task_thread_info(p); | 119 | struct thread_info *ti = task_thread_info(p); |
120 | struct pt_regs *childregs; | 120 | struct pt_regs *childregs, *regs = current_pt_regs(); |
121 | unsigned long childksp; | 121 | unsigned long childksp; |
122 | p->set_child_tid = p->clear_child_tid = NULL; | 122 | p->set_child_tid = p->clear_child_tid = NULL; |
123 | 123 | ||
diff --git a/arch/mn10300/kernel/process.c b/arch/mn10300/kernel/process.c index 5e0ef396458d..eb09f5a552ff 100644 --- a/arch/mn10300/kernel/process.c +++ b/arch/mn10300/kernel/process.c | |||
@@ -206,7 +206,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | |||
206 | */ | 206 | */ |
207 | int copy_thread(unsigned long clone_flags, | 207 | int copy_thread(unsigned long clone_flags, |
208 | unsigned long c_usp, unsigned long ustk_size, | 208 | unsigned long c_usp, unsigned long ustk_size, |
209 | struct task_struct *p, struct pt_regs *unused) | 209 | struct task_struct *p) |
210 | { | 210 | { |
211 | struct thread_info *ti = task_thread_info(p); | 211 | struct thread_info *ti = task_thread_info(p); |
212 | struct pt_regs *c_regs; | 212 | struct pt_regs *c_regs; |
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c index 6b853668369b..00c233bf0d06 100644 --- a/arch/openrisc/kernel/process.c +++ b/arch/openrisc/kernel/process.c | |||
@@ -142,7 +142,7 @@ extern asmlinkage void ret_from_fork(void); | |||
142 | 142 | ||
143 | int | 143 | int |
144 | copy_thread(unsigned long clone_flags, unsigned long usp, | 144 | copy_thread(unsigned long clone_flags, unsigned long usp, |
145 | unsigned long arg, struct task_struct *p, struct pt_regs *regs) | 145 | unsigned long arg, struct task_struct *p) |
146 | { | 146 | { |
147 | struct pt_regs *userregs; | 147 | struct pt_regs *userregs; |
148 | struct pt_regs *kregs; | 148 | struct pt_regs *kregs; |
diff --git a/arch/parisc/kernel/process.c b/arch/parisc/kernel/process.c index 9753ecf49a06..d13507246c5d 100644 --- a/arch/parisc/kernel/process.c +++ b/arch/parisc/kernel/process.c | |||
@@ -204,10 +204,9 @@ int dump_task_fpu (struct task_struct *tsk, elf_fpregset_t *r) | |||
204 | 204 | ||
205 | int | 205 | int |
206 | copy_thread(unsigned long clone_flags, unsigned long usp, | 206 | copy_thread(unsigned long clone_flags, unsigned long usp, |
207 | unsigned long arg, | 207 | unsigned long arg, struct task_struct *p) |
208 | struct task_struct *p, struct pt_regs *unused) | ||
209 | { | 208 | { |
210 | struct pt_regs * cregs = &(p->thread.regs); | 209 | struct pt_regs *cregs = &(p->thread.regs); |
211 | void *stack = task_stack_page(p); | 210 | void *stack = task_stack_page(p); |
212 | 211 | ||
213 | /* We have to use void * instead of a function pointer, because | 212 | /* We have to use void * instead of a function pointer, because |
diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index a31437567631..81430674e71c 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c | |||
@@ -733,8 +733,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | |||
733 | extern unsigned long dscr_default; /* defined in arch/powerpc/kernel/sysfs.c */ | 733 | extern unsigned long dscr_default; /* defined in arch/powerpc/kernel/sysfs.c */ |
734 | 734 | ||
735 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 735 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
736 | unsigned long arg, struct task_struct *p, | 736 | unsigned long arg, struct task_struct *p) |
737 | struct pt_regs *regs) | ||
738 | { | 737 | { |
739 | struct pt_regs *childregs, *kregs; | 738 | struct pt_regs *childregs, *kregs; |
740 | extern void ret_from_fork(void); | 739 | extern void ret_from_fork(void); |
@@ -759,6 +758,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp, | |||
759 | ti->flags |= _TIF_RESTOREALL; | 758 | ti->flags |= _TIF_RESTOREALL; |
760 | f = ret_from_kernel_thread; | 759 | f = ret_from_kernel_thread; |
761 | } else { | 760 | } else { |
761 | struct pt_regs *regs = current_pt_regs(); | ||
762 | CHECK_FULL_REGS(regs); | 762 | CHECK_FULL_REGS(regs); |
763 | *childregs = *regs; | 763 | *childregs = *regs; |
764 | if (usp) | 764 | if (usp) |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index e37677796a09..536d64579d9a 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -117,8 +117,7 @@ void release_thread(struct task_struct *dead_task) | |||
117 | } | 117 | } |
118 | 118 | ||
119 | int copy_thread(unsigned long clone_flags, unsigned long new_stackp, | 119 | int copy_thread(unsigned long clone_flags, unsigned long new_stackp, |
120 | unsigned long arg, | 120 | unsigned long arg, struct task_struct *p) |
121 | struct task_struct *p, struct pt_regs *unused) | ||
122 | { | 121 | { |
123 | struct thread_info *ti; | 122 | struct thread_info *ti; |
124 | struct fake_frame | 123 | struct fake_frame |
diff --git a/arch/score/kernel/process.c b/arch/score/kernel/process.c index f96379a5aee0..79568466b578 100644 --- a/arch/score/kernel/process.c +++ b/arch/score/kernel/process.c | |||
@@ -87,11 +87,11 @@ void flush_thread(void) {} | |||
87 | * set up the kernel stack and exception frames for a new process | 87 | * set up the kernel stack and exception frames for a new process |
88 | */ | 88 | */ |
89 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 89 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
90 | unsigned long arg, | 90 | unsigned long arg, struct task_struct *p) |
91 | struct task_struct *p, struct pt_regs *regs) | ||
92 | { | 91 | { |
93 | struct thread_info *ti = task_thread_info(p); | 92 | struct thread_info *ti = task_thread_info(p); |
94 | struct pt_regs *childregs = task_pt_regs(p); | 93 | struct pt_regs *childregs = task_pt_regs(p); |
94 | struct pt_regs *regs = current_pt_regs(); | ||
95 | 95 | ||
96 | p->thread.reg0 = (unsigned long) childregs; | 96 | p->thread.reg0 = (unsigned long) childregs; |
97 | if (unlikely(p->flags & PF_KTHREAD)) { | 97 | if (unlikely(p->flags & PF_KTHREAD)) { |
diff --git a/arch/sh/kernel/process_32.c b/arch/sh/kernel/process_32.c index 1786d16b6c64..73eb66fc6253 100644 --- a/arch/sh/kernel/process_32.c +++ b/arch/sh/kernel/process_32.c | |||
@@ -128,8 +128,7 @@ asmlinkage void ret_from_fork(void); | |||
128 | asmlinkage void ret_from_kernel_thread(void); | 128 | asmlinkage void ret_from_kernel_thread(void); |
129 | 129 | ||
130 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 130 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
131 | unsigned long arg, | 131 | unsigned long arg, struct task_struct *p) |
132 | struct task_struct *p, struct pt_regs *unused) | ||
133 | { | 132 | { |
134 | struct thread_info *ti = task_thread_info(p); | 133 | struct thread_info *ti = task_thread_info(p); |
135 | struct pt_regs *childregs; | 134 | struct pt_regs *childregs; |
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index d5c86a8a3849..e611c85144b1 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c | |||
@@ -371,10 +371,9 @@ asmlinkage void ret_from_fork(void); | |||
371 | asmlinkage void ret_from_kernel_thread(void); | 371 | asmlinkage void ret_from_kernel_thread(void); |
372 | 372 | ||
373 | int copy_thread(unsigned long clone_flags, unsigned long usp, | 373 | int copy_thread(unsigned long clone_flags, unsigned long usp, |
374 | unsigned long arg, | 374 | unsigned long arg, struct task_struct *p) |
375 | struct task_struct *p, struct pt_regs *regs) | ||
376 | { | 375 | { |
377 | struct pt_regs *childregs; | 376 | struct pt_regs *childregs, *regs = current_pt_regs(); |
378 | 377 | ||
379 | #ifdef CONFIG_SH_FPU | 378 | #ifdef CONFIG_SH_FPU |
380 | /* can't happen for a kernel thread */ | 379 | /* can't happen for a kernel thread */ |
diff --git a/arch/sparc/kernel/process_32.c b/arch/sparc/kernel/process_32.c index bf4c6addce7b..ecde946ef834 100644 --- a/arch/sparc/kernel/process_32.c +++ b/arch/sparc/kernel/process_32.c | |||
@@ -319,11 +319,10 @@ extern void ret_from_fork(void); | |||
319 | extern void ret_from_kernel_thread(void); | 319 | extern void ret_from_kernel_thread(void); |
320 | 320 | ||
321 | int copy_thread(unsigned long clone_flags, unsigned long sp, | 321 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
322 | unsigned long arg, | 322 | unsigned long arg, struct task_struct *p) |
323 | struct task_struct *p, struct pt_regs *regs) | ||
324 | { | 323 | { |
325 | struct thread_info *ti = task_thread_info(p); | 324 | struct thread_info *ti = task_thread_info(p); |
326 | struct pt_regs *childregs; | 325 | struct pt_regs *childregs, *regs = current_pt_regs(); |
327 | char *new_stack; | 326 | char *new_stack; |
328 | 327 | ||
329 | #ifndef CONFIG_SMP | 328 | #ifndef CONFIG_SMP |
diff --git a/arch/sparc/kernel/process_64.c b/arch/sparc/kernel/process_64.c index dff54f46728d..58ef19e7e82f 100644 --- a/arch/sparc/kernel/process_64.c +++ b/arch/sparc/kernel/process_64.c | |||
@@ -622,10 +622,10 @@ asmlinkage long sparc_do_fork(unsigned long clone_flags, | |||
622 | * Child --> %o0 == parents pid, %o1 == 1 | 622 | * Child --> %o0 == parents pid, %o1 == 1 |
623 | */ | 623 | */ |
624 | int copy_thread(unsigned long clone_flags, unsigned long sp, | 624 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
625 | unsigned long arg, | 625 | unsigned long arg, struct task_struct *p) |
626 | struct task_struct *p, struct pt_regs *regs) | ||
627 | { | 626 | { |
628 | struct thread_info *t = task_thread_info(p); | 627 | struct thread_info *t = task_thread_info(p); |
628 | struct pt_regs *regs = current_pt_regs(); | ||
629 | struct sparc_stackf *parent_sf; | 629 | struct sparc_stackf *parent_sf; |
630 | unsigned long child_stack_sz; | 630 | unsigned long child_stack_sz; |
631 | char *child_trap_frame; | 631 | char *child_trap_frame; |
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 267936b51b59..0e5661e7d00d 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c | |||
@@ -157,10 +157,9 @@ void arch_release_thread_info(struct thread_info *info) | |||
157 | static void save_arch_state(struct thread_struct *t); | 157 | static void save_arch_state(struct thread_struct *t); |
158 | 158 | ||
159 | int copy_thread(unsigned long clone_flags, unsigned long sp, | 159 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
160 | unsigned long arg, | 160 | unsigned long arg, struct task_struct *p) |
161 | struct task_struct *p, struct pt_regs *unused) | ||
162 | { | 161 | { |
163 | struct pt_regs *childregs = task_pt_regs(p); | 162 | struct pt_regs *childregs = task_pt_regs(p), *regs = current_pt_regs(); |
164 | unsigned long ksp; | 163 | unsigned long ksp; |
165 | unsigned long *callee_regs; | 164 | unsigned long *callee_regs; |
166 | 165 | ||
diff --git a/arch/um/kernel/process.c b/arch/um/kernel/process.c index c502c804e8bb..b462b13c5bae 100644 --- a/arch/um/kernel/process.c +++ b/arch/um/kernel/process.c | |||
@@ -161,8 +161,7 @@ void fork_handler(void) | |||
161 | } | 161 | } |
162 | 162 | ||
163 | int copy_thread(unsigned long clone_flags, unsigned long sp, | 163 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
164 | unsigned long arg, struct task_struct * p, | 164 | unsigned long arg, struct task_struct * p) |
165 | struct pt_regs *regs) | ||
166 | { | 165 | { |
167 | void (*handler)(void); | 166 | void (*handler)(void); |
168 | int kthread = current->flags & PF_KTHREAD; | 167 | int kthread = current->flags & PF_KTHREAD; |
diff --git a/arch/unicore32/kernel/process.c b/arch/unicore32/kernel/process.c index 79e44e8ae31c..62bad9fed03e 100644 --- a/arch/unicore32/kernel/process.c +++ b/arch/unicore32/kernel/process.c | |||
@@ -262,7 +262,7 @@ asmlinkage void ret_from_kernel_thread(void) __asm__("ret_from_kernel_thread"); | |||
262 | 262 | ||
263 | int | 263 | int |
264 | copy_thread(unsigned long clone_flags, unsigned long stack_start, | 264 | copy_thread(unsigned long clone_flags, unsigned long stack_start, |
265 | unsigned long stk_sz, struct task_struct *p, struct pt_regs *unused) | 265 | unsigned long stk_sz, struct task_struct *p) |
266 | { | 266 | { |
267 | struct thread_info *thread = task_thread_info(p); | 267 | struct thread_info *thread = task_thread_info(p); |
268 | struct pt_regs *childregs = task_pt_regs(p); | 268 | struct pt_regs *childregs = task_pt_regs(p); |
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c index 16efa974532b..b5a8905785e6 100644 --- a/arch/x86/kernel/process_32.c +++ b/arch/x86/kernel/process_32.c | |||
@@ -128,8 +128,7 @@ void release_thread(struct task_struct *dead_task) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | int copy_thread(unsigned long clone_flags, unsigned long sp, | 130 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
131 | unsigned long arg, | 131 | unsigned long arg, struct task_struct *p) |
132 | struct task_struct *p, struct pt_regs *unused) | ||
133 | { | 132 | { |
134 | struct pt_regs *childregs = task_pt_regs(p); | 133 | struct pt_regs *childregs = task_pt_regs(p); |
135 | struct task_struct *tsk; | 134 | struct task_struct *tsk; |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 74aac76c6e34..6e68a6194965 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -146,8 +146,7 @@ static inline u32 read_32bit_tls(struct task_struct *t, int tls) | |||
146 | } | 146 | } |
147 | 147 | ||
148 | int copy_thread(unsigned long clone_flags, unsigned long sp, | 148 | int copy_thread(unsigned long clone_flags, unsigned long sp, |
149 | unsigned long arg, | 149 | unsigned long arg, struct task_struct *p) |
150 | struct task_struct *p, struct pt_regs *regs) | ||
151 | { | 150 | { |
152 | int err; | 151 | int err; |
153 | struct pt_regs *childregs; | 152 | struct pt_regs *childregs; |
diff --git a/arch/xtensa/kernel/process.c b/arch/xtensa/kernel/process.c index 0036c14739f8..1accf28da5f5 100644 --- a/arch/xtensa/kernel/process.c +++ b/arch/xtensa/kernel/process.c | |||
@@ -199,8 +199,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src) | |||
199 | */ | 199 | */ |
200 | 200 | ||
201 | int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn, | 201 | int copy_thread(unsigned long clone_flags, unsigned long usp_thread_fn, |
202 | unsigned long thread_fn_arg, | 202 | unsigned long thread_fn_arg, struct task_struct *p) |
203 | struct task_struct *p, struct pt_regs *unused) | ||
204 | { | 203 | { |
205 | struct pt_regs *childregs = task_pt_regs(p); | 204 | struct pt_regs *childregs = task_pt_regs(p); |
206 | 205 | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index c57249782e48..78a2ae3470df 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -2271,7 +2271,7 @@ extern void mm_release(struct task_struct *, struct mm_struct *); | |||
2271 | extern struct mm_struct *dup_mm(struct task_struct *tsk); | 2271 | extern struct mm_struct *dup_mm(struct task_struct *tsk); |
2272 | 2272 | ||
2273 | extern int copy_thread(unsigned long, unsigned long, unsigned long, | 2273 | extern int copy_thread(unsigned long, unsigned long, unsigned long, |
2274 | struct task_struct *, struct pt_regs *); | 2274 | struct task_struct *); |
2275 | extern void flush_thread(void); | 2275 | extern void flush_thread(void); |
2276 | extern void exit_thread(void); | 2276 | extern void exit_thread(void); |
2277 | 2277 | ||
diff --git a/kernel/fork.c b/kernel/fork.c index 27a337549dab..d96a562b1311 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1320,7 +1320,7 @@ static struct task_struct *copy_process(unsigned long clone_flags, | |||
1320 | retval = copy_io(clone_flags, p); | 1320 | retval = copy_io(clone_flags, p); |
1321 | if (retval) | 1321 | if (retval) |
1322 | goto bad_fork_cleanup_namespaces; | 1322 | goto bad_fork_cleanup_namespaces; |
1323 | retval = copy_thread(clone_flags, stack_start, stack_size, p, regs); | 1323 | retval = copy_thread(clone_flags, stack_start, stack_size, p); |
1324 | if (retval) | 1324 | if (retval) |
1325 | goto bad_fork_cleanup_io; | 1325 | goto bad_fork_cleanup_io; |
1326 | 1326 | ||