Lines Matching refs:sc

199 static inline void save_a5_state(struct sigcontext *sc, struct pt_regs *regs)  in save_a5_state()  argument
224 static inline void save_a5_state(struct sigcontext *sc, struct pt_regs *regs) in save_a5_state() argument
226 sc->sc_a5 = ((struct switch_stack *)regs - 1)->a5; in save_a5_state()
250 struct sigcontext sc; member
273 static inline int restore_fpu_state(struct sigcontext *sc) in restore_fpu_state() argument
279 memcpy(current->thread.fpcntl, sc->sc_fpcntl, 12); in restore_fpu_state()
280 memcpy(current->thread.fp, sc->sc_fpregs, 24); in restore_fpu_state()
284 if (CPU_IS_060 ? sc->sc_fpstate[2] : sc->sc_fpstate[0]) { in restore_fpu_state()
287 (sc->sc_fpstate[0] != fpu_version)) in restore_fpu_state()
291 !(sc->sc_fpstate[1] == 0x18 || sc->sc_fpstate[1] == 0xb4)) in restore_fpu_state()
294 !(sc->sc_fpstate[1] == 0x38 || sc->sc_fpstate[1] == 0xd4)) in restore_fpu_state()
297 if (!(sc->sc_fpstate[1] == 0x00 || in restore_fpu_state()
298 sc->sc_fpstate[1] == 0x28 || in restore_fpu_state()
299 sc->sc_fpstate[1] == 0x60)) in restore_fpu_state()
302 if (!(sc->sc_fpstate[3] == 0x00 || in restore_fpu_state()
303 sc->sc_fpstate[3] == 0x60 || in restore_fpu_state()
304 sc->sc_fpstate[3] == 0xe0)) in restore_fpu_state()
307 if (!(sc->sc_fpstate[0] == 0x00 || in restore_fpu_state()
308 sc->sc_fpstate[0] == 0x05 || in restore_fpu_state()
309 sc->sc_fpstate[0] == 0xe5)) in restore_fpu_state()
320 : "m" (sc->sc_fpregs[0]), in restore_fpu_state()
321 "m" (sc->sc_fpcntl[0]), in restore_fpu_state()
322 "m" (sc->sc_fpcntl[1]), in restore_fpu_state()
323 "m" (sc->sc_fpcntl[2])); in restore_fpu_state()
330 : "m" (*sc->sc_fpregs), in restore_fpu_state()
331 "m" (*sc->sc_fpcntl)); in restore_fpu_state()
336 __asm__ volatile ("frestore %0" : : "m" (*sc->sc_fpstate)); in restore_fpu_state()
341 : : "m" (*sc->sc_fpstate)); in restore_fpu_state()
447 static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs) in save_fpu_state() argument
451 memcpy(sc->sc_fpcntl, current->thread.fpcntl, 12); in save_fpu_state()
452 memcpy(sc->sc_fpregs, current->thread.fp, 24); in save_fpu_state()
458 : : "m" (*sc->sc_fpstate) : "memory"); in save_fpu_state()
463 : : "m" (*sc->sc_fpstate) : "memory"); in save_fpu_state()
466 if (CPU_IS_060 ? sc->sc_fpstate[2] : sc->sc_fpstate[0]) { in save_fpu_state()
467 fpu_version = sc->sc_fpstate[0]; in save_fpu_state()
472 if (*(unsigned short *) sc->sc_fpstate == 0x1f38) in save_fpu_state()
473 sc->sc_fpstate[0x38] |= 1 << 3; in save_fpu_state()
481 : "=m" (sc->sc_fpregs[0]), in save_fpu_state()
482 "=m" (sc->sc_fpcntl[0]), in save_fpu_state()
483 "=m" (sc->sc_fpcntl[1]), in save_fpu_state()
484 "=m" (sc->sc_fpcntl[2]) in save_fpu_state()
492 : "=m" (*sc->sc_fpregs), in save_fpu_state()
493 "=m" (*sc->sc_fpcntl) in save_fpu_state()
573 static inline int restore_fpu_state(struct sigcontext *sc) in restore_fpu_state() argument
583 static inline void save_fpu_state(struct sigcontext *sc, struct pt_regs *regs) in save_fpu_state() argument
750 if (__get_user(set.sig[0], &frame->sc.sc_mask) || in do_sigreturn()
758 if (restore_sigcontext(regs, &frame->sc, frame + 1)) in do_sigreturn()
791 static void setup_sigcontext(struct sigcontext *sc, struct pt_regs *regs, in setup_sigcontext() argument
794 sc->sc_mask = mask; in setup_sigcontext()
795 sc->sc_usp = rdusp(); in setup_sigcontext()
796 sc->sc_d0 = regs->d0; in setup_sigcontext()
797 sc->sc_d1 = regs->d1; in setup_sigcontext()
798 sc->sc_a0 = regs->a0; in setup_sigcontext()
799 sc->sc_a1 = regs->a1; in setup_sigcontext()
800 sc->sc_sr = regs->sr; in setup_sigcontext()
801 sc->sc_pc = regs->pc; in setup_sigcontext()
802 sc->sc_formatvec = regs->format << 12 | regs->vector; in setup_sigcontext()
803 save_a5_state(sc, regs); in setup_sigcontext()
804 save_fpu_state(sc, regs); in setup_sigcontext()
869 err |= __put_user(&frame->sc, &frame->psc); in setup_frame()
876 err |= copy_to_user (&frame->sc, &context, sizeof(context)); in setup_frame()