Changeset 10930


Ignore:
Timestamp:
Oct 1, 2008, 12:08:46 AM (11 years ago)
Author:
gb
Message:

The iret frame in the middle of the win32 context was too good to be
true: iretl doesn't restore ss:esp unless a change of privilege is
involved.

Some bugs in windows_switch_to_foreign_stack(), which might disappear
soon.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/x86-asmutils32.s

    r10922 r10930  
    204204        __(movl win32_context.Ebx(%ecx),%ebx)
    205205        __(movl win32_context.Eax(%ecx),%eax)
    206         /* There's an iret frame in the context.  Point %esp at it */
    207         __(lea win32_context.Eip(%ecx),%esp)
     206        __(movl win32_context.Esp(%ecx),%esp)
     207        __(pushl win32_context.Eip(%ecx))
    208208Xrestore_windows_context_load_rcx:               
    209209        __(movl win32_context.Ecx(%ecx),%ecx)
    210210Xrestore_windows_context_iret:           
    211         __(iretl)
     211        __(ret)
    212212Xrestore_windows_context_end:             
    213213        __(nop)
     
    216216_exportfn(C(windows_switch_to_foreign_stack))
    217217        __(pop %eax)
    218         __(pop %ecx)            /* new %esp */
    219         __(pop %edx)            /* handler */
     218        __(pop %ebx)            /* new %esp */
     219        __(pop %ecx)            /* handler */
    220220        __(pop %edx)            /* arg */
    221         __(movl %ecx,%esp)
     221        __(movl %ebx,%esp)
    222222        __(subl $0x10,%esp)
    223223        __(movl %edx,(%esp))
    224224        __(push %eax)
    225         __(jmp *%edx)
     225        __(jmp *%ecx)
    226226_endfn       
    227227
Note: See TracChangeset for help on using the changeset viewer.