mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 15:32:21 +02:00
+ x86_64 dependend sysutils part added
* some 64 bit adaptions
This commit is contained in:
parent
c844c5a505
commit
ff42d8657a
@ -176,6 +176,7 @@ Type
|
|||||||
|
|
||||||
{$ifdef CPU64}
|
{$ifdef CPU64}
|
||||||
StrLenInt = Int64;
|
StrLenInt = Int64;
|
||||||
|
StrLenUInt = QWord;
|
||||||
SizeInt = Int64;
|
SizeInt = Int64;
|
||||||
SizeUInt = QWord;
|
SizeUInt = QWord;
|
||||||
PtrInt = Int64;
|
PtrInt = Int64;
|
||||||
@ -184,6 +185,7 @@ Type
|
|||||||
|
|
||||||
{$ifdef CPU32}
|
{$ifdef CPU32}
|
||||||
StrLenInt = Longint;
|
StrLenInt = Longint;
|
||||||
|
StrLenUInt = DWord;
|
||||||
SizeInt = Longint;
|
SizeInt = Longint;
|
||||||
SizeUInt = DWord;
|
SizeUInt = DWord;
|
||||||
PtrInt = Longint;
|
PtrInt = Longint;
|
||||||
@ -726,7 +728,11 @@ const
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.85 2004-02-20 11:01:20 daniel
|
Revision 1.86 2004-02-20 22:15:16 florian
|
||||||
|
+ x86_64 dependend sysutils part added
|
||||||
|
* some 64 bit adaptions
|
||||||
|
|
||||||
|
Revision 1.85 2004/02/20 11:01:20 daniel
|
||||||
* Applied
|
* Applied
|
||||||
|
|
||||||
Revision 1.84 2004/02/02 20:39:27 florian
|
Revision 1.84 2004/02/02 20:39:27 florian
|
||||||
|
@ -85,8 +85,8 @@ end ;
|
|||||||
{ StrPLCopy copies MaxLen or less characters from the pascal string
|
{ StrPLCopy copies MaxLen or less characters from the pascal string
|
||||||
Source to Dest and returns Dest }
|
Source to Dest and returns Dest }
|
||||||
|
|
||||||
function StrPLCopy(Dest: PChar; Source: string; MaxLen: cardinal): PChar;
|
function StrPLCopy(Dest: PChar; Source: string; MaxLen: strlenuint): PChar;
|
||||||
var Count: cardinal;
|
var Count: strlenuint;
|
||||||
begin
|
begin
|
||||||
result := Dest;
|
result := Dest;
|
||||||
if (Result <> Nil) and (MaxLen <> 0) then begin
|
if (Result <> Nil) and (MaxLen <> 0) then begin
|
||||||
@ -112,17 +112,21 @@ end;
|
|||||||
|
|
||||||
{ StrBufSize returns the amount of memory allocated for pchar Str allocated with StrAlloc }
|
{ StrBufSize returns the amount of memory allocated for pchar Str allocated with StrAlloc }
|
||||||
|
|
||||||
function StrBufSize(Str: PChar): cardinal;
|
function StrBufSize(Str: PChar): strlenuint;
|
||||||
begin
|
begin
|
||||||
if Str <> Nil then
|
if Str <> Nil then
|
||||||
result := cardinal(pointer(Str - SizeOf(cardinal))^)-sizeof(cardinal)
|
result := strlenuint(pointer(Str - SizeOf(strlenuint))^)-sizeof(strlenuint)
|
||||||
else
|
else
|
||||||
result := 0;
|
result := 0;
|
||||||
end ;
|
end ;
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2003-10-06 21:01:06 peter
|
Revision 1.2 2004-02-20 22:15:16 florian
|
||||||
|
+ x86_64 dependend sysutils part added
|
||||||
|
* some 64 bit adaptions
|
||||||
|
|
||||||
|
Revision 1.1 2003/10/06 21:01:06 peter
|
||||||
* moved classes unit to rtl
|
* moved classes unit to rtl
|
||||||
|
|
||||||
Revision 1.8 2003/09/06 21:52:24 marco
|
Revision 1.8 2003/09/06 21:52:24 marco
|
||||||
|
@ -22,36 +22,40 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
{ shared with strings unit }
|
{ shared with strings unit }
|
||||||
function strlen(p : pchar) : longint;
|
function strlen(p : pchar) : strlenint;
|
||||||
function strcopy(dest,source : pchar) : pchar;
|
function strcopy(dest,source : pchar) : pchar;
|
||||||
function strlcopy(dest,source : pchar;maxlen : longint) : pchar;
|
function strlcopy(dest,source : pchar;maxlen : strlenint) : pchar;
|
||||||
function strecopy(dest,source : pchar) : pchar;
|
function strecopy(dest,source : pchar) : pchar;
|
||||||
function strend(p : pchar) : pchar;
|
function strend(p : pchar) : pchar;
|
||||||
function strcat(dest,source : pchar) : pchar;
|
function strcat(dest,source : pchar) : pchar;
|
||||||
function strcomp(str1,str2 : pchar) : longint;
|
function strcomp(str1,str2 : pchar) : strlenint;
|
||||||
function strlcomp(str1,str2 : pchar;l : longint) : longint;
|
function strlcomp(str1,str2 : pchar;l : strlenint) : strlenint;
|
||||||
function stricomp(str1,str2 : pchar) : longint;
|
function stricomp(str1,str2 : pchar) : strlenint;
|
||||||
function strmove(dest,source : pchar;l : longint) : pchar;
|
function strmove(dest,source : pchar;l : strlenint) : pchar;
|
||||||
function strlcat(dest,source : pchar;l : longint) : pchar;
|
function strlcat(dest,source : pchar;l : strlenint) : pchar;
|
||||||
function strscan(p : pchar;c : char) : pchar;
|
function strscan(p : pchar;c : char) : pchar;
|
||||||
function strrscan(p : pchar;c : char) : pchar;
|
function strrscan(p : pchar;c : char) : pchar;
|
||||||
function strlower(p : pchar) : pchar;
|
function strlower(p : pchar) : pchar;
|
||||||
function strupper(p : pchar) : pchar;
|
function strupper(p : pchar) : pchar;
|
||||||
function strlicomp(str1,str2 : pchar;l : longint) : longint;
|
function strlicomp(str1,str2 : pchar;l : strlenint) : strlenint;
|
||||||
function strpos(str1,str2 : pchar) : pchar;
|
function strpos(str1,str2 : pchar) : pchar;
|
||||||
function strnew(p : pchar) : pchar;
|
function strnew(p : pchar) : pchar;
|
||||||
|
|
||||||
{ Different from strings unit - ansistrings or different behaviour }
|
{ Different from strings unit - ansistrings or different behaviour }
|
||||||
function StrPas(Str: PChar): string;
|
function StrPas(Str: PChar): string;
|
||||||
function StrPCopy(Dest: PChar; Source: string): PChar;
|
function StrPCopy(Dest: PChar; Source: string): PChar;
|
||||||
function StrPLCopy(Dest: PChar; Source: string; MaxLen: cardinal): PChar;
|
function StrPLCopy(Dest: PChar; Source: string; MaxLen: strlenuint): PChar;
|
||||||
function StrAlloc(Size: cardinal): PChar;
|
function StrAlloc(Size: cardinal): PChar;
|
||||||
function StrBufSize(Str: PChar): cardinal;
|
function StrBufSize(Str: PChar): strlenuint;
|
||||||
procedure StrDispose(Str: PChar);
|
procedure StrDispose(Str: PChar);
|
||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.1 2003-10-06 21:01:06 peter
|
Revision 1.2 2004-02-20 22:15:16 florian
|
||||||
|
+ x86_64 dependend sysutils part added
|
||||||
|
* some 64 bit adaptions
|
||||||
|
|
||||||
|
Revision 1.1 2003/10/06 21:01:06 peter
|
||||||
* moved classes unit to rtl
|
* moved classes unit to rtl
|
||||||
|
|
||||||
Revision 1.3 2002/09/07 16:01:22 peter
|
Revision 1.3 2002/09/07 16:01:22 peter
|
||||||
|
61
rtl/x86_64/sysutilp.inc
Normal file
61
rtl/x86_64/sysutilp.inc
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
{
|
||||||
|
$Id$
|
||||||
|
This file is part of the Free Pascal run time library.
|
||||||
|
|
||||||
|
Copyright (c) 2004 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
|
||||||
|
---------------------------------------------------------------------}
|
||||||
|
|
||||||
|
function InterLockedDecrement (var Target: integer) : Integer; assembler;
|
||||||
|
asm
|
||||||
|
movl $-1,%edx
|
||||||
|
xchgl %edx,%eax
|
||||||
|
lock
|
||||||
|
xaddl %eax, (%rdx)
|
||||||
|
decl %eax
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function InterLockedIncrement (var Target: integer) : Integer; assembler;
|
||||||
|
asm
|
||||||
|
movl $1,%edx
|
||||||
|
xchgl %edx,%eax
|
||||||
|
lock
|
||||||
|
xaddl %eax, (%rdx)
|
||||||
|
incl %eax
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function InterLockedExchange (var Target: integer;Source : integer) : Integer; assembler;
|
||||||
|
asm
|
||||||
|
xchgl (%rax),%edx
|
||||||
|
movl %edx,%eax
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function InterLockedExchangeAdd (var Target: integer;Source : integer) : Integer; assembler;
|
||||||
|
asm
|
||||||
|
xchgl %eax,%edx
|
||||||
|
lock
|
||||||
|
xaddl %eax, (%rdx)
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{
|
||||||
|
$Log$
|
||||||
|
Revision 1.1 2004-02-20 22:15:16 florian
|
||||||
|
+ x86_64 dependend sysutils part added
|
||||||
|
* some 64 bit adaptions
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user