Lines Matching refs:extctx

392 static int protected_save_fpu_context(struct extctx_layout *extctx)  in protected_save_fpu_context()  argument
395 struct sctx_info __user *info = extctx->fpu.addr; in protected_save_fpu_context()
410 err |= __put_user(extctx->fpu.size, &info->size); in protected_save_fpu_context()
426 static int protected_restore_fpu_context(struct extctx_layout *extctx) in protected_restore_fpu_context() argument
429 struct sctx_info __user *info = extctx->fpu.addr; in protected_restore_fpu_context()
461 static int protected_save_lsx_context(struct extctx_layout *extctx) in protected_save_lsx_context() argument
464 struct sctx_info __user *info = extctx->lsx.addr; in protected_save_lsx_context()
482 err |= __put_user(extctx->lsx.size, &info->size); in protected_save_lsx_context()
498 static int protected_restore_lsx_context(struct extctx_layout *extctx) in protected_restore_lsx_context() argument
501 struct sctx_info __user *info = extctx->lsx.addr; in protected_restore_lsx_context()
536 static int protected_save_lasx_context(struct extctx_layout *extctx) in protected_save_lasx_context() argument
539 struct sctx_info __user *info = extctx->lasx.addr; in protected_save_lasx_context()
560 err |= __put_user(extctx->lasx.size, &info->size); in protected_save_lasx_context()
576 static int protected_restore_lasx_context(struct extctx_layout *extctx) in protected_restore_lasx_context() argument
579 struct sctx_info __user *info = extctx->lasx.addr; in protected_restore_lasx_context()
618 static int protected_save_lbt_context(struct extctx_layout *extctx) in protected_save_lbt_context() argument
621 struct sctx_info __user *info = extctx->lbt.addr; in protected_save_lbt_context()
640 err |= __put_user(extctx->lbt.size, &info->size); in protected_save_lbt_context()
654 static int protected_restore_lbt_context(struct extctx_layout *extctx) in protected_restore_lbt_context() argument
657 struct sctx_info __user *info = extctx->lbt.addr; in protected_restore_lbt_context()
689 struct extctx_layout *extctx) in setup_sigcontext() argument
695 err |= __put_user(extctx->flags, &sc->sc_flags); in setup_sigcontext()
701 if (extctx->lasx.addr) in setup_sigcontext()
702 err |= protected_save_lasx_context(extctx); in setup_sigcontext()
703 else if (extctx->lsx.addr) in setup_sigcontext()
704 err |= protected_save_lsx_context(extctx); in setup_sigcontext()
705 else if (extctx->fpu.addr) in setup_sigcontext()
706 err |= protected_save_fpu_context(extctx); in setup_sigcontext()
709 if (extctx->lbt.addr) in setup_sigcontext()
710 err |= protected_save_lbt_context(extctx); in setup_sigcontext()
714 info = (struct sctx_info *)extctx->end.addr; in setup_sigcontext()
721 static int parse_extcontext(struct sigcontext __user *sc, struct extctx_layout *extctx) in parse_extcontext() argument
741 extctx->fpu.addr = info; in parse_extcontext()
748 extctx->lsx.addr = info; in parse_extcontext()
755 extctx->lasx.addr = info; in parse_extcontext()
762 extctx->lbt.addr = info; in parse_extcontext()
782 struct extctx_layout extctx; in restore_sigcontext() local
784 memset(&extctx, 0, sizeof(struct extctx_layout)); in restore_sigcontext()
786 err = __get_user(extctx.flags, &sc->sc_flags); in restore_sigcontext()
790 err = parse_extcontext(sc, &extctx); in restore_sigcontext()
794 conditional_used_math(extctx.flags & SC_USED_FP); in restore_sigcontext()
800 if (!(extctx.flags & SC_USED_FP)) in restore_sigcontext()
810 if (extctx.lasx.addr) in restore_sigcontext()
811 err |= protected_restore_lasx_context(&extctx); in restore_sigcontext()
812 else if (extctx.lsx.addr) in restore_sigcontext()
813 err |= protected_restore_lsx_context(&extctx); in restore_sigcontext()
814 else if (extctx.fpu.addr) in restore_sigcontext()
815 err |= protected_restore_fpu_context(&extctx); in restore_sigcontext()
818 if (extctx.lbt.addr) in restore_sigcontext()
819 err |= protected_restore_lbt_context(&extctx); in restore_sigcontext()
844 static unsigned long extframe_alloc(struct extctx_layout *extctx, in extframe_alloc() argument
855 extctx->size += layout->size; in extframe_alloc()
860 static unsigned long setup_extcontext(struct extctx_layout *extctx, unsigned long sp) in setup_extcontext() argument
864 memset(extctx, 0, sizeof(struct extctx_layout)); in setup_extcontext()
866 extctx->flags = handle_flags(); in setup_extcontext()
870 extctx->end.addr = (void *)new_sp; in setup_extcontext()
871 extctx->end.size = (unsigned int)sizeof(struct sctx_info); in setup_extcontext()
872 extctx->size += extctx->end.size; in setup_extcontext()
874 if (extctx->flags & SC_USED_FP) { in setup_extcontext()
876 new_sp = extframe_alloc(extctx, &extctx->lasx, in setup_extcontext()
879 new_sp = extframe_alloc(extctx, &extctx->lsx, in setup_extcontext()
882 new_sp = extframe_alloc(extctx, &extctx->fpu, in setup_extcontext()
888 new_sp = extframe_alloc(extctx, &extctx->lbt, in setup_extcontext()
897 struct extctx_layout *extctx) in get_sigframe() argument
914 sp = setup_extcontext(extctx, sp); in get_sigframe()
964 struct extctx_layout extctx; in setup_rt_frame() local
967 frame = get_sigframe(ksig, regs, &extctx); in setup_rt_frame()
968 if (!access_ok(frame, sizeof(*frame) + extctx.size)) in setup_rt_frame()
978 err |= setup_sigcontext(regs, &frame->rs_uctx.uc_mcontext, &extctx); in setup_rt_frame()