# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1206385240 0
# Node ID 4026a49fb0a0853d220b68a051c0a8164715cdbb
# Parent a792a0ca66e7b1b1d5e05a558491c23aa7390050
x86_emulate: Allow to build outside Xen tree (in tools/test).
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
xen-unstable changeset: 16309:3e397fa3a6adbe595b038c90179a390ede9ddede
xen-unstable date: Fri Nov 02 10:22:22 2007 +0000
---
xen/arch/x86/x86_emulate.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff -r a792a0ca66e7 -r 4026a49fb0a0 xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c Mon Mar 24 15:38:14 2008 +0000
+++ b/xen/arch/x86/x86_emulate.c Mon Mar 24 19:00:40 2008 +0000
@@ -24,6 +24,7 @@
#ifndef __XEN__
#include <stddef.h>
#include <stdint.h>
+#include <string.h>
#include <public/xen.h>
#else
#include <xen/config.h>
@@ -262,6 +263,7 @@ struct operand {
};
/* EFLAGS bit definitions. */
+#define EFLG_RF (1<<16)
#define EFLG_OF (1<<11)
#define EFLG_DF (1<<10)
#define EFLG_IF (1<<9)
@@ -287,9 +289,11 @@ struct operand {
#if defined(__x86_64__)
#define _LO32 "k" /* force 32-bit operand */
#define _STK "%%rsp" /* stack pointer */
+#define _BYTES_PER_LONG "8"
#elif defined(__i386__)
#define _LO32 "" /* force 32-bit operand */
#define _STK "%%esp" /* stack pointer */
+#define _BYTES_PER_LONG "4"
#endif
/*
@@ -309,7 +313,7 @@ struct operand {
"pushf; " \
"notl %"_LO32 _tmp"; " \
"andl %"_LO32 _tmp",("_STK"); " \
-"andl %"_LO32 _tmp","STR(BITS_PER_LONG/4)"("_STK"); " \
+"andl %"_LO32 _tmp",2*"_BYTES_PER_LONG"("_STK"); " \
"pop %"_tmp"; " \
"orl %"_LO32 _tmp",("_STK"); " \
"popf; " \
@@ -1643,7 +1647,7 @@ x86_emulate(
}
/* Commit shadow register state. */
- _regs.eflags &= ~EF_RF;
+ _regs.eflags &= ~EFLG_RF;
*ctxt->regs = _regs;
done:
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|