+ another Amiga RTL update, chapter 2

git-svn-id: trunk@4397 -
This commit is contained in:
Károly Balogh 2006-08-09 08:30:33 +00:00
parent 53469d43c3
commit 2cb95ed2c7
7 changed files with 2082 additions and 0 deletions

6
.gitattributes vendored
View File

@ -3970,7 +3970,13 @@ rtl/amiga/dos.pp svneol=native#text/plain
rtl/amiga/doslibd.inc svneol=native#text/plain
rtl/amiga/m68k/execf.inc svneol=native#text/plain
rtl/amiga/m68k/prt0.as svneol=native#text/plain
rtl/amiga/powerpc/doslibf.inc svneol=native#text/plain
rtl/amiga/powerpc/execd.inc svneol=native#text/plain
rtl/amiga/powerpc/execf.inc svneol=native#text/plain
rtl/amiga/powerpc/prt0.as svneol=native#text/plain
rtl/amiga/powerpc/utild1.inc svneol=native#text/plain
rtl/amiga/powerpc/utild2.inc svneol=native#text/plain
rtl/amiga/powerpc/utilf.inc svneol=native#text/plain
rtl/amiga/printer.pp svneol=native#text/plain
rtl/amiga/sysdir.inc svneol=native#text/plain
rtl/amiga/sysfile.inc svneol=native#text/plain

View File

@ -0,0 +1,63 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 2006 by Karoly Balogh
dos.library functions for AmigaOS 4.x/PowerPC
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.
**********************************************************************}
function Open(name: PChar; accessMode: longint): longint; syscall IDOS 76;
function dosClose(_file: longint): boolean; syscall IDOS 80;
function dosRead(_file: longint; buffer: Pointer; length: longint): longint; syscall IDOS 84;
function dosWrite(_file: longint; buffer: Pointer; length: longint): longint; syscall IDOS 88;
function dosInput: longint; syscall IDOS 92;
function dosOutput: longint; syscall IDOS 96;
function dosSeek(_file: longint;position: longint;offset: longint): longint; syscall IDOS 100;
function dosDeleteFile(name: PChar): boolean; syscall IDOS 104;
function dosRename(oldName: PChar;newName: PChar): boolean; syscall IDOS 108;
function Lock(name: PChar;_type: longint): longint; syscall IDOS 112;
procedure UnLock(lock: longint); syscall IDOS 116;
function Examine(lock: longint; fileInfoBlock: PFileInfoBlock): boolean; syscall IDOS 124;
function Info(lock: longint; parameterBlock: PInfoData): boolean; syscall IDOS 132;
function dosCreateDir(name: PChar): longint; syscall IDOS 136;
function CurrentDir(lock: longint): longint; syscall IDOS 140;
function IoErr: longint; syscall IDOS 144;
function SetProtection(name: PChar; protect: longword): boolean; syscall IDOS 180;
function DateStamp(date: PDateStamp): PDateStamp; syscall IDOS 184;
function SetFileDate(name: PChar; date: PDateStamp): boolean; syscall IDOS 356;
function NameFromLock(lock: longint; buffer: PChar; len: longint): boolean; syscall IDOS 360;
function NameFromFH(fh: longint; buffer: PChar; len: longint): longint; syscall IDOS 364;
function SetFileSize(fh: longint; pos: longint; mode: longint): longint; syscall IDOS 396;
function GetArgStr: PChar; syscall IDOS 456;
function SetArgStr(_string: PChar): PChar; syscall IDOS 460;
function GetCurrentDirName(buf: PChar; len: longint): boolean; syscall IDOS 476;
function GetProgramName(buf: PChar; len: longint): boolean; syscall IDOS 484;
function GetProgramDir: longint; syscall IDOS 500;
function SystemTagList(command: PChar; tags: PTagItem): longint; syscall IDOS 504;
function LockDosList(flags: longword): PDosList; syscall IDOS 544;
procedure UnLockDosList(flags: longword); syscall IDOS 548;
function NextDosEntry(dlist: PDosList; flags: longword): PDosList; syscall IDOS 568;
function MatchFirst(pat: PChar; anchor: PAnchorPath): longint; syscall IDOS 664;
function MatchNext(anchor: PAnchorPath): longint; syscall IDOS 668;
procedure MatchEnd(anchor: PAnchorPath); syscall IDOS 672;
function GetVar(name: PChar; buffer: PChar; size: longint; flags: longword): longint; syscall IDOS 720;

