• Home
  • Raw
  • Download

Lines Matching refs:err

77 	int err = 0;  in copy_fp_to_sigcontext()  local
81 err |= in copy_fp_to_sigcontext()
85 err |= __put_user(current->thread.fpu.fcr31, csr); in copy_fp_to_sigcontext()
87 return err; in copy_fp_to_sigcontext()
96 int err = 0; in copy_fp_from_sigcontext() local
101 err |= __get_user(fpr_val, &fpregs[i]); in copy_fp_from_sigcontext()
104 err |= __get_user(current->thread.fpu.fcr31, csr); in copy_fp_from_sigcontext()
106 return err; in copy_fp_from_sigcontext()
167 int i, err; in save_msa_extcontext() local
188 err = __put_user(read_msa_csr(), &msa->csr); in save_msa_extcontext()
189 err |= _save_msa_all_upper(&msa->wr); in save_msa_extcontext()
195 err = __put_user(current->thread.fpu.msacsr, &msa->csr); in save_msa_extcontext()
199 err |= __put_user(val, &msa->wr[i]); in save_msa_extcontext()
203 err |= __put_user(MSA_EXTCONTEXT_MAGIC, &msa->ext.magic); in save_msa_extcontext()
204 err |= __put_user(sizeof(*msa), &msa->ext.size); in save_msa_extcontext()
206 return err ? -EFAULT : sizeof(*msa); in save_msa_extcontext()
214 int i, err; in restore_msa_extcontext() local
219 err = get_user(csr, &msa->csr); in restore_msa_extcontext()
220 if (err) in restore_msa_extcontext()
221 return err; in restore_msa_extcontext()
236 err |= _restore_msa_all_upper(&msa->wr); in restore_msa_extcontext()
244 err |= __get_user(val, &msa->wr[i]); in restore_msa_extcontext()
249 return err; in restore_msa_extcontext()
290 int err; in restore_extcontext() local
293 err = __get_user(ext.magic, (unsigned int *)buf); in restore_extcontext()
294 if (err) in restore_extcontext()
295 return err; in restore_extcontext()
300 err = __get_user(ext.size, (unsigned int *)(buf in restore_extcontext()
302 if (err) in restore_extcontext()
303 return err; in restore_extcontext()
307 err = restore_msa_extcontext(buf, ext.size); in restore_extcontext()
311 err = -EINVAL; in restore_extcontext()
315 if (err) in restore_extcontext()
316 return err; in restore_extcontext()
332 int err; in protected_save_fp_context() local
353 err = save_fp_context(sc); in protected_save_fp_context()
357 err = copy_fp_to_sigcontext(sc); in protected_save_fp_context()
359 if (likely(!err)) in protected_save_fp_context()
362 err = __put_user(0, &fpregs[0]) | in protected_save_fp_context()
365 if (err) in protected_save_fp_context()
366 return err; /* really bad sigcontext */ in protected_save_fp_context()
370 ext_sz = err = save_extcontext(sc_to_extcontext(sc)); in protected_save_fp_context()
371 if (err < 0) in protected_save_fp_context()
372 return err; in protected_save_fp_context()
385 int err, sig = 0, tmp __maybe_unused; in protected_restore_fp_context() local
387 err = __get_user(used, used_math); in protected_restore_fp_context()
394 if (err || !(used & USED_FP)) in protected_restore_fp_context()
396 if (err) in protected_restore_fp_context()
397 return err; in protected_restore_fp_context()
401 err = sig = fpcsr_pending(csr); in protected_restore_fp_context()
402 if (err < 0) in protected_restore_fp_context()
403 return err; in protected_restore_fp_context()
416 err = restore_fp_context(sc); in protected_restore_fp_context()
420 err = copy_fp_from_sigcontext(sc); in protected_restore_fp_context()
422 if (likely(!err)) in protected_restore_fp_context()
425 err = __get_user(tmp, &fpregs[0]) | in protected_restore_fp_context()
428 if (err) in protected_restore_fp_context()
433 if (!err && (used & USED_EXTCONTEXT)) in protected_restore_fp_context()
434 err = restore_extcontext(sc_to_extcontext(sc)); in protected_restore_fp_context()
436 return err ?: sig; in protected_restore_fp_context()
441 int err = 0; in setup_sigcontext() local
444 err |= __put_user(regs->cp0_epc, &sc->sc_pc); in setup_sigcontext()
446 err |= __put_user(0, &sc->sc_regs[0]); in setup_sigcontext()
448 err |= __put_user(regs->regs[i], &sc->sc_regs[i]); in setup_sigcontext()
451 err |= __put_user(regs->acx, &sc->sc_acx); in setup_sigcontext()
453 err |= __put_user(regs->hi, &sc->sc_mdhi); in setup_sigcontext()
454 err |= __put_user(regs->lo, &sc->sc_mdlo); in setup_sigcontext()
456 err |= __put_user(mfhi1(), &sc->sc_hi1); in setup_sigcontext()
457 err |= __put_user(mflo1(), &sc->sc_lo1); in setup_sigcontext()
458 err |= __put_user(mfhi2(), &sc->sc_hi2); in setup_sigcontext()
459 err |= __put_user(mflo2(), &sc->sc_lo2); in setup_sigcontext()
460 err |= __put_user(mfhi3(), &sc->sc_hi3); in setup_sigcontext()
461 err |= __put_user(mflo3(), &sc->sc_lo3); in setup_sigcontext()
462 err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp); in setup_sigcontext()
470 err |= protected_save_fp_context(sc); in setup_sigcontext()
472 return err; in setup_sigcontext()
499 int err, sig = 0; in fpcsr_pending() local
502 err = __get_user(csr, fpcsr); in fpcsr_pending()
510 err |= __put_user(csr, fpcsr); in fpcsr_pending()
513 return err ?: sig; in fpcsr_pending()
519 int err = 0; in restore_sigcontext() local
525 err |= __get_user(regs->cp0_epc, &sc->sc_pc); in restore_sigcontext()
528 err |= __get_user(regs->acx, &sc->sc_acx); in restore_sigcontext()
530 err |= __get_user(regs->hi, &sc->sc_mdhi); in restore_sigcontext()
531 err |= __get_user(regs->lo, &sc->sc_mdlo); in restore_sigcontext()
533 err |= __get_user(treg, &sc->sc_hi1); mthi1(treg); in restore_sigcontext()
534 err |= __get_user(treg, &sc->sc_lo1); mtlo1(treg); in restore_sigcontext()
535 err |= __get_user(treg, &sc->sc_hi2); mthi2(treg); in restore_sigcontext()
536 err |= __get_user(treg, &sc->sc_lo2); mtlo2(treg); in restore_sigcontext()
537 err |= __get_user(treg, &sc->sc_hi3); mthi3(treg); in restore_sigcontext()
538 err |= __get_user(treg, &sc->sc_lo3); mtlo3(treg); in restore_sigcontext()
539 err |= __get_user(treg, &sc->sc_dsp); wrdsp(treg, DSP_MASK); in restore_sigcontext()
543 err |= __get_user(regs->regs[i], &sc->sc_regs[i]); in restore_sigcontext()
545 return err ?: protected_restore_fp_context(sc); in restore_sigcontext()
588 int err = 0; in SYSCALL_DEFINE3() local
595 err |= __get_user(new_ka.sa.sa_handler, &act->sa_handler); in SYSCALL_DEFINE3()
596 err |= __get_user(new_ka.sa.sa_flags, &act->sa_flags); in SYSCALL_DEFINE3()
597 err |= __get_user(mask, &act->sa_mask.sig[0]); in SYSCALL_DEFINE3()
598 if (err) in SYSCALL_DEFINE3()
609 err |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); in SYSCALL_DEFINE3()
610 err |= __put_user(old_ka.sa.sa_handler, &oact->sa_handler); in SYSCALL_DEFINE3()
611 err |= __put_user(old_ka.sa.sa_mask.sig[0], oact->sa_mask.sig); in SYSCALL_DEFINE3()
612 err |= __put_user(0, &oact->sa_mask.sig[1]); in SYSCALL_DEFINE3()
613 err |= __put_user(0, &oact->sa_mask.sig[2]); in SYSCALL_DEFINE3()
614 err |= __put_user(0, &oact->sa_mask.sig[3]); in SYSCALL_DEFINE3()
615 if (err) in SYSCALL_DEFINE3()
705 int err = 0; in setup_frame() local
711 err |= setup_sigcontext(regs, &frame->sf_sc); in setup_frame()
712 err |= __copy_to_user(&frame->sf_mask, set, sizeof(*set)); in setup_frame()
713 if (err) in setup_frame()
744 int err = 0; in setup_rt_frame() local
751 err |= copy_siginfo_to_user(&frame->rs_info, &ksig->info); in setup_rt_frame()
754 err |= __put_user(0, &frame->rs_uc.uc_flags); in setup_rt_frame()
755 err |= __put_user(NULL, &frame->rs_uc.uc_link); in setup_rt_frame()
756 err |= __save_altstack(&frame->rs_uc.uc_stack, regs->regs[29]); in setup_rt_frame()
757 err |= setup_sigcontext(regs, &frame->rs_uc.uc_mcontext); in setup_rt_frame()
758 err |= __copy_to_user(&frame->rs_uc.uc_sigmask, set, sizeof(*set)); in setup_rt_frame()
760 if (err) in setup_rt_frame()