|
@@ -20,6 +20,7 @@
|
|
|
|
|
|
function InterLockedDecrement (var Target: longint) : longint; assembler;
|
|
function InterLockedDecrement (var Target: longint) : longint; assembler;
|
|
asm
|
|
asm
|
|
|
|
+ movl %rdi,%rax
|
|
movl $-1,%edx
|
|
movl $-1,%edx
|
|
xchgq %rdx,%rax
|
|
xchgq %rdx,%rax
|
|
lock
|
|
lock
|
|
@@ -30,6 +31,7 @@ end;
|
|
|
|
|
|
function InterLockedIncrement (var Target: longint) : longint; assembler;
|
|
function InterLockedIncrement (var Target: longint) : longint; assembler;
|
|
asm
|
|
asm
|
|
|
|
+ movl %rdi,%rax
|
|
movl $1,%edx
|
|
movl $1,%edx
|
|
xchgq %rdx,%rax
|
|
xchgq %rdx,%rax
|
|
lock
|
|
lock
|
|
@@ -40,23 +42,23 @@ end;
|
|
|
|
|
|
function InterLockedExchange (var Target: longint;Source : longint) : longint; assembler;
|
|
function InterLockedExchange (var Target: longint;Source : longint) : longint; assembler;
|
|
asm
|
|
asm
|
|
- xchgl (%rax),%edx
|
|
|
|
- movl %edx,%eax
|
|
|
|
|
|
+ xchgl (%rdi),%rsi
|
|
|
|
+ movl %rsi,%eax
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint; assembler;
|
|
function InterLockedExchangeAdd (var Target: longint;Source : longint) : longint; assembler;
|
|
asm
|
|
asm
|
|
- xchgq %rax,%rdx
|
|
|
|
|
|
+ xchgq %rdi,%rsi
|
|
lock
|
|
lock
|
|
- xaddl %eax, (%rdx)
|
|
|
|
|
|
+ xaddl %rdi, (%rsi)
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
{
|
|
{
|
|
$Log$
|
|
$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
|
|
Revision 1.2 2004/03/05 12:17:50 marco
|
|
* interlocked* changed to longints, including winapi. (which was a bug)
|
|
* interlocked* changed to longints, including winapi. (which was a bug)
|