From: Roland McGrath Date: Sat, 3 Sep 1994 02:31:57 +0000 (+0000) Subject: Restore FPU state. Code from kkojima. X-Git-Tag: glibc-2.16-ports-before-merge~4054 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7704bac4de34fe1c3d367c02de17ed79577f2379;p=thirdparty%2Fglibc.git Restore FPU state. Code from kkojima. --- diff --git a/sysdeps/mach/hurd/mips/sigreturn.c b/sysdeps/mach/hurd/mips/sigreturn.c index f02e799dcbc..0b3a474986e 100644 --- a/sysdeps/mach/hurd/mips/sigreturn.c +++ b/sysdeps/mach/hurd/mips/sigreturn.c @@ -77,8 +77,30 @@ __sigreturn (struct sigcontext *scp) if (scp->sc_coproc_used & SC_COPROC_USE_FPU) { - /* XXX should restore FPU state here */ - abort (); + /* Restore FPU state. */ +#define restore_fpr(n) \ + asm volatile ("l.d $f" #n ",%0" : : "m" (scp->sc_fpr[n])) + + /* Restore floating-point registers. */ + restore_fpr (0); + restore_fpr (2); + restore_fpr (4); + restore_fpr (6); + restore_fpr (8); + restore_fpr (10); + restore_fpr (12); + restore_fpr (14); + restore_fpr (16); + restore_fpr (18); + restore_fpr (20); + restore_fpr (22); + restore_fpr (24); + restore_fpr (26); + restore_fpr (28); + restore_fpr (30); + + /* Restore the floating-point control/status register ($f31). */ + asm volatile ("ctc1 %0,$f31" : : "r" (scp->sc_fpcsr)); } /* Load all the registers from the sigcontext. */