Lines Matching full:regs
28 static void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs, in get_sigframe() argument
31 unsigned long sp = sigsp(regs->r29, ksig); in get_sigframe()
36 static int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) in setup_sigcontext() argument
41 err |= copy_to_user(&sc->sc_regs.r0, ®s->r00, in setup_sigcontext()
44 err |= __put_user(regs->sa0, &sc->sc_regs.sa0); in setup_sigcontext()
45 err |= __put_user(regs->lc0, &sc->sc_regs.lc0); in setup_sigcontext()
46 err |= __put_user(regs->sa1, &sc->sc_regs.sa1); in setup_sigcontext()
47 err |= __put_user(regs->lc1, &sc->sc_regs.lc1); in setup_sigcontext()
48 err |= __put_user(regs->m0, &sc->sc_regs.m0); in setup_sigcontext()
49 err |= __put_user(regs->m1, &sc->sc_regs.m1); in setup_sigcontext()
50 err |= __put_user(regs->usr, &sc->sc_regs.usr); in setup_sigcontext()
51 err |= __put_user(regs->preds, &sc->sc_regs.p3_0); in setup_sigcontext()
52 err |= __put_user(regs->gp, &sc->sc_regs.gp); in setup_sigcontext()
53 err |= __put_user(regs->ugp, &sc->sc_regs.ugp); in setup_sigcontext()
55 err |= __put_user(regs->cs0, &sc->sc_regs.cs0); in setup_sigcontext()
56 err |= __put_user(regs->cs1, &sc->sc_regs.cs1); in setup_sigcontext()
58 tmp = pt_elr(regs); err |= __put_user(tmp, &sc->sc_regs.pc); in setup_sigcontext()
59 tmp = pt_cause(regs); err |= __put_user(tmp, &sc->sc_regs.cause); in setup_sigcontext()
60 tmp = pt_badva(regs); err |= __put_user(tmp, &sc->sc_regs.badva); in setup_sigcontext()
65 static int restore_sigcontext(struct pt_regs *regs, in restore_sigcontext() argument
71 err |= copy_from_user(®s->r00, &sc->sc_regs.r0, in restore_sigcontext()
74 err |= __get_user(regs->sa0, &sc->sc_regs.sa0); in restore_sigcontext()
75 err |= __get_user(regs->lc0, &sc->sc_regs.lc0); in restore_sigcontext()
76 err |= __get_user(regs->sa1, &sc->sc_regs.sa1); in restore_sigcontext()
77 err |= __get_user(regs->lc1, &sc->sc_regs.lc1); in restore_sigcontext()
78 err |= __get_user(regs->m0, &sc->sc_regs.m0); in restore_sigcontext()
79 err |= __get_user(regs->m1, &sc->sc_regs.m1); in restore_sigcontext()
80 err |= __get_user(regs->usr, &sc->sc_regs.usr); in restore_sigcontext()
81 err |= __get_user(regs->preds, &sc->sc_regs.p3_0); in restore_sigcontext()
82 err |= __get_user(regs->gp, &sc->sc_regs.gp); in restore_sigcontext()
83 err |= __get_user(regs->ugp, &sc->sc_regs.ugp); in restore_sigcontext()
85 err |= __get_user(regs->cs0, &sc->sc_regs.cs0); in restore_sigcontext()
86 err |= __get_user(regs->cs1, &sc->sc_regs.cs1); in restore_sigcontext()
88 err |= __get_user(tmp, &sc->sc_regs.pc); pt_set_elr(regs, tmp); in restore_sigcontext()
97 struct pt_regs *regs) in setup_rt_frame() argument
103 frame = get_sigframe(ksig, regs, sizeof(struct rt_sigframe)); in setup_rt_frame()
117 err |= setup_sigcontext(regs, &frame->uc.uc_mcontext); in setup_rt_frame()
119 err |= __save_altstack(&frame->uc.uc_stack, user_stack_pointer(regs)); in setup_rt_frame()
124 regs->r0100 = ((unsigned long long)((unsigned long)&frame->info) << 32) in setup_rt_frame()
126 regs->r02 = (unsigned long) &frame->uc; in setup_rt_frame()
127 regs->r31 = (unsigned long) vdso->rt_signal_trampoline; in setup_rt_frame()
128 pt_psp(regs) = (unsigned long) frame; in setup_rt_frame()
129 pt_set_elr(regs, (unsigned long)ksig->ka.sa.sa_handler); in setup_rt_frame()
137 static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) in handle_signal() argument
147 if (regs->syscall_nr >= 0) { in handle_signal()
148 switch (regs->r00) { in handle_signal()
151 regs->r00 = -EINTR; in handle_signal()
155 regs->r00 = -EINTR; in handle_signal()
160 regs->r06 = regs->syscall_nr; in handle_signal()
161 pt_set_elr(regs, pt_elr(regs) - 4); in handle_signal()
162 regs->r00 = regs->restart_r0; in handle_signal()
174 ret = setup_rt_frame(ksig, sigmask_to_save(), regs); in handle_signal()
182 void do_signal(struct pt_regs *regs) in do_signal() argument
186 if (!user_mode(regs)) in do_signal()
190 handle_signal(&ksig, regs); in do_signal()
198 if (regs->syscall_nr >= 0) { in do_signal()
199 switch (regs->r00) { in do_signal()
203 regs->r06 = regs->syscall_nr; in do_signal()
206 regs->r06 = __NR_restart_syscall; in do_signal()
211 pt_set_elr(regs, pt_elr(regs) - 4); in do_signal()
212 regs->r00 = regs->restart_r0; in do_signal()
226 struct pt_regs *regs = current_pt_regs(); in sys_rt_sigreturn() local
233 frame = (struct rt_sigframe __user *)pt_psp(regs); in sys_rt_sigreturn()
241 if (restore_sigcontext(regs, &frame->uc.uc_mcontext)) in sys_rt_sigreturn()
245 pt_psp(regs) = regs->r29; in sys_rt_sigreturn()
247 regs->syscall_nr = -1; in sys_rt_sigreturn()
252 return regs->r00; in sys_rt_sigreturn()