ia64/xen-unstable

changeset 16309:3e397fa3a6ad

x86_emulate: Allow to build outside Xen tree (in tools/test).
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Fri Nov 02 10:22:22 2007 +0000 (2007-11-02)
parents 055d98aa2dd0
children 46f91ed0f7d1
files xen/arch/x86/x86_emulate.c
line diff
     1.1 --- a/xen/arch/x86/x86_emulate.c	Fri Nov 02 10:16:37 2007 +0000
     1.2 +++ b/xen/arch/x86/x86_emulate.c	Fri Nov 02 10:22:22 2007 +0000
     1.3 @@ -262,6 +262,7 @@ struct operand {
     1.4  };
     1.5  
     1.6  /* EFLAGS bit definitions. */
     1.7 +#define EFLG_RF (1<<16)
     1.8  #define EFLG_OF (1<<11)
     1.9  #define EFLG_DF (1<<10)
    1.10  #define EFLG_IF (1<<9)
    1.11 @@ -287,9 +288,11 @@ struct operand {
    1.12  #if defined(__x86_64__)
    1.13  #define _LO32 "k"          /* force 32-bit operand */
    1.14  #define _STK  "%%rsp"      /* stack pointer */
    1.15 +#define _BYTES_PER_LONG "8"
    1.16  #elif defined(__i386__)
    1.17  #define _LO32 ""           /* force 32-bit operand */
    1.18  #define _STK  "%%esp"      /* stack pointer */
    1.19 +#define _BYTES_PER_LONG "4"
    1.20  #endif
    1.21  
    1.22  /*
    1.23 @@ -309,7 +312,7 @@ struct operand {
    1.24  "pushf; "                                                       \
    1.25  "notl %"_LO32 _tmp"; "                                          \
    1.26  "andl %"_LO32 _tmp",("_STK"); "                                 \
    1.27 -"andl %"_LO32 _tmp","STR(BITS_PER_LONG/4)"("_STK"); "           \
    1.28 +"andl %"_LO32 _tmp",2*"_BYTES_PER_LONG"("_STK"); "              \
    1.29  "pop  %"_tmp"; "                                                \
    1.30  "orl  %"_LO32 _tmp",("_STK"); "                                 \
    1.31  "popf; "                                                        \
    1.32 @@ -1630,7 +1633,7 @@ x86_emulate(
    1.33      }
    1.34  
    1.35      /* Commit shadow register state. */
    1.36 -    _regs.eflags &= ~EF_RF;
    1.37 +    _regs.eflags &= ~EFLG_RF;
    1.38      *ctxt->regs = _regs;
    1.39  
    1.40   done: