ia64/xen-unstable

changeset 15441:015d9abeacfb

i386: Simplify failsafe callback handling.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Jun 21 21:36:26 2007 +0100 (2007-06-21)
parents b35b8053012e
children 3f76b2f76c2a
files xen/arch/x86/x86_32/entry.S xen/include/asm-x86/x86_32/asm_defns.h
line diff
     1.1 --- a/xen/arch/x86/x86_32/entry.S	Thu Jun 21 18:02:50 2007 +0100
     1.2 +++ b/xen/arch/x86/x86_32/entry.S	Thu Jun 21 21:36:26 2007 +0100
     1.3 @@ -99,17 +99,9 @@ restore_all_guest:
     1.4  .Lrestore_iret_guest:
     1.5  .Lft5:  iret
     1.6  .section .fixup,"ax"
     1.7 -.Lfx1:  subl  $28,%esp
     1.8 -        pushl 28(%esp)                 # error_code/entry_vector
     1.9 -        movl  %eax,UREGS_eax+4(%esp)
    1.10 -        movl  %ebp,UREGS_ebp+4(%esp)
    1.11 -        movl  %edi,UREGS_edi+4(%esp)
    1.12 -        movl  %esi,UREGS_esi+4(%esp)
    1.13 -        movl  %edx,UREGS_edx+4(%esp)
    1.14 -        movl  %ecx,UREGS_ecx+4(%esp)
    1.15 -        movl  %ebx,UREGS_ebx+4(%esp)
    1.16 -        sti
    1.17 -        popl  %esi
    1.18 +.Lfx1:  sti
    1.19 +        SAVE_ALL_GPRS
    1.20 +        mov   UREGS_error_code(%esp),%esi
    1.21          pushfl                         # EFLAGS
    1.22          movl  $__HYPERVISOR_CS,%eax
    1.23          pushl %eax                     # CS
     2.1 --- a/xen/include/asm-x86/x86_32/asm_defns.h	Thu Jun 21 18:02:50 2007 +0100
     2.2 +++ b/xen/include/asm-x86/x86_32/asm_defns.h	Thu Jun 21 21:36:26 2007 +0100
     2.3 @@ -26,6 +26,17 @@ 1:      addl  $4,%esp;
     2.4  #define ASSERT_INTERRUPTS_ENABLED  ASSERT_INTERRUPT_STATUS(nz)
     2.5  #define ASSERT_INTERRUPTS_DISABLED ASSERT_INTERRUPT_STATUS(z)
     2.6  
     2.7 +#define SAVE_ALL_GPRS                                   \
     2.8 +        cld;                                            \
     2.9 +        pushl %eax;                                     \
    2.10 +        pushl %ebp;                                     \
    2.11 +        SETUP_EXCEPTION_FRAME_POINTER;                  \
    2.12 +        pushl %edi;                                     \
    2.13 +        pushl %esi;                                     \
    2.14 +        pushl %edx;                                     \
    2.15 +        pushl %ecx;                                     \
    2.16 +        pushl %ebx
    2.17 +
    2.18  /*
    2.19   * Saves all register state into an exception/interrupt stack frame.
    2.20   * Returns to the caller at <xen_lbl> if the interrupted context is within
    2.21 @@ -36,15 +47,7 @@ 1:      addl  $4,%esp;
    2.22   * the caller is reponsible for validity of %ds/%es.
    2.23   */
    2.24  #define SAVE_ALL(xen_lbl, vm86_lbl)                     \
    2.25 -        cld;                                            \
    2.26 -        pushl %eax;                                     \
    2.27 -        pushl %ebp;                                     \
    2.28 -        SETUP_EXCEPTION_FRAME_POINTER;                  \
    2.29 -        pushl %edi;                                     \
    2.30 -        pushl %esi;                                     \
    2.31 -        pushl %edx;                                     \
    2.32 -        pushl %ecx;                                     \
    2.33 -        pushl %ebx;                                     \
    2.34 +        SAVE_ALL_GPRS;                                  \
    2.35          testl $(X86_EFLAGS_VM),UREGS_eflags(%esp);      \
    2.36          mov   %ds,%edi;                                 \
    2.37          mov   %es,%esi;                                 \