Skip to content
Snippets Groups Projects
Commit a3d1fb55 authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

x86: move size #defines to processor.h


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: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 0a44f220
No related branches found
No related tags found
No related merge requests found
...@@ -101,16 +101,6 @@ void do_handle_exception(struct ex_regs *regs) ...@@ -101,16 +101,6 @@ void do_handle_exception(struct ex_regs *regs)
exit(7); 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; \ #define EX(NAME, N) extern char NAME##_fault; \
asm (".pushsection .text \n\t" \ asm (".pushsection .text \n\t" \
#NAME"_fault: \n\t" \ #NAME"_fault: \n\t" \
......
...@@ -3,12 +3,6 @@ ...@@ -3,12 +3,6 @@
#include "vm.h" #include "vm.h"
#include "desc.h" #include "desc.h"
#ifdef __x86_64__
# define R "r"
#else
# define R "e"
#endif
extern char isr_entry_point[]; extern char isr_entry_point[];
asm ( asm (
......
...@@ -4,6 +4,17 @@ ...@@ -4,6 +4,17 @@
#include "libcflat.h" #include "libcflat.h"
#include <stdint.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 { struct descriptor_table_ptr {
u16 limit; u16 limit;
ulong base; ulong base;
......
...@@ -47,12 +47,6 @@ static unsigned int inl(unsigned short port) ...@@ -47,12 +47,6 @@ static unsigned int inl(unsigned short port)
static int nr_cpus; static int nr_cpus;
#ifdef __x86_64__
# define R "r"
#else
# define R "e"
#endif
static void cpuid_test(void) static void cpuid_test(void)
{ {
asm volatile ("push %%"R "bx; cpuid; pop %%"R "bx" asm volatile ("push %%"R "bx; cpuid; pop %%"R "bx"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment