Interrupts / Start using winedos handlers

Jukka Heinonen jhei at iki.fi
Fri Nov 1 14:16:31 CST 2002


This patch makes Wine use interrupt handlers declared in winedos for all
RM and PM interrupts. Now, what is left is copying interrupt handler code 
from msdos/* to dlls/winedos/* and removing duplicated stuff from msdos.

Files int12.c, int13.c, int1a.c, int2a.c, fpu.c, int41.c and int4b.c
could be directly copied to dlls/winedos if functions matching pattern
INT_Int??Handler are renamed to DOSVM_Int??Handler and the corresponsing 
functions are removed from dlls/winedos/interrupts.c. Files int2f.c and int15.c 
require only minor changes. Other interrupt handlers (dpmi.c, int11.c, int21.c, 
int25.c, int 26.c and int5c.c) require more work and some of them probably 
should be left to msdos.


Changelog:
  Start using winedos handlers for all interrupts.



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 19:51:51 -0000
@@ -135,7 +135,7 @@
   }
   else
   {
-    FARPROC16 addr = INT_GetPMHandler( intnum ); /* FIXME: DOSVM_GetPMHandler16 */
+    FARPROC16 addr = DOSVM_GetPMHandler16( intnum );
     WORD *stack = CTX_SEG_OFF_TO_LIN(context, context->SegSs, context->Esp);
     /* Push the flags and return address on the stack */
     *(--stack) = LOWORD(context->EFlags);




Index: dlls/winedos/dosvm.c
===================================================================
RCS file: /home/wine/wine/dlls/winedos/dosvm.c,v
retrieving revision 1.28
diff -u -r1.28 dosvm.c
--- dlls/winedos/dosvm.c        28 Oct 2002 23:51:27 -0000      1.28
+++ dlls/winedos/dosvm.c        1 Nov 2002 19:52:14 -0000
@@ -628,25 +628,6 @@
 
 #endif
 
-static const INTPROC real_mode_handlers[] =
-{
-    /* 00 */ 0, 0, 0, 0, 0, 0, 0, 0,
-    /* 08 */ 0, DOSVM_Int09Handler, 0, 0, 0, 0, 0, 0,
-    /* 10 */ DOSVM_Int10Handler, INT_Int11Handler, INT_Int12Handler, INT_Int13Handler,
-             0, INT_Int15Handler, DOSVM_Int16Handler, DOSVM_Int17Handler,
-    /* 18 */ 0, 0, INT_Int1aHandler, 0, 0, 0, 0, 0,
-    /* 20 */ DOSVM_Int20Handler, DOSVM_Int21Handler, 0, 0, 0, INT_Int25Handler, 0, 0,
-    /* 28 */ 0, DOSVM_Int29Handler, INT_Int2aHandler, 0, 0, 0, 0, INT_Int2fHandler,
-    /* 30 */ 0, DOSVM_Int31Handler, 0, DOSVM_Int33Handler, INT_Int34Handler, INT_Int35Handler, INT_Int36Handler, INT_Int37Handler,
-    /* 38 */ INT_Int38Handler, INT_Int39Handler, INT_Int3aHandler, INT_Int3bHandler, INT_Int3cHandler, INT_Int3dHandler, INT_Int3eHandler, 0,
-    /* 40 */ 0, 0, 0, 0, 0, 0, 0, 0,
-    /* 48 */ 0, 0, 0, 0, 0, 0, 0, 0,
-    /* 50 */ 0, 0, 0, 0, 0, 0, 0, 0,
-    /* 58 */ 0, 0, 0, 0, 0, 0, 0, 0,
-    /* 60 */ 0, 0, 0, 0, 0, 0, 0, DOSVM_Int67Handler
-};
-
-
 /**********************************************************************
  *         DOSVM_RealModeInterrupt
  *
@@ -654,16 +635,8 @@
  */
 void DOSVM_RealModeInterrupt( BYTE intnum, CONTEXT86 *context )
 {
-    if (intnum < sizeof(real_mode_handlers)/sizeof(INTPROC) && real_mode_handlers[intnum])
-        (*real_mode_handlers[intnum])(context);
-    else
-    {
-        FIXME("Unknown Interrupt in DOS mode: 0x%x\n", intnum);
-        FIXME("    eax=%08lx ebx=%08lx ecx=%08lx edx=%08lx\n",
-              context->Eax, context->Ebx, context->Ecx, context->Edx);
-        FIXME("    esi=%08lx edi=%08lx ds=%04lx es=%04lx\n",
-              context->Esi, context->Edi, context->SegDs, context->SegEs );
-    }
+    INTPROC proc = DOSVM_GetBuiltinHandler( intnum );
+    proc(context);
 }
 
 


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



More information about the wine-patches mailing list