 /* Make sure signal handler doesn't get spurious FP exceptions */ current->thread.fpscr.val = 0; 
static int setup_rt_frame(int signr, struct k_sigaction *ka, siginfo_t *info,		sigset_t *set, struct pt_regs *regs){	/* Handler is *really* a pointer to the function descriptor for	 * the signal routine.  The first entry in the function	 * descriptor is the entry address of signal and the second	 * entry is the TOC value we need to use.	 */	func_descr_t __user *funct_desc_ptr;	struct rt_sigframe __user *frame;	unsigned long newsp = 0;	long err = 0;	frame = get_sigframe(ka, regs, sizeof(*frame));	if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))		goto badframe;	err |= __put_user(&frame->info, &frame->pinfo);	err |= __put_user(&frame->uc, &frame->puc);	err |= copy_siginfo_to_user(&frame->info, info);	if (err)		goto badframe;	/* Create the ucontext.  */	err |= __put_user(0, &frame->uc.uc_flags);	err |= __put_user(0, &frame->uc.uc_link);	err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp);	err |= __put_user(sas_ss_flags(regs->gpr[1]),			  &frame->uc.uc_stack.ss_flags);	err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size);	err |= setup_sigcontext(&frame->uc.uc_mcontext, regs, signr, NULL,				(unsigned long)ka->sa.sa_handler);	err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));	if (err)		goto badframe;	/* Set up to return from userspace. */	if (vdso64_rt_sigtramp && current->thread.vdso_base) {		regs->link = current->thread.vdso_base + vdso64_rt_sigtramp;	} else {		err |= setup_trampoline(__NR_rt_sigreturn, &frame->tramp[0]);		if (err)			goto badframe;		regs->link = (unsigned long) &frame->tramp[0];	}	funct_desc_ptr = (func_descr_t __user *) ka->sa.sa_handler;	/* Allocate a dummy caller frame for the signal handler. */	newsp = (unsigned long)frame - __SIGNAL_FRAMESIZE;	err |= put_user(regs->gpr[1], (unsigned long __user *)newsp);	/* Set up "regs" so we "return" to the signal handler. */	err |= get_user(regs->nip, &funct_desc_ptr->entry);	regs->gpr[1] = newsp;	err |= get_user(regs->gpr[2], &funct_desc_ptr->toc);	regs->gpr[3] = signr;	regs->result = 0;	if (ka->sa.sa_flags & SA_SIGINFO) {		err |= get_user(regs->gpr[4], (unsigned long __user *)&frame->pinfo);		err |= get_user(regs->gpr[5], (unsigned long __user *)&frame->puc);		regs->gpr[6] = (unsigned long) frame;	} else {		regs->gpr[4] = (unsigned long)&frame->uc.uc_mcontext;	}	if (err)		goto badframe;	if (test_thread_flag(TIF_SINGLESTEP))		ptrace_notify(SIGTRAP);	return 1;badframe:#if DEBUG_SIG	printk("badframe in setup_rt_frame, regs=%p frame=%p newsp=%lx\n",	       regs, frame, newsp);#endif	force_sigsegv(signr, current);	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/cc657f53928997c65bf2409c45166c6ceee8d306/signal_64.c/buggy/arch/powerpc/kernel/signal_64.c