diff options
Diffstat (limited to 'arch/ia64/kernel/process.c')
-rw-r--r-- | arch/ia64/kernel/process.c | 59 |
1 files changed, 7 insertions, 52 deletions
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c index 9bcec9945c12..d92765cae10a 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> |
@@ -60,6 +59,10 @@ unsigned long idle_halt; | |||
60 | EXPORT_SYMBOL(idle_halt); | 59 | EXPORT_SYMBOL(idle_halt); |
61 | unsigned long idle_nomwait; | 60 | unsigned long idle_nomwait; |
62 | EXPORT_SYMBOL(idle_nomwait); | 61 | EXPORT_SYMBOL(idle_nomwait); |
62 | void (*pm_idle) (void); | ||
63 | EXPORT_SYMBOL(pm_idle); | ||
64 | void (*pm_power_off) (void); | ||
65 | EXPORT_SYMBOL(pm_power_off); | ||
63 | 66 | ||
64 | void | 67 | void |
65 | ia64_do_show_stack (struct unw_frame_info *info, void *arg) | 68 | ia64_do_show_stack (struct unw_frame_info *info, void *arg) |
@@ -358,11 +361,6 @@ ia64_save_extra (struct task_struct *task) | |||
358 | if (info & PFM_CPUINFO_SYST_WIDE) | 361 | if (info & PFM_CPUINFO_SYST_WIDE) |
359 | pfm_syst_wide_update_task(task, info, 0); | 362 | pfm_syst_wide_update_task(task, info, 0); |
360 | #endif | 363 | #endif |
361 | |||
362 | #ifdef CONFIG_IA32_SUPPORT | ||
363 | if (IS_IA32_PROCESS(task_pt_regs(task))) | ||
364 | ia32_save_state(task); | ||
365 | #endif | ||
366 | } | 364 | } |
367 | 365 | ||
368 | void | 366 | void |
@@ -383,11 +381,6 @@ ia64_load_extra (struct task_struct *task) | |||
383 | if (info & PFM_CPUINFO_SYST_WIDE) | 381 | if (info & PFM_CPUINFO_SYST_WIDE) |
384 | pfm_syst_wide_update_task(task, info, 1); | 382 | pfm_syst_wide_update_task(task, info, 1); |
385 | #endif | 383 | #endif |
386 | |||
387 | #ifdef CONFIG_IA32_SUPPORT | ||
388 | if (IS_IA32_PROCESS(task_pt_regs(task))) | ||
389 | ia32_load_state(task); | ||
390 | #endif | ||
391 | } | 384 | } |
392 | 385 | ||
393 | /* | 386 | /* |
@@ -426,7 +419,7 @@ copy_thread(unsigned long clone_flags, | |||
426 | unsigned long user_stack_base, unsigned long user_stack_size, | 419 | unsigned long user_stack_base, unsigned long user_stack_size, |
427 | struct task_struct *p, struct pt_regs *regs) | 420 | struct task_struct *p, struct pt_regs *regs) |
428 | { | 421 | { |
429 | extern char ia64_ret_from_clone, ia32_ret_from_clone; | 422 | extern char ia64_ret_from_clone; |
430 | struct switch_stack *child_stack, *stack; | 423 | struct switch_stack *child_stack, *stack; |
431 | unsigned long rbs, child_rbs, rbs_size; | 424 | unsigned long rbs, child_rbs, rbs_size; |
432 | struct pt_regs *child_ptregs; | 425 | struct pt_regs *child_ptregs; |
@@ -457,7 +450,7 @@ copy_thread(unsigned long clone_flags, | |||
457 | memcpy((void *) child_rbs, (void *) rbs, rbs_size); | 450 | memcpy((void *) child_rbs, (void *) rbs, rbs_size); |
458 | 451 | ||
459 | if (likely(user_mode(child_ptregs))) { | 452 | if (likely(user_mode(child_ptregs))) { |
460 | if ((clone_flags & CLONE_SETTLS) && !IS_IA32_PROCESS(regs)) | 453 | if (clone_flags & CLONE_SETTLS) |
461 | child_ptregs->r13 = regs->r16; /* see sys_clone2() in entry.S */ | 454 | child_ptregs->r13 = regs->r16; /* see sys_clone2() in entry.S */ |
462 | if (user_stack_base) { | 455 | if (user_stack_base) { |
463 | child_ptregs->r12 = user_stack_base + user_stack_size - 16; | 456 | child_ptregs->r12 = user_stack_base + user_stack_size - 16; |
@@ -477,10 +470,7 @@ copy_thread(unsigned long clone_flags, | |||
477 | child_ptregs->r13 = (unsigned long) p; /* set `current' pointer */ | 470 | child_ptregs->r13 = (unsigned long) p; /* set `current' pointer */ |
478 | } | 471 | } |
479 | child_stack->ar_bspstore = child_rbs + rbs_size; | 472 | child_stack->ar_bspstore = child_rbs + rbs_size; |
480 | if (IS_IA32_PROCESS(regs)) | 473 | 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 | 474 | ||
485 | /* copy parts of thread_struct: */ | 475 | /* copy parts of thread_struct: */ |
486 | p->thread.ksp = (unsigned long) child_stack - 16; | 476 | p->thread.ksp = (unsigned long) child_stack - 16; |
@@ -515,22 +505,6 @@ copy_thread(unsigned long clone_flags, | |||
515 | p->thread.flags = ((current->thread.flags & ~THREAD_FLAGS_TO_CLEAR) | 505 | p->thread.flags = ((current->thread.flags & ~THREAD_FLAGS_TO_CLEAR) |
516 | | THREAD_FLAGS_TO_SET); | 506 | | THREAD_FLAGS_TO_SET); |
517 | ia64_drop_fpu(p); /* don't pick up stale state from a CPU's fph */ | 507 | 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 | 508 | ||
535 | #ifdef CONFIG_PERFMON | 509 | #ifdef CONFIG_PERFMON |
536 | if (current->thread.pfm_context) | 510 | if (current->thread.pfm_context) |
@@ -704,15 +678,6 @@ EXPORT_SYMBOL(kernel_thread); | |||
704 | int | 678 | int |
705 | kernel_thread_helper (int (*fn)(void *), void *arg) | 679 | kernel_thread_helper (int (*fn)(void *), void *arg) |
706 | { | 680 | { |
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); | 681 | return (*fn)(arg); |
717 | } | 682 | } |
718 | 683 | ||
@@ -725,14 +690,6 @@ flush_thread (void) | |||
725 | /* drop floating-point and debug-register state if it exists: */ | 690 | /* drop floating-point and debug-register state if it exists: */ |
726 | current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); | 691 | current->thread.flags &= ~(IA64_THREAD_FPH_VALID | IA64_THREAD_DBG_VALID); |
727 | ia64_drop_fpu(current); | 692 | 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 | } | 693 | } |
737 | 694 | ||
738 | /* | 695 | /* |
@@ -753,8 +710,6 @@ exit_thread (void) | |||
753 | if (current->thread.flags & IA64_THREAD_DBG_VALID) | 710 | if (current->thread.flags & IA64_THREAD_DBG_VALID) |
754 | pfm_release_debug_registers(current); | 711 | pfm_release_debug_registers(current); |
755 | #endif | 712 | #endif |
756 | if (IS_IA32_PROCESS(task_pt_regs(current))) | ||
757 | ia32_drop_ia64_partial_page_list(current); | ||
758 | } | 713 | } |
759 | 714 | ||
760 | unsigned long | 715 | unsigned long |