Lines Matching refs:regs

38 asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs);
40 asmlinkage int do_work_pending(struct pt_regs *regs, unsigned int thread_flags,
74 static int restore_sigcontext(struct pt_regs *regs,
83 * Restore the regs from &sc->regs.
87 err |= __copy_from_user(regs, sc->regs.gpr, 32 * sizeof(unsigned long));
88 err |= __copy_from_user(&regs->pc, &sc->regs.pc, sizeof(unsigned long));
89 err |= __copy_from_user(&regs->sr, &sc->regs.sr, sizeof(unsigned long));
93 regs->sr &= ~SPR_SR_SM;
95 regs->orig_gpr11 = -1; /* Avoid syscall restart checks */
97 /* TODO: the other ports use regs->orig_XX to disable syscall checks
105 asmlinkage long _sys_rt_sigreturn(struct pt_regs *regs)
107 struct rt_sigframe __user *frame = (struct rt_sigframe __user *)regs->sp;
125 if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
131 return regs->gpr[11];
142 static int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
146 /* copy the regs */
150 err |= __copy_to_user(sc->regs.gpr, regs, 32 * sizeof(unsigned long));
151 err |= __copy_to_user(&sc->regs.pc, &regs->pc, sizeof(unsigned long));
152 err |= __copy_to_user(&sc->regs.sr, &regs->sr, sizeof(unsigned long));
169 struct pt_regs *regs, size_t frame_size)
171 unsigned long sp = regs->sp;
189 struct pt_regs *regs)
195 frame = get_sigframe(ksig, regs, sizeof(*frame));
207 err |= __save_altstack(&frame->uc.uc_stack, regs->sp);
208 err |= setup_sigcontext(regs, &frame->uc.uc_mcontext);
230 regs->pc = (unsigned long)ksig->ka.sa.sa_handler; /* what we enter NOW */
231 regs->gpr[9] = (unsigned long)return_ip; /* what we enter LATER */
232 regs->gpr[3] = (unsigned long)ksig->sig; /* arg 1: signo */
233 regs->gpr[4] = (unsigned long)&frame->info; /* arg 2: (siginfo_t*) */
234 regs->gpr[5] = (unsigned long)&frame->uc; /* arg 3: ucontext */
237 regs->sp = (unsigned long)frame;
243 handle_signal(struct ksignal *ksig, struct pt_regs *regs)
247 ret = setup_rt_frame(ksig, sigmask_to_save(), regs);
257 * Also note that the regs structure given here as an argument, is the latest
260 * we can use user_mode(regs) to see if we came directly from kernel or user
264 static int do_signal(struct pt_regs *regs, int syscall)
273 continue_addr = regs->pc;
275 retval = regs->gpr[11];
289 regs->gpr[11] = regs->orig_gpr11;
290 regs->pc = restart_addr;
302 if (unlikely(restart) && regs->pc == restart_addr) {
308 regs->gpr[11] = -EINTR;
309 regs->pc = continue_addr;
312 handle_signal(&ksig, regs);
320 if (unlikely(restart) && regs->pc == restart_addr) {
321 regs->pc = continue_addr;
330 do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall)
336 if (unlikely(!user_mode(regs)))
340 int restart = do_signal(regs, syscall);
351 resume_user_mode_work(regs);