]> xenbits.xensource.com Git - xen.git/commitdiff
x86emul/test: use x86-vendors.h
authorWei Liu <wei.liu2@citrix.com>
Mon, 30 Jan 2017 12:55:45 +0000 (12:55 +0000)
committerWei Liu <wei.liu2@citrix.com>
Mon, 6 Feb 2017 10:15:49 +0000 (10:15 +0000)
No functional change.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
tools/fuzz/x86_instruction_emulator/Makefile
tools/tests/x86_emulator/Makefile
tools/tests/x86_emulator/x86_emulate.h

index fbfbd4673ff8cf604c0731cdf417cf92524411da..9724443588c35778190b7b3b54f58bad85d65d6c 100644 (file)
@@ -11,12 +11,16 @@ endif
 x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h:
        [ -L x86_emulate ] || ln -sf $(XEN_ROOT)/xen/arch/x86/x86_emulate .
 
+asm/x86-vendors.h:
+       [ -L asm ] || ln -sf $(XEN_ROOT)/xen/include/asm-x86 asm
+
 x86_emulate.c x86_emulate.h: %:
        [ -L $* ] || ln -sf $(XEN_ROOT)/tools/tests/x86_emulator/$*
 
-CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__
+CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -I.
 
-x86_emulate.h := x86_emulate.h x86_emulate/x86_emulate.h
+x86.h := asm/x86-vendors.h
+x86_emulate.h := x86_emulate.h x86_emulate/x86_emulate.h $(x86.h)
 
 x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c $(x86_emulate.h)
 
@@ -33,7 +37,7 @@ all: x86-instruction-emulator-fuzzer-all
 
 .PHONY: distclean
 distclean: clean
-       rm -f x86_emulate x86_emulate.c x86_emulate.h
+       rm -f x86_emulate x86_emulate.c x86_emulate.h asm
 
 .PHONY: clean
 clean:
index b489959d1d65fe1bc96167cb76d5528a2e4849e3..9becc224076f62b20c8ad57e32ea39e6529bf224 100644 (file)
@@ -32,7 +32,7 @@ $(TARGET): x86_emulate.o test_x86_emulator.o
 
 .PHONY: clean
 clean:
-       rm -rf $(TARGET) *.o *~ core blowfish.h blowfish.bin x86_emulate
+       rm -rf $(TARGET) *.o *~ core blowfish.h blowfish.bin x86_emulate asm
 
 .PHONY: distclean
 distclean: clean
@@ -43,9 +43,13 @@ install:
 x86_emulate/x86_emulate.c x86_emulate/x86_emulate.h:
        [ -L x86_emulate ] || ln -sf $(XEN_ROOT)/xen/arch/x86/x86_emulate .
 
-HOSTCFLAGS += $(CFLAGS_xeninclude)
+asm/x86-vendors.h:
+       [ -L asm ] || ln -sf $(XEN_ROOT)/xen/include/asm-x86 asm
 
-x86_emulate.h := x86_emulate.h x86_emulate/x86_emulate.h
+HOSTCFLAGS += $(CFLAGS_xeninclude) -I.
+
+x86.h := asm/x86-vendors.h
+x86_emulate.h := x86_emulate.h x86_emulate/x86_emulate.h $(x86.h)
 
 x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c $(x86_emulate.h)
        $(HOSTCC) $(HOSTCFLAGS) -D__XEN_TOOLS__ -c -g -o $@ $<
index 3a6badee46a7d254ba5eb7122a233e3f7693eba1..db287004e68eac76f139887b5d342edb004228e9 100644 (file)
@@ -6,6 +6,8 @@
 #include <string.h>
 #include <xen/xen.h>
 
+#include <asm/x86-vendors.h>
+
 #define BUG() abort()
 #define ASSERT assert
 #define ASSERT_UNREACHABLE() assert(!__LINE__)
 
 #define is_canonical_address(x) (((int64_t)(x) >> 47) == ((int64_t)(x) >> 63))
 
-/* There's no strict need for these to be in sync with processor.h. */
-#define X86_VENDOR_INTEL   0
-#define X86_VENDOR_AMD     2
-#define X86_VENDOR_UNKNOWN 0xff
-
 #define MMAP_SZ 16384
 bool emul_test_make_stack_executable(void);