# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1182458186 -3600
# Node ID 015d9abeacfb39c73c9aa488c2def2f66ab06e2b
# Parent b35b8053012e6b1720a392964bc7114ba30de420
i386: Simplify failsafe callback handling.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
xen/arch/x86/x86_32/entry.S | 14 +++-----------
xen/include/asm-x86/x86_32/asm_defns.h | 21 ++++++++++++---------
2 files changed, 15 insertions(+), 20 deletions(-)
diff -r b35b8053012e -r 015d9abeacfb xen/arch/x86/x86_32/entry.S
--- a/xen/arch/x86/x86_32/entry.S Thu Jun 21 18:02:50 2007 +0100
+++ b/xen/arch/x86/x86_32/entry.S Thu Jun 21 21:36:26 2007 +0100
@@ -99,17 +99,9 @@ restore_all_guest:
.Lrestore_iret_guest:
.Lft5: iret
.section .fixup,"ax"
-.Lfx1: subl $28,%esp
- pushl 28(%esp) # error_code/entry_vector
- movl %eax,UREGS_eax+4(%esp)
- movl %ebp,UREGS_ebp+4(%esp)
- movl %edi,UREGS_edi+4(%esp)
- movl %esi,UREGS_esi+4(%esp)
- movl %edx,UREGS_edx+4(%esp)
- movl %ecx,UREGS_ecx+4(%esp)
- movl %ebx,UREGS_ebx+4(%esp)
- sti
- popl %esi
+.Lfx1: sti
+ SAVE_ALL_GPRS
+ mov UREGS_error_code(%esp),%esi
pushfl # EFLAGS
movl $__HYPERVISOR_CS,%eax
pushl %eax # CS
diff -r b35b8053012e -r 015d9abeacfb xen/include/asm-x86/x86_32/asm_defns.h
--- a/xen/include/asm-x86/x86_32/asm_defns.h Thu Jun 21 18:02:50 2007 +0100
+++ b/xen/include/asm-x86/x86_32/asm_defns.h Thu Jun 21 21:36:26 2007 +0100
@@ -26,6 +26,17 @@ 1: addl $4,%esp;
#define ASSERT_INTERRUPTS_ENABLED ASSERT_INTERRUPT_STATUS(nz)
#define ASSERT_INTERRUPTS_DISABLED ASSERT_INTERRUPT_STATUS(z)
+#define SAVE_ALL_GPRS \
+ cld; \
+ pushl %eax; \
+ pushl %ebp; \
+ SETUP_EXCEPTION_FRAME_POINTER; \
+ pushl %edi; \
+ pushl %esi; \
+ pushl %edx; \
+ pushl %ecx; \
+ pushl %ebx
+
/*
* Saves all register state into an exception/interrupt stack frame.
* Returns to the caller at <xen_lbl> if the interrupted context is within
@@ -36,15 +47,7 @@ 1: addl $4,%esp;
* the caller is reponsible for validity of %ds/%es.
*/
#define SAVE_ALL(xen_lbl, vm86_lbl) \
- cld; \
- pushl %eax; \
- pushl %ebp; \
- SETUP_EXCEPTION_FRAME_POINTER; \
- pushl %edi; \
- pushl %esi; \
- pushl %edx; \
- pushl %ecx; \
- pushl %ebx; \
+ SAVE_ALL_GPRS; \
testl $(X86_EFLAGS_VM),UREGS_eflags(%esp); \
mov %ds,%edi; \
mov %es,%esi; \
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|