Browse Source

* another fix for locked reference counting

florian 21 years ago
parent
commit
90f7f25d03
2 changed files with 14 additions and 9 deletions
  1. 8 6
      rtl/x86_64/sysutilp.inc
  2. 6 3
      rtl/x86_64/x86_64.inc

+ 8 - 6
rtl/x86_64/sysutilp.inc

@@ -20,6 +20,7 @@
 
 function InterLockedDecrement (var Target: longint) : longint; assembler;
 asm
+        movl    %rdi,%rax
         movl		  $-1,%edx
         xchgq   %rdx,%rax
         lock
@@ -30,6 +31,7 @@ end;
 
 function InterLockedIncrement (var Target: longint) : longint; assembler;
 asm
+        movl    %rdi,%rax
         movl    $1,%edx
         xchgq   %rdx,%rax
         lock
@@ -40,23 +42,23 @@ end;
 
 function InterLockedExchange (var Target: longint;Source : longint) : longint; assembler;
 asm
-        xchgl   (%rax),%edx
-        movl    %edx,%eax
+        xchgl   (%rdi),%rsi
+        movl    %rsi,%eax
 end;
 
 
 function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint; assembler;
 asm
-        xchgq   %rax,%rdx
+        xchgq   %rdi,%rsi
         lock
-        xaddl   %eax, (%rdx)
+        xaddl   %rdi, (%rsi)
 end;
 
 
 {
   $Log$
-  Revision 1.3  2004-11-01 19:10:52  florian
-    * Interlocked* fixed
+  Revision 1.4  2004-11-01 20:31:35  florian
+    * another fix for locked reference counting
 
   Revision 1.2  2004/03/05 12:17:50  marco
    * interlocked* changed to longints, including winapi. (which was a bug)

+ 6 - 3
rtl/x86_64/x86_64.inc

@@ -318,7 +318,7 @@ procedure inclocked(var l : int64);assembler;
      incq       (%rdi)
      jmp        .Linclockedend
 .Linclockednolock:
-     incl       (%rdi)
+     incq       (%rdi)
 .Linclockedend:
   end;
 
@@ -348,7 +348,10 @@ end;
 
 {
   $Log$
-  Revision 1.13  2004-06-05 07:55:22  peter
+  Revision 1.14  2004-11-01 20:31:35  florian
+    * another fix for locked reference counting
+
+  Revision 1.13  2004/06/05 07:55:22  peter
     * fixed parameters of get_caller_*()
 
   Revision 1.12  2004/05/01 15:59:17  florian
@@ -386,4 +389,4 @@ end;
 
   Revision 1.1  2003/01/06 19:40:18  florian
     + initial revision
-}
+}