Interrupts / Fix 32-bit eflags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The previous 32->16 PM interrupt conversion routines used iretd.
This did work fine except that interrupt routines could not
return modified eflags back to application. This has been fixed
by making conversion routines use far return.


Changelog:
  When returning from 32-bit default interrupt handlers, 
  eflags are now returned correctly.


Index: msdos/dosmem.c
===================================================================
RCS file: /home/wine/wine/msdos/dosmem.c,v
retrieving revision 1.43
diff -u -r1.43 dosmem.c
--- msdos/dosmem.c      8 Oct 2002 00:35:03 -0000       1.43
+++ msdos/dosmem.c      1 Nov 2002 22:15:58 -0000
@@ -212,19 +212,21 @@
     memcpy( ptr, enter_pm, sizeof(enter_pm) );
     DOSMEM_dpmi_segments.dpmi_sel = SELECTOR_AllocBlock( ptr, sizeof(enter_pm), WINE_LDT_FLAGS_CODE );
 
-    ptr = DOSMEM_GetBlock( 4 * 256, &DOSMEM_dpmi_segments.int48_seg );
+    ptr = DOSMEM_GetBlock( 6 * 256, &DOSMEM_dpmi_segments.int48_seg );
     for(i=0; i<256; i++) {
         /*
-         * Each 32-bit interrupt handler is 4 bytes:
-         * 0xCD,<i>  = int <i> (nested 16-bit interrupt)
-         * 0x66,0xCF = iretd   (32-bit interrupt return)
+         * Each 32-bit interrupt handler is 6 bytes:
+         * 0xCD,<i>            = int <i> (nested 16-bit interrupt)
+         * 0x66,0xCA,0x04,0x00 = ret 4   (32-bit far return and pop 4 bytes)
          */
-        ptr[i * 4 + 0] = 0xCD;
-        ptr[i * 4 + 1] = i;
-        ptr[i * 4 + 2] = 0x66;
-        ptr[i * 4 + 3] = 0xCF;
+        ptr[i * 6 + 0] = 0xCD;
+        ptr[i * 6 + 1] = i;
+        ptr[i * 6 + 2] = 0x66;
+        ptr[i * 6 + 3] = 0xCA;
+        ptr[i * 6 + 4] = 0x04;
+        ptr[i * 6 + 5] = 0x00;
     }
-    DOSMEM_dpmi_segments.int48_sel = SELECTOR_AllocBlock( ptr, 4 * 256, WINE_LDT_FLAGS_CODE );
+    DOSMEM_dpmi_segments.int48_sel = SELECTOR_AllocBlock( ptr, 6 * 256, WINE_LDT_FLAGS_CODE );
 }
 
 static BIOSDATA * DOSMEM_BiosData(void)



Index: dlls/winedos/interrupts.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/interrupts.c,v
retrieving revision 1.3
diff -u -r1.3 interrupts.c
--- dlls/winedos/interrupts.c   29 Oct 2002 23:09:30 -0000      1.3
+++ dlls/winedos/interrupts.c   1 Nov 2002 22:16:42 -0000
@@ -232,7 +232,7 @@
   if (!DOSVM_Vectors48[intnum].selector)
   {
     DOSVM_Vectors48[intnum].selector = DOSVM_dpmi_segments->int48_sel;
-    DOSVM_Vectors48[intnum].offset = 4 * intnum;
+    DOSVM_Vectors48[intnum].offset = 6 * intnum;
   }
   return DOSVM_Vectors48[intnum];
 }


-- 
Jukka Heinonen <http://www.iki.fi/jhei/>


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux