From 2e15472b832b1911238e0f47591d278499efb29a Mon Sep 17 00:00:00 2001
From: dtc <dtc>
Date: Tue, 2 Feb 1999 10:58:25 +0000
Subject: [PATCH] Provide our own implementation of setfpucw for the Linux
 port, as recent libraries are reported to no long provide __setfpucw.

---
 lisp/Linux-os.c  | 4 ++--
 lisp/Linux-os.h  | 4 +++-
 lisp/interrupt.c | 6 +++---
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/lisp/Linux-os.c b/lisp/Linux-os.c
index 67314602f..71ad1757e 100644
--- a/lisp/Linux-os.c
+++ b/lisp/Linux-os.c
@@ -14,7 +14,7 @@
  * Morfed from the FreeBSD file by Peter Van Eynde (July 1996)
  * GENCGC support by Douglas Crosher, 1996, 1997.
  *
- * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.4 1998/05/01 01:21:40 dtc Exp $
+ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.c,v 1.5 1999/02/02 10:58:24 dtc Exp $
  *
  */
 
@@ -97,7 +97,7 @@ os_init(void)
 #else
   os_vm_page_size=getpagesize();
 #endif
-__setfpucw(0x1372|4|8|16|32); /*no interrupts */
+  setfpucw(0x1372|4|8|16|32); /*no interrupts */
 }
 
 int
diff --git a/lisp/Linux-os.h b/lisp/Linux-os.h
index 5fb9f40bf..c067461e5 100644
--- a/lisp/Linux-os.h
+++ b/lisp/Linux-os.h
@@ -1,4 +1,4 @@
-/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.h,v 1.6 1998/06/16 06:58:58 dtc Exp $
+/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/Linux-os.h,v 1.7 1999/02/02 10:58:24 dtc Exp $
 
  This code was written as part of the CMU Common Lisp project at
  Carnegie Mellon University, and has been placed in the public domain.
@@ -60,6 +60,8 @@ typedef struct sigcontext_struct sigcontext;
 #define GET_CONTEXT int code=0; struct sigcontext_struct *context=&contextstruct;
 #endif
 
+#define setfpucw(cw)	asm("fldcw %0" : : "m" (cw));
+
 #define sigvec          sigaction
 #define sv_mask         sa_mask
 #define sv_flags        sa_flags
diff --git a/lisp/interrupt.c b/lisp/interrupt.c
index b5d123687..a53d99b12 100644
--- a/lisp/interrupt.c
+++ b/lisp/interrupt.c
@@ -1,4 +1,4 @@
-/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.c,v 1.15 1998/05/01 01:21:42 dtc Exp $ */
+/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/interrupt.c,v 1.16 1999/02/02 10:58:25 dtc Exp $ */
 
 /* Interrupt handing magic. */
 
@@ -267,7 +267,7 @@ interrupt_handle_now(HANDLER_ARGS)
     union interrupt_handler handler;
 
 #ifdef __linux__
-    __setfpucw(contextstruct.fpstate->cw);
+    setfpucw(contextstruct.fpstate->cw);
 #endif
     
     handler = interrupt_handlers[signal];
@@ -356,7 +356,7 @@ maybe_now_maybe_later(HANDLER_ARGS)
     SAVE_CONTEXT(); /**/
 
 #ifdef __linux__
-    __setfpucw(contextstruct.fpstate->cw);
+    setfpucw(contextstruct.fpstate->cw);
 #endif
 
     if (SymbolValue(INTERRUPTS_ENABLED) == NIL) {
-- 
GitLab