Lines Matching refs:regs

33 asmlinkage int do_signal(struct pt_regs *regs, sigset_t *oldset,
77 struct pt_regs regs) in sys_sigsuspend() argument
88 regs.regs[0] = -EINTR; in sys_sigsuspend()
92 if (do_signal(&regs, &saveset, 0, 0)) in sys_sigsuspend()
100 struct pt_regs regs) in sys_rt_sigsuspend() argument
117 regs.regs[0] = -EINTR; in sys_rt_sigsuspend()
121 if (do_signal(&regs, &saveset, 0, 0)) in sys_rt_sigsuspend()
161 struct pt_regs regs) in sys_sigaltstack() argument
163 return do_sigaltstack(uss, uoss, regs.regs[15]); in sys_sigaltstack()
222 restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc) in restore_sigcontext() argument
226 #define COPY(x) err |= __get_user(regs->x, &sc->sc_##x) in restore_sigcontext()
227 COPY(regs[0]); COPY(regs[1]); in restore_sigcontext()
228 COPY(regs[2]); COPY(regs[3]); in restore_sigcontext()
229 COPY(regs[4]); COPY(regs[5]); in restore_sigcontext()
230 COPY(regs[6]); COPY(regs[7]); in restore_sigcontext()
231 COPY(regs[8]); COPY(regs[9]); in restore_sigcontext()
232 COPY(regs[10]); COPY(regs[11]); in restore_sigcontext()
233 COPY(regs[12]); COPY(regs[13]); in restore_sigcontext()
234 COPY(regs[14]); COPY(regs[15]); in restore_sigcontext()
245 regs->sr |= SR_FD; /* Release FPU */ in restore_sigcontext()
259 struct pt_regs regs) in sys_sigreturn() argument
261 struct sigframe *frame = (struct sigframe *)regs.regs[15]; in sys_sigreturn()
280 if (restore_sigcontext(&regs, &frame->sc)) in sys_sigreturn()
282 return regs.regs[0]; in sys_sigreturn()
291 struct pt_regs regs) in sys_rt_sigreturn() argument
293 struct rt_sigframe *frame = (struct rt_sigframe *)regs.regs[15]; in sys_rt_sigreturn()
309 if (restore_sigcontext(&regs, &frame->uc.uc_mcontext)) in sys_rt_sigreturn()
316 do_sigaltstack(&st, NULL, regs.regs[15]); in sys_rt_sigreturn()
317 return regs.regs[0]; in sys_rt_sigreturn()
329 setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, in setup_sigcontext() argument
334 #define COPY(x) err |= __put_user(regs->x, &sc->sc_##x) in setup_sigcontext()
335 COPY(regs[0]); COPY(regs[1]); in setup_sigcontext()
336 COPY(regs[2]); COPY(regs[3]); in setup_sigcontext()
337 COPY(regs[4]); COPY(regs[5]); in setup_sigcontext()
338 COPY(regs[6]); COPY(regs[7]); in setup_sigcontext()
339 COPY(regs[8]); COPY(regs[9]); in setup_sigcontext()
340 COPY(regs[10]); COPY(regs[11]); in setup_sigcontext()
341 COPY(regs[12]); COPY(regs[13]); in setup_sigcontext()
342 COPY(regs[14]); COPY(regs[15]); in setup_sigcontext()
371 sigset_t *set, struct pt_regs *regs) in setup_frame() argument
377 frame = get_sigframe(ka, regs->regs[15], sizeof(*frame)); in setup_frame()
388 err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); in setup_frame()
398 regs->pr = (unsigned long) ka->sa.sa_restorer; in setup_frame()
409 regs->pr = (unsigned long) frame->retcode; in setup_frame()
416 regs->regs[15] = (unsigned long) frame; in setup_frame()
417 regs->regs[4] = signal; /* Arg for signal handler */ in setup_frame()
418 regs->regs[5] = 0; in setup_frame()
419 regs->regs[6] = (unsigned long) &frame->sc; in setup_frame()
420 regs->pc = (unsigned long) ka->sa.sa_handler; in setup_frame()
426 current->comm, current->pid, frame, regs->pc, regs->pr); in setup_frame()
429 flush_cache_sigtramp(regs->pr); in setup_frame()
430 if ((-regs->pr & (L1_CACHE_BYTES-1)) < sizeof(frame->retcode)) in setup_frame()
431 flush_cache_sigtramp(regs->pr + L1_CACHE_BYTES); in setup_frame()
441 sigset_t *set, struct pt_regs *regs) in setup_rt_frame() argument
447 frame = get_sigframe(ka, regs->regs[15], sizeof(*frame)); in setup_rt_frame()
465 err |= __put_user(sas_ss_flags(regs->regs[15]), in setup_rt_frame()
469 regs, set->sig[0]); in setup_rt_frame()
475 regs->pr = (unsigned long) ka->sa.sa_restorer; in setup_rt_frame()
486 regs->pr = (unsigned long) frame->retcode; in setup_rt_frame()
493 regs->regs[15] = (unsigned long) frame; /* Stack pointer */ in setup_rt_frame()
494 regs->regs[4] = signal; /* Arg1 (signal) */ in setup_rt_frame()
495 regs->regs[5] = (unsigned long)&frame->info; /* Arg2 (siginfo) */ in setup_rt_frame()
496 regs->regs[6] = (unsigned long)&frame->uc; /* Arg3 (context) */ in setup_rt_frame()
497 regs->pc = (unsigned long) ka->sa.sa_handler; /* Program counter */ in setup_rt_frame()
503 current->comm, current->pid, frame, regs->pc, regs->pr); in setup_rt_frame()
506 flush_cache_sigtramp(regs->pr); in setup_rt_frame()
507 if ((-regs->pr & (L1_CACHE_BYTES-1)) < sizeof(frame->retcode)) in setup_rt_frame()
508 flush_cache_sigtramp(regs->pr + L1_CACHE_BYTES); in setup_rt_frame()
523 siginfo_t *info, sigset_t *oldset, struct pt_regs *regs, in handle_signal() argument
529 switch (regs->regs[0]) { in handle_signal()
531 regs->regs[0] = -EINTR; in handle_signal()
536 regs->regs[0] = -EINTR; in handle_signal()
541 regs->regs[0] = orig_r0; in handle_signal()
542 regs->pc -= 2; in handle_signal()
546 if (regs->regs[15] >= 0xc0000000) { in handle_signal()
547 int offset = (int)regs->regs[15]; in handle_signal()
550 regs->regs[15] = regs->regs[1]; in handle_signal()
551 if (regs->pc < regs->regs[0]) in handle_signal()
553 regs->pc = regs->regs[0] + offset - 2; in handle_signal()
559 setup_rt_frame(sig, ka, info, oldset, regs); in handle_signal()
561 setup_frame(sig, ka, oldset, regs); in handle_signal()
584 int do_signal(struct pt_regs *regs, sigset_t *oldset, in do_signal() argument
596 if (!user_mode(regs)) in do_signal()
681 if (do_coredump(signr, regs)) in do_signal()
692 handle_signal(signr, ka, &info, oldset, regs, in do_signal()
700 if (regs->regs[0] == -ERESTARTNOHAND || in do_signal()
701 regs->regs[0] == -ERESTARTSYS || in do_signal()
702 regs->regs[0] == -ERESTARTNOINTR) { in do_signal()
703 regs->regs[0] = orig_r0; in do_signal()
704 regs->pc -= 2; in do_signal()