Lines Matching full:regs
25 static inline int restore_sigcontext_fpu(struct pt_regs *regs, in restore_sigcontext_fpu() argument
43 disable_ptreg_fpu(regs); in restore_sigcontext_fpu()
47 clear_fpu(regs); in restore_sigcontext_fpu()
54 static inline int setup_sigcontext_fpu(struct pt_regs *regs, in setup_sigcontext_fpu() argument
79 static int restore_sigframe(struct pt_regs *regs, in restore_sigframe() argument
90 __get_user_error(regs->uregs[0], &sf->uc.uc_mcontext.nds32_r0, err); in restore_sigframe()
91 __get_user_error(regs->uregs[1], &sf->uc.uc_mcontext.nds32_r1, err); in restore_sigframe()
92 __get_user_error(regs->uregs[2], &sf->uc.uc_mcontext.nds32_r2, err); in restore_sigframe()
93 __get_user_error(regs->uregs[3], &sf->uc.uc_mcontext.nds32_r3, err); in restore_sigframe()
94 __get_user_error(regs->uregs[4], &sf->uc.uc_mcontext.nds32_r4, err); in restore_sigframe()
95 __get_user_error(regs->uregs[5], &sf->uc.uc_mcontext.nds32_r5, err); in restore_sigframe()
96 __get_user_error(regs->uregs[6], &sf->uc.uc_mcontext.nds32_r6, err); in restore_sigframe()
97 __get_user_error(regs->uregs[7], &sf->uc.uc_mcontext.nds32_r7, err); in restore_sigframe()
98 __get_user_error(regs->uregs[8], &sf->uc.uc_mcontext.nds32_r8, err); in restore_sigframe()
99 __get_user_error(regs->uregs[9], &sf->uc.uc_mcontext.nds32_r9, err); in restore_sigframe()
100 __get_user_error(regs->uregs[10], &sf->uc.uc_mcontext.nds32_r10, err); in restore_sigframe()
101 __get_user_error(regs->uregs[11], &sf->uc.uc_mcontext.nds32_r11, err); in restore_sigframe()
102 __get_user_error(regs->uregs[12], &sf->uc.uc_mcontext.nds32_r12, err); in restore_sigframe()
103 __get_user_error(regs->uregs[13], &sf->uc.uc_mcontext.nds32_r13, err); in restore_sigframe()
104 __get_user_error(regs->uregs[14], &sf->uc.uc_mcontext.nds32_r14, err); in restore_sigframe()
105 __get_user_error(regs->uregs[15], &sf->uc.uc_mcontext.nds32_r15, err); in restore_sigframe()
106 __get_user_error(regs->uregs[16], &sf->uc.uc_mcontext.nds32_r16, err); in restore_sigframe()
107 __get_user_error(regs->uregs[17], &sf->uc.uc_mcontext.nds32_r17, err); in restore_sigframe()
108 __get_user_error(regs->uregs[18], &sf->uc.uc_mcontext.nds32_r18, err); in restore_sigframe()
109 __get_user_error(regs->uregs[19], &sf->uc.uc_mcontext.nds32_r19, err); in restore_sigframe()
110 __get_user_error(regs->uregs[20], &sf->uc.uc_mcontext.nds32_r20, err); in restore_sigframe()
111 __get_user_error(regs->uregs[21], &sf->uc.uc_mcontext.nds32_r21, err); in restore_sigframe()
112 __get_user_error(regs->uregs[22], &sf->uc.uc_mcontext.nds32_r22, err); in restore_sigframe()
113 __get_user_error(regs->uregs[23], &sf->uc.uc_mcontext.nds32_r23, err); in restore_sigframe()
114 __get_user_error(regs->uregs[24], &sf->uc.uc_mcontext.nds32_r24, err); in restore_sigframe()
115 __get_user_error(regs->uregs[25], &sf->uc.uc_mcontext.nds32_r25, err); in restore_sigframe()
117 __get_user_error(regs->fp, &sf->uc.uc_mcontext.nds32_fp, err); in restore_sigframe()
118 __get_user_error(regs->gp, &sf->uc.uc_mcontext.nds32_gp, err); in restore_sigframe()
119 __get_user_error(regs->lp, &sf->uc.uc_mcontext.nds32_lp, err); in restore_sigframe()
120 __get_user_error(regs->sp, &sf->uc.uc_mcontext.nds32_sp, err); in restore_sigframe()
121 __get_user_error(regs->ipc, &sf->uc.uc_mcontext.nds32_ipc, err); in restore_sigframe()
123 __get_user_error(regs->lc, &sf->uc.uc_mcontext.zol.nds32_lc, err); in restore_sigframe()
124 __get_user_error(regs->le, &sf->uc.uc_mcontext.zol.nds32_le, err); in restore_sigframe()
125 __get_user_error(regs->lb, &sf->uc.uc_mcontext.zol.nds32_lb, err); in restore_sigframe()
128 err |= restore_sigcontext_fpu(regs, &sf->uc.uc_mcontext); in restore_sigframe()
133 forget_syscall(regs); in restore_sigframe()
137 asmlinkage long sys_rt_sigreturn(struct pt_regs *regs) in sys_rt_sigreturn() argument
149 if (regs->sp & 7) in sys_rt_sigreturn()
152 frame = (struct rt_sigframe __user *)regs->sp; in sys_rt_sigreturn()
157 if (restore_sigframe(regs, frame)) in sys_rt_sigreturn()
163 return regs->uregs[0]; in sys_rt_sigreturn()
171 setup_sigframe(struct rt_sigframe __user * sf, struct pt_regs *regs, in setup_sigframe() argument
176 __put_user_error(regs->uregs[0], &sf->uc.uc_mcontext.nds32_r0, err); in setup_sigframe()
177 __put_user_error(regs->uregs[1], &sf->uc.uc_mcontext.nds32_r1, err); in setup_sigframe()
178 __put_user_error(regs->uregs[2], &sf->uc.uc_mcontext.nds32_r2, err); in setup_sigframe()
179 __put_user_error(regs->uregs[3], &sf->uc.uc_mcontext.nds32_r3, err); in setup_sigframe()
180 __put_user_error(regs->uregs[4], &sf->uc.uc_mcontext.nds32_r4, err); in setup_sigframe()
181 __put_user_error(regs->uregs[5], &sf->uc.uc_mcontext.nds32_r5, err); in setup_sigframe()
182 __put_user_error(regs->uregs[6], &sf->uc.uc_mcontext.nds32_r6, err); in setup_sigframe()
183 __put_user_error(regs->uregs[7], &sf->uc.uc_mcontext.nds32_r7, err); in setup_sigframe()
184 __put_user_error(regs->uregs[8], &sf->uc.uc_mcontext.nds32_r8, err); in setup_sigframe()
185 __put_user_error(regs->uregs[9], &sf->uc.uc_mcontext.nds32_r9, err); in setup_sigframe()
186 __put_user_error(regs->uregs[10], &sf->uc.uc_mcontext.nds32_r10, err); in setup_sigframe()
187 __put_user_error(regs->uregs[11], &sf->uc.uc_mcontext.nds32_r11, err); in setup_sigframe()
188 __put_user_error(regs->uregs[12], &sf->uc.uc_mcontext.nds32_r12, err); in setup_sigframe()
189 __put_user_error(regs->uregs[13], &sf->uc.uc_mcontext.nds32_r13, err); in setup_sigframe()
190 __put_user_error(regs->uregs[14], &sf->uc.uc_mcontext.nds32_r14, err); in setup_sigframe()
191 __put_user_error(regs->uregs[15], &sf->uc.uc_mcontext.nds32_r15, err); in setup_sigframe()
192 __put_user_error(regs->uregs[16], &sf->uc.uc_mcontext.nds32_r16, err); in setup_sigframe()
193 __put_user_error(regs->uregs[17], &sf->uc.uc_mcontext.nds32_r17, err); in setup_sigframe()
194 __put_user_error(regs->uregs[18], &sf->uc.uc_mcontext.nds32_r18, err); in setup_sigframe()
195 __put_user_error(regs->uregs[19], &sf->uc.uc_mcontext.nds32_r19, err); in setup_sigframe()
196 __put_user_error(regs->uregs[20], &sf->uc.uc_mcontext.nds32_r20, err); in setup_sigframe()
198 __put_user_error(regs->uregs[21], &sf->uc.uc_mcontext.nds32_r21, err); in setup_sigframe()
199 __put_user_error(regs->uregs[22], &sf->uc.uc_mcontext.nds32_r22, err); in setup_sigframe()
200 __put_user_error(regs->uregs[23], &sf->uc.uc_mcontext.nds32_r23, err); in setup_sigframe()
201 __put_user_error(regs->uregs[24], &sf->uc.uc_mcontext.nds32_r24, err); in setup_sigframe()
202 __put_user_error(regs->uregs[25], &sf->uc.uc_mcontext.nds32_r25, err); in setup_sigframe()
203 __put_user_error(regs->fp, &sf->uc.uc_mcontext.nds32_fp, err); in setup_sigframe()
204 __put_user_error(regs->gp, &sf->uc.uc_mcontext.nds32_gp, err); in setup_sigframe()
205 __put_user_error(regs->lp, &sf->uc.uc_mcontext.nds32_lp, err); in setup_sigframe()
206 __put_user_error(regs->sp, &sf->uc.uc_mcontext.nds32_sp, err); in setup_sigframe()
207 __put_user_error(regs->ipc, &sf->uc.uc_mcontext.nds32_ipc, err); in setup_sigframe()
209 __put_user_error(regs->lc, &sf->uc.uc_mcontext.zol.nds32_lc, err); in setup_sigframe()
210 __put_user_error(regs->le, &sf->uc.uc_mcontext.zol.nds32_le, err); in setup_sigframe()
211 __put_user_error(regs->lb, &sf->uc.uc_mcontext.zol.nds32_lb, err); in setup_sigframe()
214 err |= setup_sigcontext_fpu(regs, &sf->uc.uc_mcontext); in setup_sigframe()
231 struct pt_regs *regs, int framesize) in get_sigframe() argument
236 sp = regs->sp; in get_sigframe()
257 setup_return(struct pt_regs *regs, struct ksignal *ksig, void __user * frame) in setup_return() argument
263 regs->uregs[0] = ksig->sig; in setup_return()
264 regs->sp = (unsigned long)frame; in setup_return()
265 regs->lp = retcode; in setup_return()
266 regs->ipc = handler; in setup_return()
272 setup_rt_frame(struct ksignal *ksig, sigset_t * set, struct pt_regs *regs) in setup_rt_frame() argument
275 get_sigframe(ksig, regs, sizeof(*frame)); in setup_rt_frame()
284 err |= __save_altstack(&frame->uc.uc_stack, regs->sp); in setup_rt_frame()
285 err |= setup_sigframe(frame, regs, set); in setup_rt_frame()
287 setup_return(regs, ksig, frame); in setup_rt_frame()
290 regs->uregs[1] = (unsigned long)&frame->info; in setup_rt_frame()
291 regs->uregs[2] = (unsigned long)&frame->uc; in setup_rt_frame()
300 static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) in handle_signal() argument
305 if (in_syscall(regs)) { in handle_signal()
307 forget_syscall(regs); in handle_signal()
309 switch (regs->uregs[0]) { in handle_signal()
312 regs->uregs[0] = -EINTR; in handle_signal()
316 regs->uregs[0] = -EINTR; in handle_signal()
321 regs->uregs[0] = regs->orig_r0; in handle_signal()
322 regs->ipc -= 4; in handle_signal()
329 ret = setup_rt_frame(ksig, oldset, regs); in handle_signal()
343 static void do_signal(struct pt_regs *regs) in do_signal() argument
348 handle_signal(&ksig, regs); in do_signal()
355 if (in_syscall(regs)) { in do_signal()
359 forget_syscall(regs); in do_signal()
361 switch (regs->uregs[0]) { in do_signal()
363 regs->uregs[15] = __NR_restart_syscall; in do_signal()
368 regs->uregs[0] = regs->orig_r0; in do_signal()
369 regs->ipc -= 0x4; in do_signal()
377 do_notify_resume(struct pt_regs *regs, unsigned int thread_flags) in do_notify_resume() argument
380 do_signal(regs); in do_notify_resume()
383 tracehook_notify_resume(regs); in do_notify_resume()