Lines Matching full:regs
23 * -In stash_usr_regs( ) and restore_usr_regs( ), save/restore of user regs
65 stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs, in stash_usr_regs() argument
71 uregs.scratch.bta = regs->bta; in stash_usr_regs()
72 uregs.scratch.lp_start = regs->lp_start; in stash_usr_regs()
73 uregs.scratch.lp_end = regs->lp_end; in stash_usr_regs()
74 uregs.scratch.lp_count = regs->lp_count; in stash_usr_regs()
75 uregs.scratch.status32 = regs->status32; in stash_usr_regs()
76 uregs.scratch.ret = regs->ret; in stash_usr_regs()
77 uregs.scratch.blink = regs->blink; in stash_usr_regs()
78 uregs.scratch.fp = regs->fp; in stash_usr_regs()
79 uregs.scratch.gp = regs->r26; in stash_usr_regs()
80 uregs.scratch.r12 = regs->r12; in stash_usr_regs()
81 uregs.scratch.r11 = regs->r11; in stash_usr_regs()
82 uregs.scratch.r10 = regs->r10; in stash_usr_regs()
83 uregs.scratch.r9 = regs->r9; in stash_usr_regs()
84 uregs.scratch.r8 = regs->r8; in stash_usr_regs()
85 uregs.scratch.r7 = regs->r7; in stash_usr_regs()
86 uregs.scratch.r6 = regs->r6; in stash_usr_regs()
87 uregs.scratch.r5 = regs->r5; in stash_usr_regs()
88 uregs.scratch.r4 = regs->r4; in stash_usr_regs()
89 uregs.scratch.r3 = regs->r3; in stash_usr_regs()
90 uregs.scratch.r2 = regs->r2; in stash_usr_regs()
91 uregs.scratch.r1 = regs->r1; in stash_usr_regs()
92 uregs.scratch.r0 = regs->r0; in stash_usr_regs()
93 uregs.scratch.sp = regs->sp; in stash_usr_regs()
95 err = __copy_to_user(&(sf->uc.uc_mcontext.regs.scratch), &uregs.scratch, in stash_usr_regs()
96 sizeof(sf->uc.uc_mcontext.regs.scratch)); in stash_usr_regs()
102 static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) in restore_usr_regs() argument
110 &(sf->uc.uc_mcontext.regs.scratch), in restore_usr_regs()
111 sizeof(sf->uc.uc_mcontext.regs.scratch)); in restore_usr_regs()
116 regs->bta = uregs.scratch.bta; in restore_usr_regs()
117 regs->lp_start = uregs.scratch.lp_start; in restore_usr_regs()
118 regs->lp_end = uregs.scratch.lp_end; in restore_usr_regs()
119 regs->lp_count = uregs.scratch.lp_count; in restore_usr_regs()
120 regs->status32 = uregs.scratch.status32; in restore_usr_regs()
121 regs->ret = uregs.scratch.ret; in restore_usr_regs()
122 regs->blink = uregs.scratch.blink; in restore_usr_regs()
123 regs->fp = uregs.scratch.fp; in restore_usr_regs()
124 regs->r26 = uregs.scratch.gp; in restore_usr_regs()
125 regs->r12 = uregs.scratch.r12; in restore_usr_regs()
126 regs->r11 = uregs.scratch.r11; in restore_usr_regs()
127 regs->r10 = uregs.scratch.r10; in restore_usr_regs()
128 regs->r9 = uregs.scratch.r9; in restore_usr_regs()
129 regs->r8 = uregs.scratch.r8; in restore_usr_regs()
130 regs->r7 = uregs.scratch.r7; in restore_usr_regs()
131 regs->r6 = uregs.scratch.r6; in restore_usr_regs()
132 regs->r5 = uregs.scratch.r5; in restore_usr_regs()
133 regs->r4 = uregs.scratch.r4; in restore_usr_regs()
134 regs->r3 = uregs.scratch.r3; in restore_usr_regs()
135 regs->r2 = uregs.scratch.r2; in restore_usr_regs()
136 regs->r1 = uregs.scratch.r1; in restore_usr_regs()
137 regs->r0 = uregs.scratch.r0; in restore_usr_regs()
138 regs->sp = uregs.scratch.sp; in restore_usr_regs()
155 struct pt_regs *regs = current_pt_regs(); in SYSCALL_DEFINE0() local
164 if (regs->sp & 3) in SYSCALL_DEFINE0()
167 sf = (struct rt_sigframe __force __user *)(regs->sp); in SYSCALL_DEFINE0()
179 if (restore_usr_regs(regs, sf)) in SYSCALL_DEFINE0()
183 syscall_wont_restart(regs); in SYSCALL_DEFINE0()
187 * regs saved on user stack got fudged between save and sigreturn) in SYSCALL_DEFINE0()
192 regs->status32 |= STATUS_U_MASK; in SYSCALL_DEFINE0()
194 return regs->r0; in SYSCALL_DEFINE0()
205 struct pt_regs *regs, in get_sigframe() argument
208 unsigned long sp = sigsp(regs->sp, ksig); in get_sigframe()
226 setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs) in setup_rt_frame() argument
232 sf = get_sigframe(ksig, regs, sizeof(struct rt_sigframe)); in setup_rt_frame()
243 err |= stash_usr_regs(sf, regs, set); in setup_rt_frame()
255 err |= __save_altstack(&sf->uc.uc_stack, regs->sp); in setup_rt_frame()
258 regs->r1 = (unsigned long)&sf->info; in setup_rt_frame()
259 regs->r2 = (unsigned long)&sf->uc; in setup_rt_frame()
273 regs->r0 = ksig->sig; in setup_rt_frame()
276 regs->ret = (unsigned long)ksig->ka.sa.sa_handler; in setup_rt_frame()
285 regs->blink = (unsigned long)ksig->ka.sa.sa_restorer; in setup_rt_frame()
288 regs->sp = (unsigned long)sf; in setup_rt_frame()
294 regs->status32 &= ~STATUS_DE_MASK; in setup_rt_frame()
295 regs->status32 |= STATUS_L_MASK; in setup_rt_frame()
300 static void arc_restart_syscall(struct k_sigaction *ka, struct pt_regs *regs) in arc_restart_syscall() argument
302 switch (regs->r0) { in arc_restart_syscall()
311 regs->r0 = -EINTR; /* ERESTART_xxx is internal */ in arc_restart_syscall()
321 regs->r0 = -EINTR; in arc_restart_syscall()
337 regs->r0 = regs->orig_r0; in arc_restart_syscall()
338 regs->ret -= is_isa_arcv2() ? 2 : 4; in arc_restart_syscall()
347 handle_signal(struct ksignal *ksig, struct pt_regs *regs) in handle_signal() argument
353 failed = setup_rt_frame(ksig, oldset, regs); in handle_signal()
358 void do_signal(struct pt_regs *regs) in do_signal() argument
363 restart_scall = in_syscall(regs) && syscall_restartable(regs); in do_signal()
367 arc_restart_syscall(&ksig.ka, regs); in do_signal()
368 syscall_wont_restart(regs); /* No more restarts */ in do_signal()
370 handle_signal(&ksig, regs); in do_signal()
376 if (regs->r0 == -ERESTARTNOHAND || in do_signal()
377 regs->r0 == -ERESTARTSYS || regs->r0 == -ERESTARTNOINTR) { in do_signal()
378 regs->r0 = regs->orig_r0; in do_signal()
379 regs->ret -= is_isa_arcv2() ? 2 : 4; in do_signal()
380 } else if (regs->r0 == -ERESTART_RESTARTBLOCK) { in do_signal()
381 regs->r8 = __NR_restart_syscall; in do_signal()
382 regs->ret -= is_isa_arcv2() ? 2 : 4; in do_signal()
384 syscall_wont_restart(regs); /* No more restarts */ in do_signal()
391 void do_notify_resume(struct pt_regs *regs) in do_notify_resume() argument
398 tracehook_notify_resume(regs); in do_notify_resume()