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/execd.inc svneol=native#text/plain
rtl/amiga/m68k/execf.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/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/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/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/m68kamiga.inc svneol=native#text/plain
rtl/amiga/m68k/prt0.as svneol=native#text/plain rtl/amiga/m68k/prt0.as svneol=native#text/plain
rtl/amiga/m68k/si_prc.pp 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 begin
{$warning CreateNewProc unimplemented!} {$warning CreateNewProc unimplemented!}
CreateNewProc:=nil; CreateNewProc:=nil;
@ -31,7 +31,7 @@ end;
function NameFromLock(lock : LongInt; function NameFromLock(lock : LongInt;
buffer: PChar; buffer: PChar;
len : LongInt): LongBool; len : LongInt): LongBool; public name '_fpc_amiga_namefromlock';
var var
fib_area: array[1..sizeof(TFileInfoBlock) + sizeof(longint)] of byte; fib_area: array[1..sizeof(TFileInfoBlock) + sizeof(longint)] of byte;
fib: pfileinfoblock; fib: pfileinfoblock;
@ -82,57 +82,57 @@ end;
function NameFromFH(fh : BPTR; function NameFromFH(fh : BPTR;
buffer: PChar; buffer: PChar;
len : LongInt): LongBool; len : LongInt): LongBool; public name '_fpc_amiga_namefromfh';
begin begin
{$warning NameFromFH unimplemented!} {$warning NameFromFH unimplemented!}
NameFromFH:=false; NameFromFH:=false;
end; end;
function ExamineFH(fh : BPTR; function ExamineFH(fh : BPTR;
fib: PFileInfoBlock): LongBool; fib: PFileInfoBlock): LongBool; public name '_fpc_amiga_examinefh';
begin begin
{$warning ExamineFH unimplemented!} {$warning ExamineFH unimplemented!}
ExamineFH:=false; ExamineFH:=false;
end; end;
function LockDosList(flags: Cardinal): PDosList; function LockDosList(flags: Cardinal): PDosList; public name '_fpc_amiga_lockdoslist';
begin begin
{$warning LockDosList unimplemented!} {$warning LockDosList unimplemented!}
LockDosList:=nil; LockDosList:=nil;
end; end;
procedure UnLockDosList(flags: Cardinal); procedure UnLockDosList(flags: Cardinal); public name '_fpc_amiga_unlockdoslist';
begin begin
{$warning UnlockDosList unimplemented!} {$warning UnlockDosList unimplemented!}
end; end;
function NextDosEntry(dlist: PDosList; function NextDosEntry(dlist: PDosList;
flags: Cardinal): PDosList; flags: Cardinal): PDosList; public name '_fpc_amiga_nextdosentry';
begin begin
{$warning NextDosEntry unimplemented!} {$warning NextDosEntry unimplemented!}
NextDosEntry:=nil; NextDosEntry:=nil;
end; end;
function MatchFirst(pat : PChar; function MatchFirst(pat : PChar;
anchor: PAnchorPath): LongInt; anchor: PAnchorPath): LongInt; public name '_fpc_amiga_matchfirst';
begin begin
{$warning MatchFirst unimplemented!} {$warning MatchFirst unimplemented!}
MatchFirst:=-1; MatchFirst:=-1;
end; end;
function MatchNext(anchor: PAnchorPath): LongInt; function MatchNext(anchor: PAnchorPath): LongInt; public name '_fpc_amiga_matchnext';
begin begin
{$warning MatchNext unimplemented!} {$warning MatchNext unimplemented!}
MatchNext:=-1; MatchNext:=-1;
end; end;
procedure MatchEnd(anchor: PAnchorPath); procedure MatchEnd(anchor: PAnchorPath); public name '_fpc_amiga_matchend';
begin begin
{$warning MatchEnd unimplemented!} {$warning MatchEnd unimplemented!}
end; end;
function SystemTagList(command: PChar; function SystemTagList(command: PChar;
tags : PTagItem): LongInt; tags : PTagItem): LongInt; public name '_fpc_amiga_systemtaglist';
begin begin
{$warning SystemTagList unimplemented!} {$warning SystemTagList unimplemented!}
SystemTagList:=-1; SystemTagList:=-1;
@ -141,14 +141,14 @@ end;
function GetVar(name : PChar; function GetVar(name : PChar;
buffer: PChar; buffer: PChar;
size : LongInt; size : LongInt;
flags : LongInt): LongInt; flags : LongInt): LongInt; public name '_fpc_amiga_getvar';
begin begin
{$warning GetVar unimplemented!} {$warning GetVar unimplemented!}
GetVar:=-1; GetVar:=-1;
end; end;
function SetFileDate(name: PChar; function SetFileDate(name: PChar;
date: PDateStamp): LongBool; date: PDateStamp): LongBool; public name '_fpc_amiga_setfiledate';
begin begin
{$warning SetFileDate unimplemented!} {$warning SetFileDate unimplemented!}
SetFileDate:=false; SetFileDate:=false;
@ -156,14 +156,14 @@ end;
function SetFileSize(fh : LongInt; function SetFileSize(fh : LongInt;
pos : LongInt; pos : LongInt;
mode: LongInt): LongInt; mode: LongInt): LongInt; public name '_fpc_amiga_setfilesize';
begin begin
{$warning SetFileSize unimplemented!} {$warning SetFileSize unimplemented!}
SetFileSize:=-1; SetFileSize:=-1;
end; end;
function GetProgramName(buf: PChar; function GetProgramName(buf: PChar;
len: LongInt): LongBool; len: LongInt): LongBool; public name '_fpc_amiga_getprogramname';
var var
pr: PProcess; pr: PProcess;
pn: PChar; pn: PChar;
@ -190,7 +190,7 @@ begin
end; end;
end; end;
function GetProgramDir: LongInt; function GetProgramDir: LongInt; public name '_fpc_amiga_getprogramdir';
var var
cmd: array[0..255] of char; cmd: array[0..255] of char;
prglock: LongInt; prglock: LongInt;
@ -211,7 +211,7 @@ var
__fpc_global_arglen: dword; external name '__fpc_arglen'; __fpc_global_arglen: dword; external name '__fpc_arglen';
__fpc_args_buffer: pchar; __fpc_args_buffer: pchar;
function GetArgStr: PChar; function GetArgStr: PChar; public name '_fpc_amiga_getargstr';
var var
len: dword; len: dword;
begin 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; function CreatePool(requirements: Cardinal;
puddleSize : Cardinal; puddleSize : Cardinal;
threshSize : Cardinal): Pointer; threshSize : Cardinal): Pointer; public name '_fpc_amiga_createpool';
var var
p: PAmigaLegacyPool; p: PAmigaLegacyPool;
begin begin
@ -76,7 +76,7 @@ begin
end; end;
function AllocPooled(poolHeader: Pointer; function AllocPooled(poolHeader: Pointer;
memSize : Cardinal): Pointer; memSize : Cardinal): Pointer; public name '_fpc_amiga_allocpooled';
var var
p: PAmigaLegacyPoolEntry; p: PAmigaLegacyPoolEntry;
ph: PAmigaLegacyPool absolute poolHeader; ph: PAmigaLegacyPool absolute poolHeader;
@ -97,7 +97,7 @@ end;
procedure FreePooled(poolHeader: Pointer; procedure FreePooled(poolHeader: Pointer;
memory : Pointer; memory : Pointer;
memSize : Cardinal); memSize : Cardinal); public name '_fpc_amiga_freepooled';
var var
p: PAmigaLegacyPoolEntry; p: PAmigaLegacyPoolEntry;
ph: PAmigaLegacyPool absolute poolHeader; ph: PAmigaLegacyPool absolute poolHeader;
@ -115,7 +115,7 @@ begin
end; end;
end; end;
procedure DeletePool(poolHeader: Pointer); procedure DeletePool(poolHeader: Pointer); public name '_fpc_amiga_deletepool';
var var
p: PAmigaLegacyPool absolute poolHeader; p: PAmigaLegacyPool absolute poolHeader;
pe: PAmigaLegacyPoolEntry; pe: PAmigaLegacyPoolEntry;
@ -172,7 +172,7 @@ asm
rts rts
end; end;
procedure ObtainSemaphoreShared(sigSem: PSignalSemaphore); procedure ObtainSemaphoreShared(sigSem: PSignalSemaphore); public name '_fpc_amiga_obtainsemaphoreshared';
begin begin
{ NOTE: this still needs v33+ (OS v1.2 or later) } { NOTE: this still needs v33+ (OS v1.2 or later) }
{ ObtainSemaphoreShared is used by athreads, and simply replacing { 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; procedure Amiga2Date(seconds: Cardinal;
result : PClockData); result : PClockData); public name '_fpc_amiga_amiga2date';
begin begin
{$warning Amiga2Date unimplemented!} {$warning Amiga2Date unimplemented!}
end; end;
function Date2Amiga(date: PClockData): Cardinal; function Date2Amiga(date: PClockData): Cardinal; public name '_fpc_amiga_date2amiga';
begin begin
{$warning Date2Amiga unimplemented!} {$warning Date2Amiga unimplemented!}
Date2Amiga:=0; 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';