winedos / Fix DOSVM_Wait

Jukka Heinonen jhei at iki.fi
Wed Jun 4 15:01:47 CDT 2003


Well, well. Sometimes the correct fix is simply too easy.




Changelog:
  Pending timer interrupts no longer deadlock DOSVM_Wait.
  Restored interrupt priorities to correct values.




Index: dlls/winedos/dosexe.h
===================================================================
RCS file: /home/wine/wine/dlls/winedos/dosexe.h,v
retrieving revision 1.25
diff -u -r1.25 dosexe.h
--- dlls/winedos/dosexe.h	2 May 2003 20:12:52 -0000	1.25
+++ dlls/winedos/dosexe.h	4 Jun 2003 19:54:59 -0000
@@ -75,8 +75,8 @@
 typedef void (WINAPI *RMCBPROC)(CONTEXT86*);
 typedef void (WINAPI *INTPROC)(CONTEXT86*);
 
-#define DOS_PRIORITY_REALTIME 1  /* IRQ0 - FIXME: should be 0 */
-#define DOS_PRIORITY_KEYBOARD 0  /* IRQ1 - FIXME: should be 1 */
+#define DOS_PRIORITY_REALTIME 0  /* IRQ0 */
+#define DOS_PRIORITY_KEYBOARD 1  /* IRQ1 */
 #define DOS_PRIORITY_VGA      2  /* IRQ9 */
 #define DOS_PRIORITY_MOUSE    5  /* IRQ12 */
 #define DOS_PRIORITY_SERIAL   10 /* IRQ4 */




Index: dlls/winedos/dosvm.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/dosvm.c,v
retrieving revision 1.36
diff -u -r1.36 dosvm.c
--- dlls/winedos/dosvm.c	4 May 2003 02:25:21 -0000	1.36
+++ dlls/winedos/dosvm.c	4 Jun 2003 19:55:04 -0000
@@ -272,16 +272,18 @@
     {
         /*
          * FIXME: This does not work in protected mode DOS programs.
-         * FIXME: If we have pending IRQ which has 16-bit handler,
-         *        DOSVM_SendQueuedEvents may stuck in which case application
-         *        deadlocks. This is why keyboard events must have top 
-         *        priority (default timer IRQ handler is 16-bit code).
          * FIXME: Critical section locking is broken.
          */
         CONTEXT86 context = *waitctx;
         IF_SET(&context);
         SET_PEND(&context);
+        context.SegCs = 0;
+        context.Eip = 0;
+
         DOSVM_SendQueuedEvents(&context);
+
+        if(context.SegCs || context.Eip)
+            DPMI_CallRMProc( &context, NULL, 0, TRUE );
     }
     else
     {




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



More information about the wine-patches mailing list