Name: do_fork ia64 cleanup Author: Kimio Suganama Status: Tested on 2.5.14 D: This patch updates ia64 for the do-fork change. diff -Nur linux-2.5.14-base/arch/ia64/kernel/entry.S linux-2.5.14-new/arch/ia64/kernel/entry.S --- linux-2.5.14-base/arch/ia64/kernel/entry.S Sun May 5 20:37:57 2002 +++ linux-2.5.14-new/arch/ia64/kernel/entry.S Tue May 14 14:26:19 2002 @@ -102,7 +102,14 @@ adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = ®s mov out0=in0 // out0 = clone_flags br.call.sptk.many rp=do_fork -.ret1: .restore sp +.ret1: mov r14=r8 + mov r15=-1000 + ;; + cmp.ltu p6,p7=r15,r14 + adds r16=IA64_TASK_PID_OFFSET,r14 + ;; +(p7) ld4 r8=[r16] + .restore sp adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack mov ar.pfs=loc1 mov rp=loc0 @@ -121,7 +128,14 @@ adds out2=IA64_SWITCH_STACK_SIZE+16,sp // out2 = ®s mov out0=in0 // out0 = clone_flags br.call.sptk.many rp=do_fork -.ret2: .restore sp +.ret2: mov r14=r8 + mov r15=-1000 + ;; + cmp.ltu p6,p7=r15,r14 + adds r16=IA64_TASK_PID_OFFSET,r14 + ;; +(p7) ld4 r8=[r16] + .restore sp adds sp=IA64_SWITCH_STACK_SIZE,sp // pop the switch stack mov ar.pfs=loc1 mov rp=loc0 diff -Nur linux-2.5.14-base/arch/ia64/kernel/smpboot.c linux-2.5.14-new/arch/ia64/kernel/smpboot.c --- linux-2.5.14-base/arch/ia64/kernel/smpboot.c Tue May 14 14:25:07 2002 +++ linux-2.5.14-new/arch/ia64/kernel/smpboot.c Tue May 14 14:26:19 2002 @@ -391,7 +391,7 @@ return cpu_idle(); } -static int __init +static struct task_struct * __init fork_by_hand (void) { /* @@ -412,17 +412,14 @@ * We can't use kernel_thread since we must avoid to * reschedule the child. */ - if (fork_by_hand() < 0) + idle = fork_by_hand(); + if (IS_ERR(idle)) panic("failed fork for CPU %d", cpu); /* * We remove it from the pidhash and the runqueue * once we got the process: */ - idle = prev_task(&init_task); - if (!idle) - panic("No idle process for CPU %d", cpu); - init_idle(idle, cpu); ia64_cpu_to_sapicid[cpu] = sapicid; diff -Nur linux-2.5.14-base/arch/ia64/tools/print_offsets.c linux-2.5.14-new/arch/ia64/tools/print_offsets.c --- linux-2.5.14-base/arch/ia64/tools/print_offsets.c Sun May 5 20:38:05 2002 +++ linux-2.5.14-new/arch/ia64/tools/print_offsets.c Tue May 14 14:26:19 2002 @@ -163,6 +163,7 @@ { "IA64_SIGFRAME_SIGCONTEXT_OFFSET", offsetof (struct sigframe, sc) }, { "IA64_CLONE_VFORK", CLONE_VFORK }, { "IA64_CLONE_VM", CLONE_VM }, + { "IA64_TASK_PID_OFFSET", offsetof (struct task_struct, pid) }, }; static const char *tabs = "\t\t\t\t\t\t\t\t\t\t";