Fix x86/64 build.
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 8 Feb 2007 21:30:29 +0000 (21:30 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 8 Feb 2007 21:30:29 +0000 (21:30 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/x86_64/Makefile
xen/arch/x86/x86_64/compat/entry.S
xen/arch/x86/x86_64/entry.S

index 372cce5892c2608455a9ae4b38bfb8c70fd0f3f3..98f20a43c6e86a2a3e1f127adcf8ce21584d83ad 100644 (file)
@@ -1,3 +1,5 @@
+subdir-y += compat
+
 obj-y += entry.o
 obj-y += compat_kexec.o
 obj-y += gpr_switch.o
@@ -13,7 +15,6 @@ ifeq ($(CONFIG_COMPAT),y)
 # extra dependencies
 compat.o:      ../compat.c
 domctl.o:      ../domctl.c
-entry.o:       compat/entry.S
 mm.o:          compat/mm.c
 physdev.o:     ../physdev.c
 platform_hypercall.o: ../platform_hypercall.c
index 736ae2ac89330da953efc745a046ce74b311cc03..3f1d1b8d078f6da5a9b2d654a000b4fa7d4e918b 100644 (file)
@@ -2,10 +2,27 @@
  * Compatibility hypercall routines.
  */
 
+#include <xen/config.h>
+#include <xen/errno.h>
+#include <xen/softirq.h>
+#include <asm/asm_defns.h>
+#include <asm/apicdef.h>
+#include <asm/page.h>
 #include <asm/desc.h>
+#include <public/xen.h>
 
-.text
+#define GET_GUEST_REGS(reg)                     \
+        movq $~(STACK_SIZE-1),reg;              \
+        andq %rsp,reg;                          \
+        orq  $(STACK_SIZE-CPUINFO_sizeof),reg;
 
+#define GET_CURRENT(reg)         \
+        movq $STACK_SIZE-8, reg; \
+        orq  %rsp, reg;          \
+        andq $~7,reg;            \
+        movq (reg),reg;
+
+        ALIGN
 ENTRY(compat_hypercall)
         pushq $0
         movl  $TRAP_syscall,4(%rsp)
@@ -62,7 +79,7 @@ compat_skip_clobber:
         movl  %eax,UREGS_rax(%rsp)       # save the return value
 
 /* %rbx: struct vcpu */
-compat_test_all_events:
+ENTRY(compat_test_all_events)
         cli                             # tests must not race interrupts
 /*compat_test_softirqs:*/
         movl  VCPU_processor(%rbx),%eax
@@ -164,7 +181,7 @@ compat_failsafe_callback:
 .previous
 
 /* %rdx: trap_bounce, %rbx: struct vcpu */
-compat_post_handle_exception:
+ENTRY(compat_post_handle_exception)
         testb $TBF_EXCEPTION,TRAPBOUNCE_flags(%rdx)
         jz    compat_test_all_events
         call  compat_create_bounce_frame
index 8fa21a309d6c42bfa57b5f39cd9f181132688a36..36b5c5e1ad3122e40dbf77c43602067e63c67cff 100644 (file)
@@ -319,7 +319,7 @@ create_bounce_frame:
 domain_crash_synchronous_string:
         .asciz "domain_crash_sync called from entry.S\n"
 
-domain_crash_synchronous:
+ENTRY(domain_crash_synchronous)
         # Get out of the guest-save area of the stack.
         GET_GUEST_REGS(%rax)
         movq  %rax,%rsp
@@ -357,7 +357,7 @@ ENTRY(ret_from_intr)
 
         ALIGN
 /* No special register assumptions. */
-handle_exception:
+ENTRY(handle_exception)
         SAVE_ALL
         testb $X86_EFLAGS_IF>>8,UREGS_eflags+1(%rsp)
         jz    exception_with_ints_disabled
@@ -633,7 +633,3 @@ ENTRY(hypercall_args_table)
         .rept NR_hypercalls-(.-hypercall_args_table)
         .byte 0 /* do_ni_hypercall      */
         .endr
-
-#ifdef CONFIG_COMPAT
-#include "compat/entry.S"
-#endif