[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Recode usage of FPSR_DEFAULT due to strange double declaration



# HG changeset patch
# User djm@xxxxxxxxxxxxxxx
# Node ID c35a32f96d2095e92d2e873d9ee842877fa30127
# Parent  878a9891b056c19524e4d213f706a5cafc983b3a
Recode usage of FPSR_DEFAULT due to strange double declaration

diff -r 878a9891b056 -r c35a32f96d20 tools/libxc/xc_ia64_stubs.c
--- a/tools/libxc/xc_ia64_stubs.c       Sat Nov 19 05:16:29 2005
+++ b/tools/libxc/xc_ia64_stubs.c       Sat Nov 19 21:41:08 2005
@@ -6,6 +6,21 @@
 #include <zlib.h>
 #include "xen/arch-ia64.h"
 #include <xen/io/ioreq.h>
+
+/* this is a very ugly way of getting FPSR_DEFAULT.  struct ia64_fpreg is
+ * mysteriously declared in two places: /usr/include/asm/fpu.h and
+ * /usr/include/bits/sigcontext.h.  The former also defines FPSR_DEFAULT,
+ * the latter doesn't but is included (indirectly) by xg_private.h */
+#define __ASSEMBLY__
+#include <asm/fpu.h>
+#undef __IA64_UL
+#define __IA64_UL(x)           ((unsigned long)(x))
+#undef __ASSEMBLY__
+                                                                               
 
+unsigned long xc_ia64_fpsr_default(void)
+{
+        return FPSR_DEFAULT;
+}
 
 int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, 
                   uint32_t max_factor, uint32_t flags)
diff -r 878a9891b056 -r c35a32f96d20 tools/libxc/xc_linux_build.c
--- a/tools/libxc/xc_linux_build.c      Sat Nov 19 05:16:29 2005
+++ b/tools/libxc/xc_linux_build.c      Sat Nov 19 21:41:08 2005
@@ -278,7 +278,8 @@
 #endif
 
 #ifdef __ia64__
-#include <asm/fpu.h> /* for FPSR_DEFAULT */
+extern unsigned long xc_ia64_fpsr_default(void);
+
 static int setup_guest(int xc_handle,
                        uint32_t dom,
                        char *image, unsigned long image_size,
@@ -780,7 +781,7 @@
     ctxt->regs.cr_ipsr = 0; /* all necessary bits filled by hypervisor */
     ctxt->regs.cr_iip = vkern_entry;
     ctxt->regs.cr_ifs = 1UL << 63;
-    ctxt->regs.ar_fpsr = FPSR_DEFAULT;
+    ctxt->regs.ar_fpsr = xc_ia64_fpsr_default();
     /* currently done by hypervisor, should move here */
     /* ctxt->regs.r28 = dom_fw_setup(); */
     ctxt->vcpu.privregs = 0;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.