m68k-amiga: make all legacy support functions have a public name, and supply headers for them (will be utilized by athreads, dos, and sysutils units)

git-svn-id: trunk@44564 -
This commit is contained in:
Károly Balogh 2020-04-04 13:21:54 +00:00
parent 632353a808
commit 8d690546f3
7 changed files with 131 additions and 24 deletions

3
.gitattributes vendored
View File

@ -10067,8 +10067,11 @@ rtl/amiga/m68k/doslibf.inc svneol=native#text/plain
rtl/amiga/m68k/execd.inc svneol=native#text/plain
rtl/amiga/m68k/execf.inc svneol=native#text/plain
rtl/amiga/m68k/legacydos.inc svneol=native#text/plain
rtl/amiga/m68k/legacydosh.inc svneol=native#text/plain
rtl/amiga/m68k/legacyexec.inc svneol=native#text/plain
rtl/amiga/m68k/legacyexech.inc svneol=native#text/plain
rtl/amiga/m68k/legacyutil.inc svneol=native#text/plain
rtl/amiga/m68k/legacyutilh.inc svneol=native#text/plain
rtl/amiga/m68k/m68kamiga.inc svneol=native#text/plain
rtl/amiga/m68k/prt0.as svneol=native#text/plain
rtl/amiga/m68k/si_prc.pp svneol=native#text/plain

View File

@ -23,7 +23,7 @@
}
function CreateNewProc(tags: PTagItem): PProcess;
function CreateNewProc(tags: PTagItem): PProcess; public name '_fpc_amiga_createproc';
begin
{$warning CreateNewProc unimplemented!}
CreateNewProc:=nil;
@ -31,7 +31,7 @@ end;
function NameFromLock(lock : LongInt;
buffer: PChar;
len : LongInt): LongBool;
len : LongInt): LongBool; public name '_fpc_amiga_namefromlock';
var
fib_area: array[1..sizeof(TFileInfoBlock) + sizeof(longint)] of byte;
fib: pfileinfoblock;
@ -82,57 +82,57 @@ end;
function NameFromFH(fh : BPTR;
buffer: PChar;
len : LongInt): LongBool;
len : LongInt): LongBool; public name '_fpc_amiga_namefromfh';
begin
{$warning NameFromFH unimplemented!}
NameFromFH:=false;
end;
function ExamineFH(fh : BPTR;
fib: PFileInfoBlock): LongBool;
fib: PFileInfoBlock): LongBool; public name '_fpc_amiga_examinefh';
begin
{$warning ExamineFH unimplemented!}
ExamineFH:=false;
end;
function LockDosList(flags: Cardinal): PDosList;
function LockDosList(flags: Cardinal): PDosList; public name '_fpc_amiga_lockdoslist';
begin
{$warning LockDosList unimplemented!}
LockDosList:=nil;
end;
procedure UnLockDosList(flags: Cardinal);
procedure UnLockDosList(flags: Cardinal); public name '_fpc_amiga_unlockdoslist';
begin
{$warning UnlockDosList unimplemented!}
end;
function NextDosEntry(dlist: PDosList;
flags: Cardinal): PDosList;
flags: Cardinal): PDosList; public name '_fpc_amiga_nextdosentry';
begin
{$warning NextDosEntry unimplemented!}
NextDosEntry:=nil;
end;
function MatchFirst(pat : PChar;
anchor: PAnchorPath): LongInt;
anchor: PAnchorPath): LongInt; public name '_fpc_amiga_matchfirst';
begin
{$warning MatchFirst unimplemented!}
MatchFirst:=-1;
end;
function MatchNext(anchor: PAnchorPath): LongInt;
function MatchNext(anchor: PAnchorPath): LongInt; public name '_fpc_amiga_matchnext';
begin
{$warning MatchNext unimplemented!}
MatchNext:=-1;
end;
procedure MatchEnd(anchor: PAnchorPath);
procedure MatchEnd(anchor: PAnchorPath); public name '_fpc_amiga_matchend';
begin
{$warning MatchEnd unimplemented!}
end;
function SystemTagList(command: PChar;
tags : PTagItem): LongInt;
tags : PTagItem): LongInt; public name '_fpc_amiga_systemtaglist';
begin
{$warning SystemTagList unimplemented!}
SystemTagList:=-1;
@ -141,14 +141,14 @@ end;
function GetVar(name : PChar;
buffer: PChar;
size : LongInt;
flags : LongInt): LongInt;
flags : LongInt): LongInt; public name '_fpc_amiga_getvar';
begin
{$warning GetVar unimplemented!}
GetVar:=-1;
end;
function SetFileDate(name: PChar;
date: PDateStamp): LongBool;
date: PDateStamp): LongBool; public name '_fpc_amiga_setfiledate';
begin
{$warning SetFileDate unimplemented!}
SetFileDate:=false;
@ -156,14 +156,14 @@ end;
function SetFileSize(fh : LongInt;
pos : LongInt;
mode: LongInt): LongInt;
mode: LongInt): LongInt; public name '_fpc_amiga_setfilesize';
begin
{$warning SetFileSize unimplemented!}
SetFileSize:=-1;
end;
function GetProgramName(buf: PChar;
len: LongInt): LongBool;
len: LongInt): LongBool; public name '_fpc_amiga_getprogramname';
var
pr: PProcess;
pn: PChar;
@ -190,7 +190,7 @@ begin
end;
end;
function GetProgramDir: LongInt;
function GetProgramDir: LongInt; public name '_fpc_amiga_getprogramdir';
var
cmd: array[0..255] of char;
prglock: LongInt;
@ -211,7 +211,7 @@ var
__fpc_global_arglen: dword; external name '__fpc_arglen';
__fpc_args_buffer: pchar;
function GetArgStr: PChar;
function GetArgStr: PChar; public name '_fpc_amiga_getargstr';
var
len: dword;
begin

View File

@ -0,0 +1,50 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 2020 Karoly Balogh, Free Pascal Development team
Headers for Amiga legacy (OS 1.x/2.x) support functions
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.
**********************************************************************}
{* dos.library *}
function CreateNewProc(tags: PTagItem): PProcess; external name '_fpc_amiga_createproc';
function NameFromLock(lock : LongInt;
buffer: PChar;
len : LongInt): LongBool; external name '_fpc_amiga_namefromlock';
function NameFromFH(fh : BPTR;
buffer: PChar;
len : LongInt): LongBool; external name '_fpc_amiga_namefromfh';
function ExamineFH(fh : BPTR;
fib: PFileInfoBlock): LongBool; external name '_fpc_amiga_examinefh';
function LockDosList(flags: Cardinal): PDosList; external name '_fpc_amiga_lockdoslist';
procedure UnLockDosList(flags: Cardinal); external name '_fpc_amiga_unlockdoslist';
function NextDosEntry(dlist: PDosList;
flags: Cardinal): PDosList; external name '_fpc_amiga_nextdosentry';
function MatchFirst(pat : PChar;
anchor: PAnchorPath): LongInt; external name '_fpc_amiga_matchfirst';
function MatchNext(anchor: PAnchorPath): LongInt; external name '_fpc_amiga_matchnext';
procedure MatchEnd(anchor: PAnchorPath); external name '_fpc_amiga_matchend';
function SystemTagList(command: PChar;
tags : PTagItem): LongInt; external name '_fpc_amiga_systemtaglist';
function GetVar(name : PChar;
buffer: PChar;
size : LongInt;
flags : LongInt): LongInt; external name '_fpc_amiga_getvar';
function SetFileDate(name: PChar;
date: PDateStamp): LongBool; external name '_fpc_amiga_setfiledate';
function SetFileSize(fh : LongInt;
pos : LongInt;
mode: LongInt): LongInt; external name '_fpc_amiga_setfilesize';
function GetProgramName(buf: PChar;
len: LongInt): LongBool; external name '_fpc_amiga_getprogramname';
function GetProgramDir: LongInt; external name '_fpc_amiga_getprogramdir';
function GetArgStr: PChar; external name '_fpc_amiga_getargstr';

