ia64/xen-unstable

changeset 7914:c35a32f96d20

Recode usage of FPSR_DEFAULT due to strange double declaration
author djm@kirby.fc.hp.com
date Sat Nov 19 15:41:08 2005 -0600 (2005-11-19)
parents 878a9891b056
children 6ac2a06e238b 6a666940fa04
files tools/libxc/xc_ia64_stubs.c tools/libxc/xc_linux_build.c
line diff
     1.1 --- a/tools/libxc/xc_ia64_stubs.c	Fri Nov 18 23:16:29 2005 -0600
     1.2 +++ b/tools/libxc/xc_ia64_stubs.c	Sat Nov 19 15:41:08 2005 -0600
     1.3 @@ -7,6 +7,21 @@
     1.4  #include "xen/arch-ia64.h"
     1.5  #include <xen/io/ioreq.h>
     1.6  
     1.7 +/* this is a very ugly way of getting FPSR_DEFAULT.  struct ia64_fpreg is
     1.8 + * mysteriously declared in two places: /usr/include/asm/fpu.h and
     1.9 + * /usr/include/bits/sigcontext.h.  The former also defines FPSR_DEFAULT,
    1.10 + * the latter doesn't but is included (indirectly) by xg_private.h */
    1.11 +#define __ASSEMBLY__
    1.12 +#include <asm/fpu.h>
    1.13 +#undef __IA64_UL
    1.14 +#define __IA64_UL(x)           ((unsigned long)(x))
    1.15 +#undef __ASSEMBLY__
    1.16 +                                                                                
    1.17 +unsigned long xc_ia64_fpsr_default(void)
    1.18 +{
    1.19 +        return FPSR_DEFAULT;
    1.20 +}
    1.21 +
    1.22  int xc_linux_save(int xc_handle, int io_fd, uint32_t dom, uint32_t max_iters, 
    1.23                    uint32_t max_factor, uint32_t flags)
    1.24  {
     2.1 --- a/tools/libxc/xc_linux_build.c	Fri Nov 18 23:16:29 2005 -0600
     2.2 +++ b/tools/libxc/xc_linux_build.c	Sat Nov 19 15:41:08 2005 -0600
     2.3 @@ -278,7 +278,8 @@ static int setup_pg_tables_64(int xc_han
     2.4  #endif
     2.5  
     2.6  #ifdef __ia64__
     2.7 -#include <asm/fpu.h> /* for FPSR_DEFAULT */
     2.8 +extern unsigned long xc_ia64_fpsr_default(void);
     2.9 +
    2.10  static int setup_guest(int xc_handle,
    2.11                         uint32_t dom,
    2.12                         char *image, unsigned long image_size,
    2.13 @@ -780,7 +781,7 @@ int xc_linux_build(int xc_handle,
    2.14      ctxt->regs.cr_ipsr = 0; /* all necessary bits filled by hypervisor */
    2.15      ctxt->regs.cr_iip = vkern_entry;
    2.16      ctxt->regs.cr_ifs = 1UL << 63;
    2.17 -    ctxt->regs.ar_fpsr = FPSR_DEFAULT;
    2.18 +    ctxt->regs.ar_fpsr = xc_ia64_fpsr_default();
    2.19      /* currently done by hypervisor, should move here */
    2.20      /* ctxt->regs.r28 = dom_fw_setup(); */
    2.21      ctxt->vcpu.privregs = 0;