 #ifdef CONFIG_DEBUG_SPINLOCK p->thread.smp_lock_count = 0; p->thread.smp_lock_pc = 0; #endif 
int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,		unsigned long unused,		struct task_struct *p, struct pt_regs *regs){	struct thread_info *t = p->thread_info;	char *child_trap_frame;#ifdef CONFIG_DEBUG_SPINLOCK	p->thread.smp_lock_count = 0;	p->thread.smp_lock_pc = 0;#endif	/* Calculate offset to stack_frame & pt_regs */	child_trap_frame = ((char *)t) + (THREAD_SIZE - (TRACEREG_SZ+STACKFRAME_SZ));	memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ));	t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) |		(((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT);	t->new_child = 1;	t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS;	t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf));	t->fpsaved[0] = 0;	if (regs->tstate & TSTATE_PRIV) {		/* Special case, if we are spawning a kernel thread from		 * a userspace task (via KMOD, NFS, or similar) we must		 * disable performance counters in the child because the		 * address space and protection realm are changing.		 */		if (t->flags & _TIF_PERFCTR) {			t->user_cntd0 = t->user_cntd1 = NULL;			t->pcr_reg = 0;			t->flags &= ~_TIF_PERFCTR;		}		t->kregs->u_regs[UREG_FP] = t->ksp;		t->flags |= ((long)ASI_P << TI_FLAG_CURRENT_DS_SHIFT);		flush_register_windows();		memcpy((void *)(t->ksp + STACK_BIAS),		       (void *)(regs->u_regs[UREG_FP] + STACK_BIAS),		       sizeof(struct sparc_stackf));		t->kregs->u_regs[UREG_G6] = (unsigned long) t;		t->kregs->u_regs[UREG_G4] = (unsigned long) t->task;	} else {		if (t->flags & _TIF_32BIT) {			sp &= 0x00000000ffffffffUL;			regs->u_regs[UREG_FP] &= 0x00000000ffffffffUL;		}		t->kregs->u_regs[UREG_FP] = sp;		t->flags |= ((long)ASI_AIUS << TI_FLAG_CURRENT_DS_SHIFT);		if (sp != regs->u_regs[UREG_FP]) {			unsigned long csp;			csp = clone_stackframe(sp, regs->u_regs[UREG_FP]);			if (!csp)				return -EFAULT;			t->kregs->u_regs[UREG_FP] = csp;		}		if (t->utraps)			t->utraps[0]++;	}	/* Set the return value for the child. */	t->kregs->u_regs[UREG_I0] = current->pid;	t->kregs->u_regs[UREG_I1] = 1;	/* Set the second return value for the parent. */	regs->u_regs[UREG_I1] = 0;	if (clone_flags & CLONE_SETTLS)		t->kregs->u_regs[UREG_G7] = regs->u_regs[UREG_I3];	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/fb1c8f93d869b34cacb8b8932e2b83d96a19d720/process.c/clean/arch/sparc64/kernel/process.c