View File

@ -62,7 +62,7 @@ type
function CreatePool(requirements: Cardinal;
puddleSize : Cardinal;
threshSize : Cardinal): Pointer;
threshSize : Cardinal): Pointer; public name '_fpc_amiga_createpool';
var
p: PAmigaLegacyPool;
begin
@ -76,7 +76,7 @@ begin
end;
function AllocPooled(poolHeader: Pointer;
memSize : Cardinal): Pointer;
memSize : Cardinal): Pointer; public name '_fpc_amiga_allocpooled';
var
p: PAmigaLegacyPoolEntry;
ph: PAmigaLegacyPool absolute poolHeader;
@ -97,7 +97,7 @@ end;
procedure FreePooled(poolHeader: Pointer;
memory : Pointer;
memSize : Cardinal);
memSize : Cardinal); public name '_fpc_amiga_freepooled';
var
p: PAmigaLegacyPoolEntry;
ph: PAmigaLegacyPool absolute poolHeader;
@ -115,7 +115,7 @@ begin
end;
end;
procedure DeletePool(poolHeader: Pointer);
procedure DeletePool(poolHeader: Pointer); public name '_fpc_amiga_deletepool';
var
p: PAmigaLegacyPool absolute poolHeader;
pe: PAmigaLegacyPoolEntry;
@ -172,7 +172,7 @@ asm
rts
end;
procedure ObtainSemaphoreShared(sigSem: PSignalSemaphore);
procedure ObtainSemaphoreShared(sigSem: PSignalSemaphore); public name '_fpc_amiga_obtainsemaphoreshared';
begin
{ NOTE: this still needs v33+ (OS v1.2 or later) }
{ ObtainSemaphoreShared is used by athreads, and simply replacing

View File

@ -0,0 +1,33 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 2020 Karoly Balogh, Free Pascal Development team
Headers for Amiga legacy (OS 1.x/2.x) support functions
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.
**********************************************************************}
{* exec.library *}
function AllocVec(byteSize : Cardinal;
requirements: Cardinal): Pointer; external name '_fpc_amiga_allocvec';
procedure FreeVec(memoryBlock: Pointer); external name '_fpc_amiga_freevec';
function CreatePool(requirements: Cardinal;
puddleSize : Cardinal;
threshSize : Cardinal): Pointer; external name '_fpc_amiga_createpool';
function AllocPooled(poolHeader: Pointer;
memSize : Cardinal): Pointer; external name '_fpc_amiga_allocpooled';
procedure FreePooled(poolHeader: Pointer;
memory : Pointer;
memSize : Cardinal); external name '_fpc_amiga_freepooled';
procedure DeletePool(poolHeader: Pointer); external name '_fpc_amiga_deletepool';
procedure StackSwap(newStack: PStackSwapStruct); external name '_fpc_amiga_stackswap';
procedure ObtainSemaphoreShared(sigSem: PSignalSemaphore); external name '_fpc_amiga_obtainsemaphoreshared';

View File

@ -23,12 +23,12 @@
}
procedure Amiga2Date(seconds: Cardinal;
result : PClockData);
result : PClockData); public name '_fpc_amiga_amiga2date';
begin
{$warning Amiga2Date unimplemented!}
end;
function Date2Amiga(date: PClockData): Cardinal;
function Date2Amiga(date: PClockData): Cardinal; public name '_fpc_amiga_date2amiga';
begin
{$warning Date2Amiga unimplemented!}
Date2Amiga:=0;

View File

@ -0,0 +1,21 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 2020 Karoly Balogh, Free Pascal Development team
Headers for Amiga legacy (OS 1.x/2.x) support functions
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.
**********************************************************************}
{* utility.library *}
procedure Amiga2Date(seconds: Cardinal;
result : PClockData); external name '_fpc_amiga_amiga2date';
function Date2Amiga(date: PClockData): Cardinal; external name '_fpc_amiga_date2amiga';