1738
rtl/amiga/powerpc/execd.inc Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,50 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 2006 by Karoly Balogh
exec.library functions for AmigaOS 4.x/PowerPC
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.
**********************************************************************}
function execAllocMem(byteSize: longword; attributes: longword): Pointer; syscall IExec 104;
function AllocPooled(poolHeader: Pointer;memSize: longword): Pointer; syscall IExec 108;
function CreatePool(memFlags: longword; puddleSize: longword; threshSize: longword): Pointer; syscall IExec 132;
procedure DeletePool(poolHeader: Pointer); syscall IExec 140;
procedure execFreeMem(memoryBlock: Pointer; byteSize: longword); syscall IExec 164;
procedure FreePooled(poolHeader: Pointer;memory: Pointer;memSize: longword); syscall IExec 168;
function FindTask(name: PChar): PTask; syscall IExec 260;
function AllocSignal(signalNum: shortint): shortint; syscall IExec 276;
procedure FreeSignal(signalNum: shortint); syscall IExec 280;
function SetSignal(newSignals: longword; signalMask: longword): longword; syscall IExec 288;
procedure AddPort(port: PMsgPort); syscall IExec 300;
function GetMsg(port: PMsgPort): PMessage; syscall IExec 324;
procedure PutMsg(port: PMsgPort; message: PMessage); syscall IExec 328;
procedure RemPort(port: PMsgPort); syscall IExec 332;
procedure ReplyMsg(message: PMessage); syscall IExec 336;
function WaitPort(port: PMsgPort): PMessage; syscall IExec 340;
function OpenLibrary(name: PChar; version: longword): PLibrary; syscall IExec 424;
function CloseLibrary(_library: PLibrary): Pointer; syscall IExec 428;
function GetInterface(_library: PLibrary;name: PChar;version: longword;taglist: PTagItem): PInterface; syscall IExec 448;
function GetInterfaceTags(_library: PLibrary;name: PChar;version: longword): PInterface; {varargs;} syscall IExec 452; {$WARNING varargs should be possible with syscalls too on OS4}
procedure DropInterface(_interface: PInterface); syscall IExec 456;
function OpenDevice(devName: PChar; unitNumber: longword;ioRequest: PIORequest; flags: longword): longint; syscall IExec 504;
function CloseDevice(ioRequest: PIORequest): Pointer; syscall IExec 508;
function DoIO(ioRequest: PIORequest): shortint; syscall IExec 528;

View File

