unsigned long psr, ec, lc, rnat, bsp, cfm, nat_bits, val = 0; 
unsigned long psr, rsc, ec, lc, rnat, bsp, cfm, nat_bits, val = 0; 
ptrace_setregs (struct task_struct *child, struct pt_all_user_regs __user *ppr){	unsigned long psr, ec, lc, rnat, bsp, cfm, nat_bits, val = 0;	struct unw_frame_info info;	struct switch_stack *sw;	struct ia64_fpreg fpval;	struct pt_regs *pt;	long ret, retval = 0;	int i;	memset(&fpval, 0, sizeof(fpval));	if (!access_ok(VERIFY_READ, ppr, sizeof(struct pt_all_user_regs)))		return -EIO;	pt = ia64_task_regs(child);	sw = (struct switch_stack *) (child->thread.ksp + 16);	unw_init_from_blocked_task(&info, child);	if (unw_unwind_to_user(&info) < 0) {		return -EIO;	}	if (((unsigned long) ppr & 0x7) != 0) {		dprintk("ptrace:unaligned register address %p\n", ppr);		return -EIO;	}	/* control regs */	retval |= __get_user(pt->cr_iip, &ppr->cr_iip);	retval |= __get_user(psr, &ppr->cr_ipsr);	/* app regs */	retval |= __get_user(pt->ar_pfs, &ppr->ar[PT_AUR_PFS]);	retval |= __get_user(pt->ar_rsc, &ppr->ar[PT_AUR_RSC]);	retval |= __get_user(pt->ar_bspstore, &ppr->ar[PT_AUR_BSPSTORE]);	retval |= __get_user(pt->ar_unat, &ppr->ar[PT_AUR_UNAT]);	retval |= __get_user(pt->ar_ccv, &ppr->ar[PT_AUR_CCV]);	retval |= __get_user(pt->ar_fpsr, &ppr->ar[PT_AUR_FPSR]);	retval |= __get_user(ec, &ppr->ar[PT_AUR_EC]);	retval |= __get_user(lc, &ppr->ar[PT_AUR_LC]);	retval |= __get_user(rnat, &ppr->ar[PT_AUR_RNAT]);	retval |= __get_user(bsp, &ppr->ar[PT_AUR_BSP]);	retval |= __get_user(cfm, &ppr->cfm);	/* gr1-gr3 */	retval |= __copy_from_user(&pt->r1, &ppr->gr[1], sizeof(long));	retval |= __copy_from_user(&pt->r2, &ppr->gr[2], sizeof(long) * 2);	/* gr4-gr7 */	for (i = 4; i < 8; i++) {		retval |= __get_user(val, &ppr->gr[i]);		/* NaT bit will be set via PT_NAT_BITS: */		if (unw_set_gr(&info, i, val, 0) < 0)			return -EIO;	}	/* gr8-gr11 */	retval |= __copy_from_user(&pt->r8, &ppr->gr[8], sizeof(long) * 4);	/* gr12-gr15 */	retval |= __copy_from_user(&pt->r12, &ppr->gr[12], sizeof(long) * 2);	retval |= __copy_from_user(&pt->r14, &ppr->gr[14], sizeof(long));	retval |= __copy_from_user(&pt->r15, &ppr->gr[15], sizeof(long));	/* gr16-gr31 */	retval |= __copy_from_user(&pt->r16, &ppr->gr[16], sizeof(long) * 16);	/* b0 */	retval |= __get_user(pt->b0, &ppr->br[0]);	/* b1-b5 */	for (i = 1; i < 6; i++) {		retval |= __get_user(val, &ppr->br[i]);		unw_set_br(&info, i, val);	}	/* b6-b7 */	retval |= __get_user(pt->b6, &ppr->br[6]);	retval |= __get_user(pt->b7, &ppr->br[7]);	/* fr2-fr5 */	for (i = 2; i < 6; i++) {		retval |= __copy_from_user(&fpval, &ppr->fr[i], sizeof(fpval));		if (unw_set_fr(&info, i, fpval) < 0)			return -EIO;	}	/* fr6-fr11 */	retval |= __copy_from_user(&pt->f6, &ppr->fr[6],				   sizeof(ppr->fr[6]) * 6);	/* fp scratch regs(12-15) */	retval |= __copy_from_user(&sw->f12, &ppr->fr[12],				   sizeof(ppr->fr[12]) * 4);	/* fr16-fr31 */	for (i = 16; i < 32; i++) {		retval |= __copy_from_user(&fpval, &ppr->fr[i],					   sizeof(fpval));		if (unw_set_fr(&info, i, fpval) < 0)			return -EIO;	}	/* fph */	ia64_sync_fph(child);	retval |= __copy_from_user(&child->thread.fph, &ppr->fr[32],				   sizeof(ppr->fr[32]) * 96);	/* preds */	retval |= __get_user(pt->pr, &ppr->pr);	/* nat bits */	retval |= __get_user(nat_bits, &ppr->nat);	retval |= access_uarea(child, PT_CR_IPSR, &psr, 1);	retval |= access_uarea(child, PT_AR_EC, &ec, 1);	retval |= access_uarea(child, PT_AR_LC, &lc, 1);	retval |= access_uarea(child, PT_AR_RNAT, &rnat, 1);	retval |= access_uarea(child, PT_AR_BSP, &bsp, 1);	retval |= access_uarea(child, PT_CFM, &cfm, 1);	retval |= access_uarea(child, PT_NAT_BITS, &nat_bits, 1);	ret = retval ? -EIO : 0;	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/4ea78729b8dbfc400fe165a57b90a394a7275a54/ptrace.c/clean/arch/ia64/kernel/ptrace.c