mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 08:06:11 +02:00
* InterLocked routines added
This commit is contained in:
parent
05aa164e57
commit
9aeb958a8e
65
rtl/i386/sysutilp.inc
Normal file
65
rtl/i386/sysutilp.inc
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
{
|
||||||
|
$Id$
|
||||||
|
This file is part of the Free Pascal run time library.
|
||||||
|
|
||||||
|
Copyright (c) 2001 by Florian Klaempfl
|
||||||
|
member of the Free Pascal development team
|
||||||
|
|
||||||
|
See the file COPYING.FPC, included in this distribution,
|
||||||
|
for details about the copyright.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
**********************************************************************}
|
||||||
|
|
||||||
|
{ ---------------------------------------------------------------------
|
||||||
|
This include contains cpu-specific routines
|
||||||
|
---------------------------------------------------------------------}
|
||||||
|
|
||||||
|
{$ASMMODE ATT}
|
||||||
|
|
||||||
|
function InterLockedDecrement (var Target: integer) : Integer; assembler;
|
||||||
|
asm
|
||||||
|
movl Target, %ecx
|
||||||
|
movl $-1, %eax
|
||||||
|
lock
|
||||||
|
xaddl %eax, (%ecx)
|
||||||
|
decl %eax
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function InterLockedIncrement (var Target: integer) : Integer; assembler;
|
||||||
|
asm
|
||||||
|
movl Target, %ecx
|
||||||
|
movl $1, %eax
|
||||||
|
lock
|
||||||
|
xaddl %eax, (%ecx)
|
||||||
|
incl %eax
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function InterLockedExchange (var Target: integer;Source : integer) : Integer; assembler;
|
||||||
|
asm
|
||||||
|
movl Target,%ecx
|
||||||
|
movl Source,%eax
|
||||||
|
xchgl %eax, (%ecx)
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function InterLockedExchangeAdd (var Target: integer;Source : integer) : Integer; assembler;
|
||||||
|
asm
|
||||||
|
movl Target,%ecx
|
||||||
|
movl Source,%eax
|
||||||
|
lock
|
||||||
|
xaddl %eax, (%ecx)
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
$Log$
|
||||||
|
Revision 1.1 2001-10-22 21:40:55 peter
|
||||||
|
* InterLocked routines added
|
||||||
|
|
||||||
|
}
|
@ -24,9 +24,17 @@ type
|
|||||||
|
|
||||||
{$endif HASINTF}
|
{$endif HASINTF}
|
||||||
|
|
||||||
|
function InterLockedIncrement (var Target: integer) : Integer;
|
||||||
|
function InterLockedDecrement (var Target: integer) : Integer;
|
||||||
|
function InterLockedExchange (var Target: integer;Source : integer) : Integer;
|
||||||
|
function InterLockedExchangeAdd (var Target: integer;Source : integer) : Integer;
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2001-08-22 21:19:16 florian
|
Revision 1.2 2001-10-22 21:40:55 peter
|
||||||
|
* InterLocked routines added
|
||||||
|
|
||||||
|
Revision 1.1 2001/08/22 21:19:16 florian
|
||||||
+ some new stuff of D6/Kylix added
|
+ some new stuff of D6/Kylix added
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
{ Read pchar handling functions implementation }
|
{ Read pchar handling functions implementation }
|
||||||
{$i syspch.inc}
|
{$i syspch.inc}
|
||||||
|
|
||||||
|
{ CPU Specific code }
|
||||||
|
{$i sysutilp.inc}
|
||||||
|
|
||||||
procedure FreeAndNil(var obj);
|
procedure FreeAndNil(var obj);
|
||||||
var
|
var
|
||||||
@ -328,7 +330,10 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.6 2001-08-19 21:02:02 florian
|
Revision 1.7 2001-10-22 21:40:55 peter
|
||||||
|
* InterLocked routines added
|
||||||
|
|
||||||
|
Revision 1.6 2001/08/19 21:02:02 florian
|
||||||
* fixed and added a lot of stuff to get the Jedi DX( headers
|
* fixed and added a lot of stuff to get the Jedi DX( headers
|
||||||
compiled
|
compiled
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user