@ -0,0 +1,153 @@
{
This file is part of the Free Pascal run time library.
utility definitions (V50) for MorphOS/PowerPC
Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved.
Free Pascal conversion, first part
Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
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 date defines
*********************************************************************
* }
type
PClockData = ^TClockData;
TClockData = packed record
sec : Word;
min : Word;
hour : Word;
mday : Word;
month: Word;
year : Word;
wday : Word;
end;
{ * utility.library tagitem defines
*********************************************************************
* }
type
Tag = Cardinal;
type
PPTagItem = ^PTagItem;
PTagItem = ^TTagItem;
TTagItem = packed record
ti_Tag : Tag;
ti_Data: Cardinal;
end;
const
TAG_DONE = 0;
TAG_END = 0;
TAG_IGNORE = 1;
TAG_MORE = 2;
TAG_SKIP = 3;
const
TAG_USER = 1 Shl 31;
const
TAGFILTER_AND = 0;
TAGFILTER_NOT = 1;
const
MAP_REMOVE_NOT_FOUND = 0;
MAP_KEEP_NOT_FOUND = 1;
{ * utility.library namespace defines
*********************************************************************
* }
type
PNamedObject = ^TNamedObject;
TNamedObject = packed record
no_Object: Pointer;
end;
const
ANO_NameSpace = 4000;
ANO_UserSpace = 4001;
ANO_Priority = 4002;
ANO_Flags = 4003;
NSB_NODUPS = 0;
NSB_CASE = 1;
NSF_NODUPS = 1 Shl NSB_NODUPS;
NSF_CASE = 1 Shl NSB_CASE;
{ * utility.library pack attributes and macros
*********************************************************************
* }
const
PSTB_SIGNED = 31;
PSTB_UNPACK = 30;
PSTB_PACK = 29;
PSTB_EXISTS = 26;
PSTF_SIGNED = (1 Shl PSTB_SIGNED);
PSTF_UNPACK = (1 Shl PSTB_UNPACK);
PSTF_PACK = (1 Shl PSTB_PACK);
PSTF_EXISTS = (1 Shl PSTB_EXISTS);
const
PKCTRL_PACKUNPACK = $00000000;
PKCTRL_PACKONLY = $40000000;
PKCTRL_UNPACKONLY = $20000000;
PKCTRL_BYTE = $80000000;
PKCTRL_WORD = $88000000;
PKCTRL_LONG = $90000000;
PKCTRL_UBYTE = $00000000;
PKCTRL_UWORD = $08000000;
PKCTRL_ULONG = $10000000;
PKCTRL_BIT = $18000000;
PKCTRL_FLIPBIT = $98000000;
{$WARNING FIX ME!!! Some macros to convert}
{
PK_BITNUM1(flg) ((flg) == 0x01 ? 0 : (flg) == 0x02 ? 1 : (flg) == 0x04 ? 2 : (flg) == 0x08 ? 3 : (flg) == 0x10 ? 4 : (flg) == 0x20 ? 5 : (flg) == 0x40 ? 6 : 7)
PK_BITNUM2(flg) ((flg < 0x100 ? PK_BITNUM1(flg) : 8 + PK_BITNUM1(flg >> 8)))
PK_BITNUM(flg) ((flg < 0x10000 ? PK_BITNUM2(flg) : 16 + PK_BITNUM2(flg >> 16)))
PK_WORDOFFSET(flg) ((flg) < 0x100 ? 1 : 0)
PK_LONGOFFSET(flg) ((flg) < 0x100 ? 3 : (flg) < 0x10000 ? 2 : (flg) < 0x1000000 ? 1 : 0)
PK_CALCOFFSET(type,field) ((ULONG)(&((struct type *)0)->field))
PACK_STARTTABLE(tagbase) (tagbase)
PACK_NEWOFFSET(tagbase) (-1L),(tagbase)
PACK_ENDTABLE 0
PACK_ENTRY(tagbase,tag,type,field,control) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field))
PACK_BYTEBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field) | (PK_BITNUM(flags) << 13L))
PACK_WORDBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_WORDOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L))
PACK_LONGBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_LONGOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L))
}

View File

@ -0,0 +1,53 @@
{
This file is part of the Free Pascal run time library.
utility definitions (V50) for MorphOS/PowerPC
Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved.
Free Pascal conversion, second part
Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
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 include
*********************************************************************
* }
const
UtilityName = 'utility.library';
type
PUtilityBase = ^TUtilityName;
TUtilityName = packed record
ub_LibNode : TLibrary;
ub_Language: Byte;
ub_Reserved: Byte;
end;
{ * utility.library hook defines
*********************************************************************
* }
type
PHook = ^THook;
THook = packed record
h_MinNode : TMinNode;
h_Entry : Cardinal;
h_SubEntry: Cardinal;
h_Data : Pointer;
end;

View File

@ -0,0 +1,19 @@
{
This file is part of the Free Pascal run time library.
Copyright (c) 2006 by Karoly Balogh
utility.library functions for AmigaOS 4.x/PowerPC
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.
**********************************************************************}
procedure Amiga2Date(date_amiga: longword; cd: PClockData); syscall IUtility 172;
function CheckDate(date: PClockData): longword; syscall IUtility 176;
function Date2Amiga(date: PClockData): longword; syscall IUtility 180;