Message-ID: <20000110120653.16499.qmail@web1901.mail.yahoo.com> Date: Mon, 10 Jan 2000 04:06:53 -0800 (PST) From: jc duyrat Subject: help on copy_thread To: linuxppc-dev@lists.linuxppc.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Sender: owner-linuxppc-dev@lists.linuxppc.org List-Id: hy everybody,

I have a question about copy_thread in
arch/ppc/kernel/process.c (linux ver 2.2.13, 2.3.34 and others..):
why don't we want to execute
childregs->gpr[2] = (unsigned long) p;
when we are forking a process user ?
What is the purpose of keeping the father's tss in childregs->gpr[2] ?

thank you for your help.

JC

copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
struct task_struct * p, struct pt_regs *regs)
{
struct pt_regs * childregs, *kregs;
#ifdef __SMP__
extern void ret_from_smpfork(void);
#else
extern void ret_from_syscall(void);
#endif
/* Copy registers */
childregs = ((struct pt_regs *)
((unsigned long)p + sizeof(union task_union)
- STACK_FRAME_OVERHEAD)) - 2;
*childregs = *regs;
if ((childregs->msr & MSR_PR) == 0)
childregs->gpr[2] = (unsigned long) p;
.... ** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/