Browse Source

* fixed some x86-64 multithreading stuff

florian 21 years ago
parent
commit
041dfe7b99
2 changed files with 18 additions and 11 deletions
  1. 6 3
      rtl/inc/threadvr.inc
  2. 12 8
      rtl/x86_64/sysutilp.inc

+ 6 - 3
rtl/inc/threadvr.inc

@@ -29,9 +29,9 @@ type
      size    : longint;
   end;
 
-  TltvInitTablesTable = record
+  TltvInitTablesTable = packed record
     count  : dword;
-    tables : array [1..32767] of pltvInitEntry;
+    tables : packed array [1..32767] of pltvInitEntry;
   end;
 
 var
@@ -102,7 +102,10 @@ end;
 
 {
   $Log$
-  Revision 1.2  2003-11-26 20:10:59  michael
+  Revision 1.3  2004-11-01 20:37:49  florian
+    * fixed some x86-64 multithreading stuff
+
+  Revision 1.2  2003/11/26 20:10:59  michael
   + New threadmanager implementation
 
   Revision 1.1  2002/10/31 13:46:11  carl

+ 12 - 8
rtl/x86_64/sysutilp.inc

@@ -20,8 +20,8 @@
 
 function InterLockedDecrement (var Target: longint) : longint; assembler;
 asm
-        movl    %rdi,%rax
-        movl		  $-1,%edx
+        movq    %rdi,%rax
+        movl    $-1,%edx
         xchgq   %rdx,%rax
         lock
         xaddl   %eax, (%rdx)
@@ -31,7 +31,7 @@ end;
 
 function InterLockedIncrement (var Target: longint) : longint; assembler;
 asm
-        movl    %rdi,%rax
+        movq    %rdi,%rax
         movl    $1,%edx
         xchgq   %rdx,%rax
         lock
@@ -42,8 +42,8 @@ end;
 
 function InterLockedExchange (var Target: longint;Source : longint) : longint; assembler;
 asm
-        xchgl   (%rdi),%rsi
-        movl    %rsi,%eax
+        xchgl   (%rdi),%esi
+        movl    %esi,%eax
 end;
 
 
@@ -51,13 +51,17 @@ function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint
 asm
         xchgq   %rdi,%rsi
         lock
-        xaddl   %rdi, (%rsi)
+        xaddl   %edi, (%rsi)
+	movl	%edi,%eax
 end;
 
 
 {
   $Log$
-  Revision 1.4  2004-11-01 20:31:35  florian
+  Revision 1.5  2004-11-01 20:37:49  florian
+    * fixed some x86-64 multithreading stuff
+
+  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
@@ -66,4 +70,4 @@ end;
   Revision 1.1  2004/02/20 22:15:16  florian
     + x86_64 dependend sysutils part added
     * some 64 bit adaptions
-}
+}