2003-08-11 Casper S. Hornstrup <chorns@users.sourceforge.net>
[reactos.git] / reactos / ntoskrnl / ke / i386 / v86m_sup.S
index 0ee3663..a9c7190 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include <internal/v86m.h>
-#include <ddk/i386/tss.h>
+#include <ntos/tss.h>
 #include <internal/trap.h>
 #include <internal/ps.h>
                        
@@ -144,11 +144,13 @@ _KiV86Complete:
        popl    KV86M_REGISTERS_ECX(%ebx)
        popl    KV86M_REGISTERS_EAX(%ebx)
 
-       /* Ignore the previous mode */
-       addl    $4, %esp
+       /* Restore the old previous mode */
+       popl    %eax
+       movb    %al, %ss:KTHREAD_PREVIOUS_MODE(%esi)
 
-       /* Ignore old exception handler list */
-       addl    $4, %esp
+       /* Restore the old exception handler list */
+       popl    %eax
+       movl    %eax, %fs:KPCR_EXCEPTION_LIST
        
        /* Ignore the 32-bit fs register */
        addl    $4, %esp