Lines Matching refs:regs

64 static int save_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs)  in save_arcv2_regs()  argument
70 v2abi.r30 = regs->r30; in save_arcv2_regs()
72 v2abi.r58 = regs->r58; in save_arcv2_regs()
73 v2abi.r59 = regs->r59; in save_arcv2_regs()
82 static int restore_arcv2_regs(struct sigcontext *mctx, struct pt_regs *regs) in restore_arcv2_regs() argument
90 regs->r30 = v2abi.r30; in restore_arcv2_regs()
92 regs->r58 = v2abi.r58; in restore_arcv2_regs()
93 regs->r59 = v2abi.r59; in restore_arcv2_regs()
100 stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs, in stash_usr_regs() argument
106 uregs.scratch.bta = regs->bta; in stash_usr_regs()
107 uregs.scratch.lp_start = regs->lp_start; in stash_usr_regs()
108 uregs.scratch.lp_end = regs->lp_end; in stash_usr_regs()
109 uregs.scratch.lp_count = regs->lp_count; in stash_usr_regs()
110 uregs.scratch.status32 = regs->status32; in stash_usr_regs()
111 uregs.scratch.ret = regs->ret; in stash_usr_regs()
112 uregs.scratch.blink = regs->blink; in stash_usr_regs()
113 uregs.scratch.fp = regs->fp; in stash_usr_regs()
114 uregs.scratch.gp = regs->r26; in stash_usr_regs()
115 uregs.scratch.r12 = regs->r12; in stash_usr_regs()
116 uregs.scratch.r11 = regs->r11; in stash_usr_regs()
117 uregs.scratch.r10 = regs->r10; in stash_usr_regs()
118 uregs.scratch.r9 = regs->r9; in stash_usr_regs()
119 uregs.scratch.r8 = regs->r8; in stash_usr_regs()
120 uregs.scratch.r7 = regs->r7; in stash_usr_regs()
121 uregs.scratch.r6 = regs->r6; in stash_usr_regs()
122 uregs.scratch.r5 = regs->r5; in stash_usr_regs()
123 uregs.scratch.r4 = regs->r4; in stash_usr_regs()
124 uregs.scratch.r3 = regs->r3; in stash_usr_regs()
125 uregs.scratch.r2 = regs->r2; in stash_usr_regs()
126 uregs.scratch.r1 = regs->r1; in stash_usr_regs()
127 uregs.scratch.r0 = regs->r0; in stash_usr_regs()
128 uregs.scratch.sp = regs->sp; in stash_usr_regs()
130 err = __copy_to_user(&(sf->uc.uc_mcontext.regs.scratch), &uregs.scratch, in stash_usr_regs()
131 sizeof(sf->uc.uc_mcontext.regs.scratch)); in stash_usr_regs()
134 err |= save_arcv2_regs(&(sf->uc.uc_mcontext), regs); in stash_usr_regs()
141 static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) in restore_usr_regs() argument
149 &(sf->uc.uc_mcontext.regs.scratch), in restore_usr_regs()
150 sizeof(sf->uc.uc_mcontext.regs.scratch)); in restore_usr_regs()
153 err |= restore_arcv2_regs(&(sf->uc.uc_mcontext), regs); in restore_usr_regs()
159 regs->bta = uregs.scratch.bta; in restore_usr_regs()
160 regs->lp_start = uregs.scratch.lp_start; in restore_usr_regs()
161 regs->lp_end = uregs.scratch.lp_end; in restore_usr_regs()
162 regs->lp_count = uregs.scratch.lp_count; in restore_usr_regs()
163 regs->status32 = uregs.scratch.status32; in restore_usr_regs()
164 regs->ret = uregs.scratch.ret; in restore_usr_regs()
165 regs->blink = uregs.scratch.blink; in restore_usr_regs()
166 regs->fp = uregs.scratch.fp; in restore_usr_regs()
167 regs->r26 = uregs.scratch.gp; in restore_usr_regs()
168 regs->r12 = uregs.scratch.r12; in restore_usr_regs()
169 regs->r11 = uregs.scratch.r11; in restore_usr_regs()
170 regs->r10 = uregs.scratch.r10; in restore_usr_regs()
171 regs->r9 = uregs.scratch.r9; in restore_usr_regs()
172 regs->r8 = uregs.scratch.r8; in restore_usr_regs()
173 regs->r7 = uregs.scratch.r7; in restore_usr_regs()
174 regs->r6 = uregs.scratch.r6; in restore_usr_regs()
175 regs->r5 = uregs.scratch.r5; in restore_usr_regs()
176 regs->r4 = uregs.scratch.r4; in restore_usr_regs()
177 regs->r3 = uregs.scratch.r3; in restore_usr_regs()
178 regs->r2 = uregs.scratch.r2; in restore_usr_regs()
179 regs->r1 = uregs.scratch.r1; in restore_usr_regs()
180 regs->r0 = uregs.scratch.r0; in restore_usr_regs()
181 regs->sp = uregs.scratch.sp; in restore_usr_regs()
198 struct pt_regs *regs = current_pt_regs(); in SYSCALL_DEFINE0() local
207 if (regs->sp & 3) in SYSCALL_DEFINE0()
210 sf = (struct rt_sigframe __force __user *)(regs->sp); in SYSCALL_DEFINE0()
222 if (restore_usr_regs(regs, sf)) in SYSCALL_DEFINE0()
226 syscall_wont_restart(regs); in SYSCALL_DEFINE0()
235 regs->status32 |= STATUS_U_MASK; in SYSCALL_DEFINE0()
237 return regs->r0; in SYSCALL_DEFINE0()
248 struct pt_regs *regs, in get_sigframe() argument
251 unsigned long sp = sigsp(regs->sp, ksig); in get_sigframe()
269 setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) in setup_rt_frame() argument
275 sf = get_sigframe(ksig, regs, sizeof(struct rt_sigframe)); in setup_rt_frame()
286 err |= stash_usr_regs(sf, regs, set); in setup_rt_frame()
298 err |= __save_altstack(&sf->uc.uc_stack, regs->sp); in setup_rt_frame()
301 regs->r1 = (unsigned long)&sf->info; in setup_rt_frame()
302 regs->r2 = (unsigned long)&sf->uc; in setup_rt_frame()
316 regs->r0 = ksig->sig; in setup_rt_frame()
319 regs->ret = (unsigned long)ksig->ka.sa.sa_handler; in setup_rt_frame()
328 regs->blink = (unsigned long)ksig->ka.sa.sa_restorer; in setup_rt_frame()
331 regs->sp = (unsigned long)sf; in setup_rt_frame()
337 regs->status32 &= ~STATUS_DE_MASK; in setup_rt_frame()
338 regs->status32 |= STATUS_L_MASK; in setup_rt_frame()
343 static void arc_restart_syscall(struct k_sigaction *ka, struct pt_regs *regs) in arc_restart_syscall() argument
345 switch (regs->r0) { in arc_restart_syscall()
354 regs->r0 = -EINTR; /* ERESTART_xxx is internal */ in arc_restart_syscall()
364 regs->r0 = -EINTR; in arc_restart_syscall()
380 regs->r0 = regs->orig_r0; in arc_restart_syscall()
381 regs->ret -= is_isa_arcv2() ? 2 : 4; in arc_restart_syscall()
390 handle_signal(struct ksignal *ksig, struct pt_regs *regs) in handle_signal() argument
396 failed = setup_rt_frame(ksig, oldset, regs); in handle_signal()
401 void do_signal(struct pt_regs *regs) in do_signal() argument
406 restart_scall = in_syscall(regs) && syscall_restartable(regs); in do_signal()
410 arc_restart_syscall(&ksig.ka, regs); in do_signal()
411 syscall_wont_restart(regs); /* No more restarts */ in do_signal()
413 handle_signal(&ksig, regs); in do_signal()
419 if (regs->r0 == -ERESTARTNOHAND || in do_signal()
420 regs->r0 == -ERESTARTSYS || regs->r0 == -ERESTARTNOINTR) { in do_signal()
421 regs->r0 = regs->orig_r0; in do_signal()
422 regs->ret -= is_isa_arcv2() ? 2 : 4; in do_signal()
423 } else if (regs->r0 == -ERESTART_RESTARTBLOCK) { in do_signal()
424 regs->r8 = __NR_restart_syscall; in do_signal()
425 regs->ret -= is_isa_arcv2() ? 2 : 4; in do_signal()
427 syscall_wont_restart(regs); /* No more restarts */ in do_signal()
434 void do_notify_resume(struct pt_regs *regs) in do_notify_resume() argument
441 resume_user_mode_work(regs); in do_notify_resume()