瀏覽代碼

* patch from Vinzent Hoefler with first go32v2 fixes

git-svn-id: trunk@152 -
florian 20 年之前
父節點
當前提交
7e1546243e
共有 3 個文件被更改,包括 7 次插入2 次删除
  1. 1 1
      rtl/go32v2/dpmiexcp.pp
  2. 2 1
      rtl/go32v2/go32.pp
  3. 4 0
      rtl/go32v2/sysos.inc

+ 1 - 1
rtl/go32v2/dpmiexcp.pp

@@ -240,7 +240,7 @@ var
 const
   int31error : word = 0;
 
-    procedure test_int31(flag : longint);
+    procedure test_int31(flag : longint); stdcall; { stack-args! }
       begin
          asm
             pushl %ebx

+ 2 - 1
rtl/go32v2/go32.pp

@@ -219,7 +219,7 @@ interface
       end;
 
 
-    procedure test_int31(flag : longint);
+    procedure test_int31(flag : longint); stdcall; { stack-args! }
       begin
          asm
             pushl %ebx
@@ -277,6 +277,7 @@ interface
       begin
          regs.realsp:=0;
          regs.realss:=0;
+         regs.realres:=0; { play it safe }
          asm
             { save all used registers to avoid crash under NTVDM }
             { when spawning a 32-bit DPMI application            }

+ 4 - 0
rtl/go32v2/sysos.inc

@@ -265,14 +265,18 @@ procedure sysrealintr(intnr : word;var regs : trealregs);
 begin
    regs.realsp:=0;
    regs.realss:=0;
+   regs.realres:=0; { spec says so, play it safe }
    asm
       pushl %ebx
       pushl %edi
+      pushl %fs   // Go32.RealIntr does it too (NTVDM bug),
+                  // "pushl" to avoid size prefix
       movw  intnr,%bx
       xorl  %ecx,%ecx
       movl  regs,%edi
       movw  $0x300,%ax
       int   $0x31
+      popl  %fs
       popl  %edi
       popl  %ebx
    end;