about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-24 09:02:16 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-24 09:02:16 +0000
commit24176967122b027e51e437ace3b9afdf841fed9d (patch)
tree9e6cdbaf793db367e817d2baac4eaa7012cdc3bc /sysdeps
parent67b78ef91b1441c7f94fe03e1bad161d5912f5ac (diff)
downloadglibc-24176967122b027e51e437ace3b9afdf841fed9d.tar.gz
glibc-24176967122b027e51e437ace3b9afdf841fed9d.tar.xz
glibc-24176967122b027e51e437ace3b9afdf841fed9d.zip
Update.
2003-05-19  Ed Connell  <ed.connell@sas.com>

	* sysdeps/unix/sysv/linux/i386/getcontext.S (getcontext): Retain
	floating point mask.
	* sysdeps/i386/fpu/fegetenv.c (fegetenv): Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/i386/fpu/fegetenv.c6
-rw-r--r--sysdeps/unix/sysv/linux/i386/getcontext.S6
2 files changed, 10 insertions, 2 deletions
diff --git a/sysdeps/i386/fpu/fegetenv.c b/sysdeps/i386/fpu/fegetenv.c
index 5eef171308..fb955cf565 100644
--- a/sysdeps/i386/fpu/fegetenv.c
+++ b/sysdeps/i386/fpu/fegetenv.c
@@ -1,5 +1,5 @@
 /* Store current floating-point environment.
-   Copyright (C) 1997,99,2000,01 Free Software Foundation, Inc.
+   Copyright (C) 1997,1999,2000,2001,2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -25,6 +25,10 @@ int
 __fegetenv (fenv_t *envp)
 {
   __asm__ ("fnstenv %0" : "=m" (*envp));
+  /* And load it right back since the processor changes the mask.
+     Intel thought this opcode to be used in interrupt handlers which
+     would block all exceptions.  */
+  __asm__ ("fldenv %0" : : "m" (*envp));
 
   /* Success.  */
   return 0;
diff --git a/sysdeps/unix/sysv/linux/i386/getcontext.S b/sysdeps/unix/sysv/linux/i386/getcontext.S
index 9db129f5a6..68541d5d80 100644
--- a/sysdeps/unix/sysv/linux/i386/getcontext.S
+++ b/sysdeps/unix/sysv/linux/i386/getcontext.S
@@ -1,5 +1,5 @@
 /* Save current context.
-   Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
 
@@ -56,6 +56,10 @@ ENTRY(__getcontext)
 	movl	%ecx, oFPREGS(%eax)
 	/* Save the floating-point context.  */
 	fnstenv	(%ecx)
+	/* And load it right back since the processor changes the mask.
+	   Intel thought this opcode to be used in interrupt handlers which
+	   would block all exceptions.  */
+	fldenv	(%ecx)
 
 	/* Save the current signal mask.  */
 	pushl	%ebx