@@ -101,16 +101,6 @@ void do_handle_exception(struct ex_regs *regs)
exit(7);
}
-#ifdef __x86_64__
-# define R "r"
-# define W "q"
-# define S "8"
-#else
-# define R "e"
-# define W "l"
-# define S "4"
-#endif
-
#define EX(NAME, N) extern char NAME##_fault; \
asm (".pushsection .text \n\t" \
#NAME"_fault: \n\t" \
@@ -3,12 +3,6 @@
#include "vm.h"
#include "desc.h"
-#ifdef __x86_64__
-# define R "r"
-#else
-# define R "e"
-#endif
-
extern char isr_entry_point[];
asm (
@@ -4,6 +4,17 @@
#include "libcflat.h"
#include <stdint.h>
+#ifdef __x86_64__
+# define R "r"
+# define W "q"
+# define S "8"
+#else
+# define R "e"
+# define W "l"
+# define S "4"
+#endif
+
+
struct descriptor_table_ptr {
u16 limit;
ulong base;
@@ -47,12 +47,6 @@ static unsigned int inl(unsigned short port)
static int nr_cpus;
-#ifdef __x86_64__
-# define R "r"
-#else
-# define R "e"
-#endif
-
static void cpuid_test(void)
{
asm volatile ("push %%"R "bx; cpuid; pop %%"R "bx"
These are necessary in many testcases that includes hand-written assembly, otherwise they will only run for either 32- or 64-bit. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- lib/x86/desc.c | 10 ---------- lib/x86/isr.c | 6 ------ lib/x86/processor.h | 11 +++++++++++ x86/vmexit.c | 6 ------ 4 files changed, 11 insertions(+), 22 deletions(-)