Browse Source

* add nop after popa (merged)

peter 24 years ago
parent
commit
64b57cd77d
2 changed files with 16 additions and 11 deletions
  1. 10 10
      rtl/i386/i386.inc
  2. 6 1
      rtl/inc/heaptrc.pp

+ 10 - 10
rtl/i386/i386.inc

@@ -429,6 +429,8 @@ asm
         call    AsmGetMem
         call    AsmGetMem
         movl    $-1,8(%ebp)
         movl    $-1,8(%ebp)
         popal
         popal
+      { Avoid 80386DX bug }
+        nop
       { Memory position to %esi }
       { Memory position to %esi }
         movl    (%esi),%esi
         movl    (%esi),%esi
         addl    $4,%esp
         addl    $4,%esp
@@ -454,11 +456,7 @@ asm
         ret
         ret
 .LHC_7:
 .LHC_7:
       { set zero inside the object }
       { set zero inside the object }
-{        pushal - crashes the 386 CPU }
-        pushl   %eax
-        pushl   %edi
-        pushl   %ecx
-
+        pushal
         cld
         cld
         movl    (%eax),%ecx
         movl    (%eax),%ecx
         movl    %esi,%edi
         movl    %esi,%edi
@@ -471,9 +469,9 @@ asm
         movl    %ebx,%ecx
         movl    %ebx,%ecx
         rep
         rep
         stosb
         stosb
-        popl    %ecx
-        popl    %edi
-        popl    %eax
+        popal
+        { avoid the 80386DX bug }
+        nop
       { set the VMT address for the new created object }
       { set the VMT address for the new created object }
       { the offset is in %edi since the calling and has not been changed !! }
       { the offset is in %edi since the calling and has not been changed !! }
         movl    %eax,(%esi,%edi,1)
         movl    %eax,(%esi,%edi,1)
@@ -549,6 +547,8 @@ asm
         addl    $4,%esp
         addl    $4,%esp
 .LHD_3:
 .LHD_3:
         popal
         popal
+        { avoid the 80386DX bug }
+        nop
 end;
 end;
 
 
 
 
@@ -1116,8 +1116,8 @@ procedure inclocked(var l : longint);assembler;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.10  2001-04-16 11:22:53  peter
-    * merged popal fix
+  Revision 1.11  2001-04-21 12:18:09  peter
+    * add nop after popa (merged)
 
 
   Revision 1.9  2001/04/08 13:19:28  jonas
   Revision 1.9  2001/04/08 13:19:28  jonas
     * optimized FPC_HELP_CONSTRUCTOR a bit
     * optimized FPC_HELP_CONSTRUCTOR a bit

+ 6 - 1
rtl/inc/heaptrc.pp

@@ -837,6 +837,8 @@ begin
 _exit:
 _exit:
   asm
   asm
      popal
      popal
+     { avoid 386DX popad bug }
+     nop
   end;
   end;
 end;
 end;
 
 
@@ -1152,7 +1154,10 @@ finalization
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.11  2001-04-13 18:05:34  peter
+  Revision 1.12  2001-04-21 12:18:09  peter
+    * add nop after popa (merged)
+
+  Revision 1.11  2001/04/13 18:05:34  peter
     * win32 getenv version
     * win32 getenv version
 
 
   Revision 1.10  2001/04/13 01:18:08  peter
   Revision 1.10  2001/04/13 01:18:08  peter