[Openmcl-cvs-notifications] r10930 - /trunk/source/lisp-kernel/x86-asmutils32.s

gb at clozure.com gb at clozure.com
Tue Sep 30 20:08:46 EDT 2008


Author: gb
Date: Tue Sep 30 20:08:46 2008
New Revision: 10930

Log:
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.

Modified:
    trunk/source/lisp-kernel/x86-asmutils32.s

Modified: trunk/source/lisp-kernel/x86-asmutils32.s
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/source/lisp-kernel/x86-asmutils32.s (original)
+++ trunk/source/lisp-kernel/x86-asmutils32.s Tue Sep 30 20:08:46 2008
@@ -203,26 +203,26 @@
         __(movl win32_context.Edx(%ecx),%edx)
         __(movl win32_context.Ebx(%ecx),%ebx)
         __(movl win32_context.Eax(%ecx),%eax)
-        /* There's an iret frame in the context.  Point %esp at it */
-        __(lea win32_context.Eip(%ecx),%esp)
+        __(movl win32_context.Esp(%ecx),%esp)
+        __(pushl win32_context.Eip(%ecx))
 Xrestore_windows_context_load_rcx:                =

         __(movl win32_context.Ecx(%ecx),%ecx)
 Xrestore_windows_context_iret:            =

-        __(iretl)
+        __(ret)
 Xrestore_windows_context_end:             =

         __(nop)
 _endfn
 	=

 _exportfn(C(windows_switch_to_foreign_stack))
         __(pop %eax)
-        __(pop %ecx)            /* new %esp */
-        __(pop %edx)            /* handler */
+        __(pop %ebx)            /* new %esp */
+        __(pop %ecx)            /* handler */
         __(pop %edx)            /* arg */
-        __(movl %ecx,%esp)
+        __(movl %ebx,%esp)
         __(subl $0x10,%esp)
         __(movl %edx,(%esp))
         __(push %eax)
-        __(jmp *%edx)
+        __(jmp *%ecx)
 _endfn        =

 =

         .data



More information about the Openmcl-cvs-notifications mailing list