diff options
Diffstat (limited to 'arch/i386/kernel/process.c')
-rw-r--r-- | arch/i386/kernel/process.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 57d375900afb..dd53c58f64f1 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c | |||
@@ -205,7 +205,7 @@ void cpu_idle(void) | |||
205 | void cpu_idle_wait(void) | 205 | void cpu_idle_wait(void) |
206 | { | 206 | { |
207 | unsigned int cpu, this_cpu = get_cpu(); | 207 | unsigned int cpu, this_cpu = get_cpu(); |
208 | cpumask_t map; | 208 | cpumask_t map, tmp = current->cpus_allowed; |
209 | 209 | ||
210 | set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); | 210 | set_cpus_allowed(current, cpumask_of_cpu(this_cpu)); |
211 | put_cpu(); | 211 | put_cpu(); |
@@ -227,6 +227,8 @@ void cpu_idle_wait(void) | |||
227 | } | 227 | } |
228 | cpus_and(map, map, cpu_online_map); | 228 | cpus_and(map, map, cpu_online_map); |
229 | } while (!cpus_empty(map)); | 229 | } while (!cpus_empty(map)); |
230 | |||
231 | set_cpus_allowed(current, tmp); | ||
230 | } | 232 | } |
231 | EXPORT_SYMBOL_GPL(cpu_idle_wait); | 233 | EXPORT_SYMBOL_GPL(cpu_idle_wait); |
232 | 234 | ||
@@ -336,7 +338,6 @@ extern void kernel_thread_helper(void); | |||
336 | int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | 338 | int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) |
337 | { | 339 | { |
338 | struct pt_regs regs; | 340 | struct pt_regs regs; |
339 | int err; | ||
340 | 341 | ||
341 | memset(®s, 0, sizeof(regs)); | 342 | memset(®s, 0, sizeof(regs)); |
342 | 343 | ||
@@ -351,10 +352,7 @@ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) | |||
351 | regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2; | 352 | regs.eflags = X86_EFLAGS_IF | X86_EFLAGS_SF | X86_EFLAGS_PF | 0x2; |
352 | 353 | ||
353 | /* Ok, create the new process.. */ | 354 | /* Ok, create the new process.. */ |
354 | err = do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); | 355 | return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, ®s, 0, NULL, NULL); |
355 | if (err == 0) /* terminate kernel stack */ | ||
356 | task_pt_regs(current)->eip = 0; | ||
357 | return err; | ||
358 | } | 356 | } |
359 | EXPORT_SYMBOL(kernel_thread); | 357 | EXPORT_SYMBOL(kernel_thread); |
360 | 358 | ||