summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcus <marcus@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-03-07 21:00:01 +0000
committermarcus <marcus@3ad0048d-3df7-0310-abae-a5850022a9f2>2021-03-07 21:00:01 +0000
commit1f980b7a957f4112dff8d1f7bf0d15bab32c3c11 (patch)
tree071962532e9d54a48bbb58fb2d8dc6b29565b0c2
parentd4ce23c935dacfb34275f9b3f1247d9029fc87a4 (diff)
downloadfpc-1f980b7a957f4112dff8d1f7bf0d15bab32c3c11.tar.gz
morphos: new functions and structures from current SDK 3.16
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@48902 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--packages/morphunits/src/amigados.pas67
-rw-r--r--packages/morphunits/src/asl.pas6
-rw-r--r--packages/morphunits/src/exec.pas26
-rw-r--r--packages/morphunits/src/intuition.pas1
-rw-r--r--packages/morphunits/src/locale.pas1
-rw-r--r--packages/morphunits/src/workbench.pas23
6 files changed, 120 insertions, 4 deletions
diff --git a/packages/morphunits/src/amigados.pas b/packages/morphunits/src/amigados.pas
index 68c12198d1..a411b01527 100644
--- a/packages/morphunits/src/amigados.pas
+++ b/packages/morphunits/src/amigados.pas
@@ -814,6 +814,24 @@ const
ST_LINKFILE = -4;
ST_PIPEFILE = -5;
+type
+ TCLIDataItem = record
+ cdi_CLINum: LongInt; // CLI number of the CLI
+ cdi_DefaultStack: LongInt; // cli_DefaultStack of the CLI
+ cdi_GlobVec: LongInt; // pr_GlobVec[0] of the CLI
+ cdi_Future: LongWord; // For future expansion, 0 for now
+ cdi_Pri: ShortInt; // CLI priority
+ cdi_Flags: Byte; // If bit 0 is set cdi_command is valid
+ cdi_Command: array[0..0] of Char; // 0-terminated command being executed
+ end;
+ PCLIDataItem = ^TCLIDataItem;
+
+ TCLIData = record
+ cd_NumCLIs: LongWord; // Number of entries in cd_cli array
+ cd_CLI: array[0..100] of PCLIDataItem; // the entries (could be more than 101 though)
+ end;
+ PCLIData = ^TCLIData;
+
{ * dos asl definitions
@@ -1297,8 +1315,33 @@ const
FSCONTEXTINFOTAG_NAME = FSCONTEXTINFOTAG_Dummy + $1;
SEGLISTTAG_Dummy = TAG_USER + 3400;
- // return the ObjData object when it exists or nil.
- SEGLISTTAG_OBJDATA = SEGLISTTAG_Dummy + $1;
+
+ SEGLISTTAG_OBJDATA = SEGLISTTAG_Dummy + $1; // return the ObjData object when it exists or nil.
+ // V51.52
+ SEGLISTTAG_SEGLISTTYPE = SEGLISTTAG_Dummy + $2; // return the seglist type, one of SEGLISTTYPE_*.
+ SEGLISTTAG_DOS_SEGINDEX = SEGLISTTAG_Dummy + $3; // specify that segment index is the hunk number, starting from 0.
+ SEGLISTTAG_ELF_SEGINDEX = SEGLISTTAG_Dummy + $4; // specify that the segment index is the elf segment number, starting from 1.
+ SEGLISTTAG_SEGSTART = SEGLISTTAG_Dummy + $5; // return segment start address for segment specified by either SEGLISTTAG_DOS_SEGINDEX or SEGLISTTAG_ELF_SEGINDEX.
+ // note that SEGLISTTAG_ELF_SEGINDEX segments might return a nil pointer, so be prepared for this.
+ SEGLISTTAG_SEGSIZE = SEGLISTTAG_Dummy + $6; // return segment data size for segment specified by either SEGLISTTAG_DOS_SEGINDEX or SEGLISTTAG_ELF_SEGINDEX.
+ // V51.54
+ SEGLISTTAG_ELF_SEGTYPE = SEGLISTTAG_Dummy + $7; // return ELF segment type (ELF SHT_*). Only applicable for ELF.
+ SEGLISTTAG_ELF_SEGOFFSET = SEGLISTTAG_Dummy + $8; // return ELF segment file offset. Only applicable for ELF.
+ SEGLISTTAG_ELF_SEGFLAGS = SEGLISTTAG_Dummy + $9; // return ELF segment flags. Meaning depends on segment type. Refer to ELF documentation for details. Only applicable for ELF.
+ SEGLISTTAG_ELF_SEGADDRALIGN = SEGLISTTAG_Dummy + $a; // return ELF segment alignment. 0 and 1 mean unaligned. Only applicable for ELF.
+ SEGLISTTAG_ELF_SEGNAME = SEGLISTTAG_Dummy + $b; // return ELF segname name. Only applicable for ELF.
+
+
+ // for tag SEGLISTTAG_SEGLISTTYPE
+ SEGLISTTYPE_ELF = 1;
+ SEGLISTTYPE_POWERUP = 2;
+ SEGLISTTYPE_AMIGA = 3;
+
+ // QueryCLIDataTagList tags (V51.51)
+ CLIDATATAG_Dummy = TAG_USER + 3500;
+ CLIDATATAG_CLINumber = CLIDATATAG_Dummy + $1; // Return only CLI matching the given CLI number (returns 0 or 1 entries)
+ CLIDATATAG_CommandName = CLIDATATAG_Dummy + $2; // Return only CLIs matching the given command (0 to n entries possible)
+ CLIDATATAG_Sorted = CLIDATATAG_Dummy + $3; // When ti_Data is TRUE, return results sorted by CLI number(default to FALSE)
{ * dos stdio definitions
@@ -2264,6 +2307,12 @@ function ExNext64(Lock: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; sys
function ExNext64TagList(Lock: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1150;
function ExamineFH64(Fh: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1156;
function ExamineFH64TagList(Fh: BPTR; Fib: PFileInfoBlock; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1156;
+// V51.51
+procedure ReleaseCLINumber(CLINum: LongInt); syscall BaseSysV MOS_DOSBase 1162;
+function QueryCLIDataTagList(Tags: PTagItem): PCLIData; syscall BaseSysV MOS_DOSBase 1168;
+procedure FreeCLIData(Data: PCLIData); syscall BaseSysV MOS_DOSBase 1174;
+// V51.52
+function GetSegListAttrTagList(SegList: BPTR; Attr: LongInt; Storage: APTR; StorageSize: LongInt; Tags: PTagItem): LongInt; syscall BaseSysV MOS_DOSBase 1180;
{ * dos global definitions (V50)
@@ -2301,6 +2350,9 @@ function Examine64Tags(Lock: BPTR; Fib: PFileInfoBlock; const Tags: array of Ptr
function ExNext64Tags(Lock: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt; inline;
function ExamineFH64Tags(Fh: BPTR; Fib: PFileInfoBlock; const Tags: array of PtrUInt): LongInt; inline;
+function QueryCLIDataTags(const Tags: array of PtrUInt): PCLIData; inline;
+function GetSegListAttrTags(SegList: BPTR; Attr: LongInt; Storage: APTR; StorageSize: LongInt; const Tags: array of PtrUInt): LongInt; inline;
+
implementation
@@ -2406,6 +2458,17 @@ begin
ExamineFH64Tags := ExamineFH64(Fh, Fib, @Tags);
end;
+function QueryCLIDataTags(const Tags: array of PtrUInt): PCLIData;
+begin
+ QueryCLIDataTags := QueryCLIDataTagList(@Tags);
+end;
+
+function GetSegListAttrTags(SegList: BPTR; Attr: LongInt; Storage: APTR; StorageSize: LongInt; const Tags: array of PtrUInt): LongInt; inline;
+begin
+ GetSegListAttrTags := GetSegListAttrTagList(SegList, Attr, Storage, StorageSize, @Tags);
+end;
+
+
begin
DosBase:=MOS_DOSBase;
end.
diff --git a/packages/morphunits/src/asl.pas b/packages/morphunits/src/asl.pas
index 9e9689ea9e..b11f48a496 100644
--- a/packages/morphunits/src/asl.pas
+++ b/packages/morphunits/src/asl.pas
@@ -397,7 +397,7 @@ const
ASLSM_MaxWidth = ASL_TB + 117; // Maximum display width to allow
ASLSM_MinHeight = ASL_TB + 118; // Minimum display height to allow
ASLSM_MaxHeight = ASL_TB + 119; // Maximum display height to allow
- ASLSM_MinDepth = ASL_TB + 120; // Minimum display depth
+ //ASLSM_MinDepth = ASL_TB + 120; // Minimum display depth // obsolete due to a compatibility issue
ASLSM_MaxDepth = ASL_TB + 121; // Maximum display depth
ASLSM_FilterFunc = ASL_TB + 122; // Function to filter mode id's
@@ -406,8 +406,10 @@ const
ASLSM_PopToFront = ASL_TB + 131; // Make the requester window visible when it opens
// V45
ASLSM_Activate = ASL_TB + 132; // Activate the requester window when it opens
+ // V51
+ ASLSM_MinDepth = ASL_TB + 133; // Minimum display depth
- ASL_LAST_TAG = ASL_TB + 133;
+ ASL_LAST_TAG = ASL_TB + 134;
{***************************************************************************}
diff --git a/packages/morphunits/src/exec.pas b/packages/morphunits/src/exec.pas
index 66b09b337f..b582709190 100644
--- a/packages/morphunits/src/exec.pas
+++ b/packages/morphunits/src/exec.pas
@@ -676,11 +676,15 @@ const
TASKINFOTYPE_USERDATA = $2b; // Get/Set task tc_UserData (LongWord)
TASKINFOTYPE_RESURRECT_TASK = $2c; // Tag used to restart a suspended task (LongWord)
TASKINFOTYPE_EMULHANDLE = $2d; // Get/Set task emulhandle (APTR)
+ // Added in exec 50.67
TASKINFOTYPE_EXCEPTIONCOUNT = $2e; // Get task exception count (LongWord)
TASKINFOTYPE_HITCOUNT = $2f; // Get task hit count (LongWord)
+ // Added in exec 51.3
TASKINFOTYPE_MAXHITCOUNT = $30; // Get/Set task max hit count. If more hits happen the task is put to sleep. (LongWord)
+ // Added in exec 51.13
TASKINFOTYPE_ALERTCOUNT = $31; // Get task alert count (LongWord)
TASKINFOTYPE_MAXALERTCOUNT = $32; // Get/Set task max alert count. If more alerts happen the task is put to sleep. (LongWord)
+ // Added in exec 51.14
TASKINFOTYPE_PID = $33; // Get task unique ID. This ID is unique to every task. (LongWord)
TASKINFOTYPE_68K_NEWFRAME = $50;
@@ -1747,7 +1751,14 @@ const
SYSTEMINFOTAG_MEMHEADER = SYSTEMINFOTAG_DUMMY + $1;
SYSTEMINFOTAG_HOOK = SYSTEMINFOTAG_DUMMY + $2;
+// TLSAlloc (V51.46)
+const
+ TLS_INVALID_INDEX = $ffffffff;
+// tags for TLSAlloc
+ TLSTAG_DUMMY = TAG_USER + $120000;
+ TLSTAG_DESTRUCTOR = TLSTAG_DUMMY + $0; // Destructor function to call on task termination if the TLS value is non-nil. The function is called with as: procedure(value: APTR; userdata: APTR);
+ TLSTAG_USERDATA = TLSTAG_DUMMY + $1; // Userdata for the destructor function. Defaults to nil.
function Supervisor(userFunction: Pointer location 'a5'): Cardinal;
SysCall MOS_ExecBase 030;
@@ -2331,6 +2342,14 @@ procedure PutMsgHead(Port: PMsgPort; Message: PMessage); SysCall BaseSysV MOS_Ex
function NewGetTaskPIDAttrsA(PID: LongWord location 'd0'; Data: APTR location 'a0'; DataSize: LongWord location 'd1'; Type_: LongWord location 'd2'; Tags: PTagItem location 'a1'): LongWord; SysCall MOS_ExecBase 1068;
function NewSetTaskPIDAttrsA(PID: LongWord location 'd0'; Data: APTR location 'a0'; DataSize: LongWord location 'd1'; Type_: LongWord location 'd2'; Tags: PTagItem location 'a1'): LongWord; SysCall MOS_ExecBase 1074;
+// added in V51.46
+function TLSAllocA(Tags: PTagItem): LongWord; SysCall BaseSysV MOS_ExecBase 1084;
+function TLSFree(Idx: LongWord): LongInt; SysCall BaseSysV MOS_ExecBase 1090;
+function TLSGetValue(Idx: LongWord): APTR; SysCall BaseSysV MOS_ExecBase 1096;
+function TLSSetValue(Idx: LongWord; Value: APTR): LongInt; SysCall BaseSysV MOS_ExecBase 1102;
+procedure TLSCallDestructors(Task: PTask); SysCall BaseSysV MOS_ExecBase 1108;
+
+
function NewGetTaskAttrs(Task: PTask; Data: APTR; DataSize, TType: LongWord; const Tags: array of PtrUInt): LongWord; Inline;
function NewSetTaskAttrs(Task: PTask; Data: APTR; DataSize, TType: Cardinal; const Tags: array of PtrUInt): LongWord; Inline;
@@ -2342,6 +2361,8 @@ function AddExecNode(InNode: APTR; const Tags: array of PtrUInt): APTR; inline;
function NewGetTaskPIDAttrs(PID: LongWord; Data: APTR; DataSize, Type_: LongWord; const Tags: array of PtrUInt): LongWord; inline;
function NewSetTaskPIDAttrs(PID: LongWord; Data: APTR; DataSize, Type_: LongWord; const Tags: array of PtrUInt): LongWord; inline;
+function TLSAlloc(const Tags: array of PtrUInt): LongWord; inline;
+
function CreateExtIO(const Mp: PMsgPort; Size: Integer): PIORequest;
procedure DeleteExtIO(ioReq: PIORequest);
@@ -2392,6 +2413,11 @@ begin
NewSetTaskPIDAttrs := NewSetTaskPIDAttrsA(PID, Data, DataSize, Type_, @Tags);
end;
+function TLSAlloc(const Tags: array of PtrUInt): LongWord; inline;
+begin
+ TLSAlloc := TLSAllocA(@Tags);
+end;
+
function GetEmulHandle: PEmulHandle; assembler; nostackframe;
asm
mr r3,r2
diff --git a/packages/morphunits/src/intuition.pas b/packages/morphunits/src/intuition.pas
index a65b916a76..8c76e36811 100644
--- a/packages/morphunits/src/intuition.pas
+++ b/packages/morphunits/src/intuition.pas
@@ -3336,6 +3336,7 @@ const
MM_RunBlanker = $406; // Start screensaver for this monitor
MM_EnterPowerSaveMode = $407; // Start power saving mode
MM_ExitBlanker = $408; // Stop screensaver or power saving mode
+ MM_Authorization = $409; // Opens the user password authorization screen, added in 51.68
type
PmsGetRootBitMap = ^TmsGetRootBitMap;
diff --git a/packages/morphunits/src/locale.pas b/packages/morphunits/src/locale.pas
index 7b3ece281d..5331a41657 100644
--- a/packages/morphunits/src/locale.pas
+++ b/packages/morphunits/src/locale.pas
@@ -187,6 +187,7 @@ const
OC_Version = OC_TagBase + 3; // catalog version number required
OC_Language = OC_TagBase + 4; // preferred language of catalog
OC_CodeSet = OC_TagBase + 5; // V51
+ OC_BuiltInStrings = OC_TagBase + 6; // V52.3
// Comparison types for StrnCmp()
SC_ASCII = 0;
diff --git a/packages/morphunits/src/workbench.pas b/packages/morphunits/src/workbench.pas
index 7149c30281..8b8b8dcb57 100644
--- a/packages/morphunits/src/workbench.pas
+++ b/packages/morphunits/src/workbench.pas
@@ -479,6 +479,10 @@ function MakeWorkbenchObjectVisibleA(Name: STRPTR location 'a0'; const Tags: PTa
function OpenWorkbenchObjectA(Name: STRPTR location 'a0'; const Tags: PTagItem location 'a1'): LongBool; syscall WorkbenchBase 096;
function RemoveAppWindowDropZone(Aw: PAppWindow location 'a0'; DropZone: PAppWindowDropZone location 'a1'): LongBool; syscall WorkbenchBase 120;
function WorkbenchControlA(Name: STRPTR location 'a0'; const Tags: PTagItem location 'a1'): LongBool; syscall WorkbenchBase 108;
+// V51
+function ManageDesktopObjectA(Name: PChar; Action: LongInt; Tags: PTagItem): Boolean; syscall BaseSysV WorkbenchBase 148;
+function CreateDrawerA(Drawer: PChar; Tags: PTagItem): Boolean; syscall BaseSysV WorkbenchBase 154;
+function CreateIconA(Name: PChar; Tags: PTagItem): Boolean; syscall BaseSysV WorkbenchBase 160;
function AddAppIcon(Id: LongWord; UserData: LongWord; Text_: PChar; MsgPort: PMsgPort; Lock: BPTR; DiskObj: PDiskObject; const TagList: array of PtrUInt): PAppIcon; inline;
function AddAppMenuItem(Id: LongWord; UserData: LongWord; Text_: PChar; MsgPort: PMsgPort; const Tags: array of PtrUInt): PAppMenuItem; inline;
@@ -490,6 +494,10 @@ function WorkbenchControl(Name: PChar; const Tags: array of PtrUInt): LongBool;
function AddAppWindowDropZone(Aw: PAppWindow; Id: LongWord; UserData: LongWord; const Tags: array of PtrUInt): PAppWindowDropZone; inline;
function ChangeWorkbenchSelection(Name: STRPTR; Hook: PHook; const Tags: array of PtrUInt): LongBool; inline;
function MakeWorkbenchObjectVisible(Name: STRPTR; const Tags: array of PtrUInt): LongBool; inline;
+// V51
+function ManageDesktopObjectTags(Name: PChar; Action: LongInt; const Tags: array of PtrUInt): Boolean; inline;
+function CreateDrawerTags(Drawer: PChar; const Tags: array of PtrUInt): Boolean; inline;
+function CreateIconTags(Name: PChar; const Tags: array of PtrUInt): Boolean; inline;
implementation
@@ -538,6 +546,21 @@ begin
MakeWorkbenchObjectVisible := MakeWorkbenchObjectVisibleA(Name, @Tags);
end;
+function ManageDesktopObjectTags(Name: PChar; Action: LongInt; const Tags: array of PtrUInt): Boolean;
+begin
+ ManageDesktopObjectTags := ManageDesktopObjectA(Name, Action, @Tags);
+end;
+
+function CreateDrawerTags(Drawer: PChar; const Tags: array of PtrUInt): Boolean;
+begin
+ CreateDrawerTags := CreateDrawerA(Drawer, @Tags);
+end;
+
+function CreateIconTags(Name: PChar; const Tags: array of PtrUInt): Boolean;
+begin
+ CreateIconTags := CreateIconA(Name, @Tags);
+end;
+
const
LIBVERSION: LongWord = 0;