From 7704bac4de34fe1c3d367c02de17ed79577f2379 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 3 Sep 1994 02:31:57 +0000 Subject: [PATCH] Restore FPU state. Code from kkojima. --- sysdeps/mach/hurd/mips/sigreturn.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/sysdeps/mach/hurd/mips/sigreturn.c b/sysdeps/mach/hurd/mips/sigreturn.c index f02e799..0b3a474 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. */ -- 2.7.4