aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/kernel/process.c')
-rw-r--r--arch/ia64/kernel/process.c55
1 files changed, 3 insertions, 52 deletions
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index 9bcec9945c12..883ecc9cfef5 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -33,7 +33,6 @@
33#include <asm/cpu.h> 33#include <asm/cpu.h>
34#include <asm/delay.h> 34#include <asm/delay.h>
35#include <asm/elf.h> 35#include <asm/elf.h>
36#include <asm/ia32.h>
37#include <asm/irq.h> 36#include <asm/irq.h>
38#include <asm/kexec.h> 37#include <asm/kexec.h>
39#include <asm/pgalloc.h> 38#include <asm/pgalloc.h>
@@ -358,11 +357,6 @@ ia64_save_extra (struct task_struct *task)
358 if (info & PFM_CPUINFO_SYST_WIDE) 357 if (info & PFM_CPUINFO_SYST_WIDE)
359 pfm_syst_wide_update_task(task, info, 0); 358 pfm_syst_wide_update_task(task, info, 0);
360#endif 359#endif
361
362#ifdef CONFIG_IA32_SUPPORT
363 if (IS_IA32_PROCESS(task_pt_regs(task)))
364 ia32_save_state(task);
365#endif
366} 360}
367 361
368void 362void
@@ -383,11 +377,6 @@ ia64_load_extra (struct task_struct *task)
383 if (info & PFM_CPUINFO_SYST_WIDE) 377 if (info & PFM_CPUINFO_SYST_WIDE)
384 pfm_syst_wide_update_task(task, info, 1); 378 pfm_syst_wide_update_task(task, info, 1);
385#endif 379#endif
386
387#ifdef CONFIG_IA32_SUPPORT
388 if (IS_IA32_PROCESS(task_pt_regs(task)))
389 ia32_load_state(task);
390#endif
391} 380}
392 381
393/* 382/*
@@ -426,7 +415,7 @@ copy_thread(unsigned long clone_flags,
426 unsigned long user_stack_base, unsigned long user_stack_size, 415 unsigned long user_stack_base, unsigned long user_stack_size,
427 struct task_struct *p, struct pt_regs *regs) 416 struct task_struct *p, struct pt_regs *regs)
428{ 417{
429 extern char ia64_ret_from_clone, ia32_ret_from_clone; 418 extern char ia64_ret_from_clone;
430 struct switch_stack *child_stack, *stack; 419 struct switch_stack *child_stack, *stack;
431 unsigned long rbs, child_rbs, rbs_size; 420 unsigned long rbs, child_rbs, rbs_size;
432 struct pt_regs *child_ptregs; 421 struct pt_regs *child_ptregs;
@@ -457,7 +446,7 @@ copy_thread(unsigned long clone_flags,
457 memcpy((void *) child_rbs, (void *) rbs, rbs_size); 446 memcpy((void *) child_rbs, (void *) rbs, rbs_size);
458 447
459 if (likely(user_mode(child_ptregs))) { 448 if (likely(user_mode(child_ptregs))) {
460 if ((clone_flags & CLONE_SETTLS) && !IS_IA32_PROCESS(regs)) 449 if (clone_flags & CLONE_SETTLS)
461 child_ptregs->r13 = regs->r16; /* see sys_clone2() in entry.S */ 450 child_ptregs->r13 = regs->r16; /* see sys_clone2() in entry.S */
462 if (user_stack_base) { 451 if (user_stack_base) {
463 child_ptregs->r12 = user_stack_base + user_stack_size - 16; 452 child_ptregs->r12 = user_stack_base + user_stack_size - 16;
@@ -477,10 +466,7 @@ copy_thread(unsigned long clone_flags,
477 child_ptregs->r13 = (unsigned long) p; /* set `current' pointer */ 466 child_ptregs->r13 = (unsigned long) p; /* set `current' pointer */
478 } 467 }
479 child_stack->ar_bspstore = child_rbs + rbs_size; 468 child_stack->ar_bspstore = child_rbs + rbs_size;
480 if (IS_IA32_PROCESS(regs)) 469 child_stack->b0 = (unsigned long) &ia64_ret_from_clone;
481 child_stack->b0 = (unsigned long) &ia32_ret_from_clone;
482 else
483 child_stack->b0 = (unsigned long) &ia64_ret_from_clone;
484 470
485 /* copy parts of thread_struct: */ 471 /* copy parts of thread_struct: */
486 p->thread.ksp = (unsigned long) child_stack - 16; 472 p->thread.ksp = (unsigned long) child_stack - 16;
@@ -515,22 +501,6 @@ copy_thread(unsigned long clone_flags,
515 p->thread.flags = ((current->thread.flags & ~THREAD_FLAGS_TO_CLEAR) 501 p->thread.flags = ((current->thread.flags & ~THREAD_FLAGS_TO_CLEAR)
516 | THREAD_FLAGS_TO_SET); 502 | THREAD_FLAGS_TO_SET);
517 ia64_drop_fpu(p); /* don't pick up stale state from a CPU's fph */ 503 ia64_drop_fpu(p); /* don't pick up stale state from a CPU's fph */
518#ifdef CONFIG_IA32_SUPPORT
519 /*
520 * If we're cloning an IA32 task then save the IA32 extra
521 * state from the current task to the new task
522 */
523 if (IS_IA32_PROCESS(task_pt_regs(current))) {
524 ia32_save_state(p);
525 if (clone_flags & CLONE_SETTLS)
526 retval = ia32_clone_tls(p, child_ptregs);
527
528 /* Copy partially mapped page list */
529 if (!retval)
530 retval = ia32_copy_ia64_partial_page_list(p,
531 clone_flags);
532 }
533#endif
534 504
535#ifdef CONFIG_PERFMON 505#ifdef CONFIG_PERFMON
536 if (current->thread.pfm_context) 506 if (current->thread.pfm_context)
@@ -704,15 +674,6 @@ EXPORT_SYMBOL(kernel_thread);
704int 674int
705kernel_thread_helper (int (*fn)(void *), void *arg) 675kernel_thread_helper (int (*fn)(void *), void *arg)
706{ 676{
707#ifdef CONFIG_IA32_SUPPORT
708 if (IS_IA32_PROCESS(task_pt_regs(current))) {
709 /* A kernel thread is always a 64-bit process. */
710 current->thread.map_base = DEFAULT_MAP_BASE;
711 current->thread.task_size = DEFAULT_TASK_SIZE;
712 ia64_set_kr(IA64_KR_IO_BASE, current->thread.old_iob);
713 ia64_set_kr(IA64_KR_TSSD, current->thread.old_k1);
714 }
715#endif
716 return (*fn)(arg); 677 return (*fn)(arg);
717} 678}
718 679
@@ -725,14 +686,6 @@ flush_thread (void)
725 /* drop floating-point and debug-register state if it exists: */ 686 /* drop floating-point and debug-register state if it exists: */
726 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); 687 current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID);
727 ia64_drop_fpu(current); 688 ia64_drop_fpu(current);
728#ifdef CONFIG_IA32_SUPPORT
729 if (IS_IA32_PROCESS(task_pt_regs(current))) {
730 ia32_drop_ia64_partial_page_list(current);
731 current->thread.task_size = IA32_PAGE_OFFSET;
732 set_fs(USER_DS);
733 memset(current->thread.tls_array, 0, sizeof(current->thread.tls_array));
734 }
735#endif
736} 689}
737 690
738/* 691/*
@@ -753,8 +706,6 @@ exit_thread (void)
753 if (current->thread.flags & IA64_THREAD_DBG_VALID) 706 if (current->thread.flags & IA64_THREAD_DBG_VALID)
754 pfm_release_debug_registers(current); 707 pfm_release_debug_registers(current);
755#endif 708#endif
756 if (IS_IA32_PROCESS(task_pt_regs(current)))
757 ia32_drop_ia64_partial_page_list(current);
758} 709}
759 710
760unsigned long 711unsigned long