2
$Id: execd.inc,v 1.4 2005/02/14 17:13:30 peter Exp $
3
This file is part of the Free Pascal run time library.
5
exec definitions (V50) for MorphOS/PowerPC
6
Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved.
9
Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
11
See the file COPYING.FPC, included in this distribution,
12
for details about the copyright.
14
This program is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18
**********************************************************************}
24
{ * exec node definitions (V50)
25
*********************************************************************
41
TMinNode = packed record
73
{ * exec list definitions (V50)
74
*********************************************************************
90
TMinList = packed record
93
mlh_TailPred: PMinNode;
98
{ * exec alert definitions (V50)
99
*********************************************************************
104
ACPU_BusErr = $80000002;
105
ACPU_AddressErr = $80000003;
106
ACPU_InstErr = $80000004;
107
ACPU_DivZero = $80000005;
108
ACPU_CHK = $80000006;
109
ACPU_TRAPV = $80000007;
110
ACPU_PrivErr = $80000008;
111
ACPU_Trace = $80000009;
112
ACPU_LineA = $8000000A;
113
ACPU_LineF = $8000000B;
114
ACPU_Format = $8000000E;
115
ACPU_Spurious = $80000018;
116
ACPU_AutoVec1 = $80000019;
117
ACPU_AutoVec2 = $8000001A;
118
ACPU_AutoVec3 = $8000001B;
119
ACPU_AutoVec4 = $8000001C;
120
ACPU_AutoVec5 = $8000001D;
121
ACPU_AutoVec6 = $8000001E;
122
ACPU_AutoVec7 = $8000001F;
124
AT_DeadEnd = $80000000;
125
AT_Recovery = $00000000;
127
AG_NoMemory = $00010000;
128
AG_MakeLib = $00020000;
129
AG_OpenLib = $00030000;
130
AG_OpenDev = $00040000;
131
AG_OpenRes = $00050000;
132
AG_IOError = $00060000;
133
AG_NoSignal = $00070000;
134
AG_BadParm = $00080000;
135
AG_CloseLib = $00090000;
136
AG_CloseDev = $000A0000;
137
AG_ProcCreate = $000B0000;
138
AG_MsgPortNotEmpty = $000C0000 { * V50 * };
140
AO_ExecLib = $00008001;
141
AO_GraphicsLib = $00008002;
142
AO_LayersLib = $00008003;
143
AO_Intuition = $00008004;
144
AO_MathLib = $00008005;
145
AO_DOSLib = $00008007;
146
AO_RAMLib = $00008008;
147
AO_IconLib = $00008009;
148
AO_ExpansionLib = $0000800A;
149
AO_DiskfontLib = $0000800B;
150
AO_UtilityLib = $0000800C;
151
AO_KeyMapLib = $0000800D;
153
AO_AudioDev = $00008010;
154
AO_ConsoleDev = $00008011;
155
AO_GamePortDev = $00008012;
156
AO_KeyboardDev = $00008013;
157
AO_TrackDiskDev = $00008014;
158
AO_TimerDev = $00008015;
160
AO_CIARsrc = $00008020;
161
AO_DiskRsrc = $00008021;
162
AO_MiscRsrc = $00008022;
164
AO_BootStrap = $00008030;
165
AO_Workbench = $00008031;
166
AO_DiskCopy = $00008032;
167
AO_GadTools = $00008033;
168
AO_Unknown = $00008035;
175
AN_ExecLib = $01000000;
176
AN_ExcptVect = $01000001;
177
AN_BaseChkSum = $01000002;
178
AN_LibChkSum = $01000003;
180
AN_MemCorrupt = $81000005;
181
AN_IntrMem = $81000006;
182
AN_InitAPtr = $01000007;
183
AN_SemCorrupt = $01000008;
185
AN_FreeTwice = $01000009;
186
AN_BogusExcpt = $8100000A;
187
AN_IOUsedTwice = $0100000B;
188
AN_MemoryInsane = $0100000C;
190
AN_IOAfterClose = $0100000D;
191
AN_StackProbe = $0100000E;
192
AN_BadFreeAddr = $0100000F;
193
AN_BadSemaphore = $01000010;
199
AN_GraphicsLib = $02000000;
200
AN_GfxNoMem = $82010000;
201
AN_GfxNoMemMspc = $82010001;
202
AN_LongFrame = $82010006;
203
AN_ShortFrame = $82010007;
204
AN_TextTmpRas = $02010009;
205
AN_BltBitMap = $8201000A;
206
AN_RegionMemory = $8201000B;
207
AN_MakeVPort = $82010030;
208
AN_GfxNewError = $0200000C;
209
AN_GfxFreeError = $0200000D;
211
AN_GfxNoLCM = $82011234;
213
AN_ObsoleteFont = $02000401;
219
AN_LayersLib = $03000000;
220
AN_LayersNoMem = $83010000;
226
AN_Intuition = $04000000;
227
AN_GadgetType = $84000001;
228
AN_BadGadget = $04000001;
229
AN_CreatePort = $84010002;
230
AN_ItemAlloc = $04010003;
231
AN_SubAlloc = $04010004;
232
AN_PlaneAlloc = $84010005;
233
AN_ItemBoxTop = $84000006;
234
AN_OpenScreen = $84010007;
235
AN_OpenScrnRast = $84010008;
236
AN_SysScrnType = $84000009;
237
AN_AddSWGadget = $8401000A;
238
AN_OpenWindow = $8401000B;
239
AN_BadState = $8400000C;
240
AN_BadMessage = $8400000D;
241
AN_WeirdEcho = $8400000E;
242
AN_NoConsole = $8400000F;
243
AN_NoISem = $04000010;
244
AN_ISemOrder = $04000011;
250
AN_MathLib = $05000000;
256
AN_DOSLib = $07000000;
257
AN_StartMem = $07010001;
258
AN_EndTask = $07000002;
259
AN_QPktFail = $07000003;
260
AN_AsyncPkt = $07000004;
261
AN_FreeVec = $07000005;
262
AN_DiskBlkSeq = $07000006;
263
AN_BitMap = $07000007;
264
AN_KeyFree = $07000008;
265
AN_BadChkSum = $07000009;
266
AN_DiskError = $0700000A;
267
AN_KeyRange = $0700000B;
268
AN_BadOverlay = $0700000C;
269
AN_BadInitFunc = $0700000D;
270
AN_FileReclosed = $0700000E;
276
AN_RAMLib = $08000000;
277
AN_BadSegList = $08000001;
283
AN_IconLib = $09000000;
289
AN_ExpansionLib = $0A000000;
290
AN_BadExpansionFree = $0A000001;
296
AN_DiskfontLib = $0B000000;
302
AN_AudioDev = $10000000;
308
AN_ConsoleDev = $11000000;
309
AN_NoWindow = $11000001;
315
AN_GamePortDev = $12000000;
321
AN_KeyboardDev = $13000000;
327
AN_TrackDiskDev = $14000000;
328
AN_TDCalibSeek = $14000001;
329
AN_TDDelay = $14000002;
335
AN_TimerDev = $15000000;
336
AN_TMBadReq = $15000001;
337
AN_TMBadSupply = $15000002;
343
AN_CIARsrc = $20000000;
349
AN_DiskRsrc = $21000000;
350
AN_DRHasDisk = $21000001;
351
AN_DRIntNoAct = $21000002;
357
AN_MiscRsrc = $22000000;
363
AN_BootStrap = $30000000;
364
AN_BootError = $30000001;
370
AN_Workbench = $31000000;
371
AN_NoFonts = $B1000001;
372
AN_WBBadStartupMsg1 = $31000001;
373
AN_WBBadStartupMsg2 = $31000002;
374
AN_WBBadIOMsg = $31000003;
375
AN_WBReLayoutToolMenu = $B1010009;
381
AN_DiskCopy = $32000000;
384
* toolkit for Intuition
387
AN_GadTools = $33000000;
390
* System utility library
393
AN_UtilityLib = $34000000;
396
* For use by any application that needs it
399
AN_Unknown = $35000000;
403
{ * exec error definitions (V50)
404
*********************************************************************
409
IOERR_OPENFAIL = (-1);
410
IOERR_ABORTED = (-2);
412
IOERR_BADLENGTH = (-4);
413
IOERR_BADADDRESS = (-5);
414
IOERR_UNITBUSY = (-6);
415
IOERR_SELFTEST = (-7);
416
IOERR_NOMEMORY = (-8);
420
{ * exec resident definitions (V50)
421
*********************************************************************
426
PResident = ^TResident;
427
TResident = packed record
429
rt_MatchTag : PResident;
430
rt_EndSkip : Pointer;
438
{ * Only valid when RTF_EXTENDED is set
440
rt_Revision : Word; { * Revision Entry * }
446
RTC_MATCHWORD = $4AFC;
448
RTF_AUTOINIT = (1 Shl 7);
449
RTF_EXTENDED = (1 Shl 6); { * structure extension is valid * }
450
{ * rt_Init points to a PPC function which must be defined as
452
* struct Library* LIB_Init(struct Library *MyLibBase,
454
* struct ExecBase *SysBase)
457
RTF_AFTERDOS = (1 Shl 2);
458
RTF_SINGLETASK = (1 Shl 1);
459
RTF_COLDSTART = (1 Shl 0);
466
{ * exec memory definitions (V50)
467
*********************************************************************
472
PMemChunk = ^TMemChunk;
473
TMemChunk = packed record
479
PMemHeader = ^TMemHeader;
480
TMemHeader = packed record
483
mh_First : PMemChunk;
490
PMemEntry = ^TMemEntry;
491
TMemEntry = packed record
494
0 : (meu_Regs: DWord);
495
1 : (meu_Addr: Pointer)
501
PMemList = ^TMemList;
502
TMemList = packed record
511
MEMF_PUBLIC = (1 Shl 0);
512
MEMF_CHIP = (1 Shl 1);
513
MEMF_FAST = (1 Shl 2);
514
MEMF_LOCAL = (1 Shl 8);
515
MEMF_24BITDMA = (1 Shl 9);
516
MEMF_KICK = (1 Shl 10);
517
MEMF_SWAP = (1 Shl 11); { * Memory that can be swapped out to disk * }
519
MEMF_CLEAR = (1 Shl 16);
520
MEMF_LARGEST = (1 Shl 17);
521
MEMF_REVERSE = (1 Shl 18);
522
MEMF_TOTAL = (1 Shl 19);
523
MEMF_SEM_PROTECTED = (1 Shl 20); { * Pools: semaphore protection * }
524
MEMF_NO_EXPUNGE = (1 Shl 31);
527
MEM_BLOCKMASK = (MEM_BLOCKSIZE - 1);
531
PMemHandlerData = ^TMemHandlerData;
532
TMemHandlerData = packed record
533
memh_RequestSize : DWord;
534
memh_RequestFlags: DWord;
540
MEMHF_RECYCLE = (1 Shl 0);
548
{ * exec port definitions (V50)
549
*********************************************************************
554
PMsgPort = ^TMsgPort;
555
TMsgPort = packed record
572
PMessage = ^TMessage;
573
TMessage = packed record
575
mn_ReplyPort: PMsgPort;
581
{ * exec task definitions (V50)
582
*********************************************************************
588
TTask = packed record
592
tc_IDNestCnt: ShortInt;
593
tc_TDNestCnt: ShortInt;
604
tc_ExceptData: Pointer;
605
tc_ExceptCode: Pointer;
606
tc_TrapData : Pointer;
607
tc_TrapCode : Pointer;
609
tc_SPLower : Pointer;
610
tc_SPUpper : Pointer;
611
tc_Switch : Pointer; { *** OBSOLETE *** }
612
tc_Launch : Pointer; { *** OBSOLETE *** }
614
tc_UserData : Pointer;
626
TF_PROCTIME = (1 Shl TB_PROCTIME);
627
TF_ETASK = (1 Shl TB_ETASK);
628
TF_STACKCHK = (1 Shl TB_STACKCHK);
629
TF_EXCEPT = (1 Shl TB_EXCEPT);
630
TF_SWITCH = (1 Shl TB_SWITCH);
631
TF_LAUNCH = (1 Shl TB_LAUNCH);
649
SIGF_ABORT = (1 Shl SIGB_ABORT);
650
SIGF_CHILD = (1 Shl SIGB_CHILD);
651
SIGF_BLIT = (1 Shl SIGB_BLIT);
652
SIGF_SINGLE = (1 Shl SIGB_SINGLE);
653
SIGF_INTUITION = (1 Shl SIGB_INTUITION);
654
SIGF_NET = (1 Shl SIGB_NET);
655
SIGF_DOS = (1 Shl SIGB_DOS);
659
PTaskTrapMessage = ^TTaskTrapMessage;
660
TTaskTrapMessage = packed record
661
Message: TMessage; { * Message Header * }
662
Task : TTask; { * connected Task * }
663
Version: DWord; { * version of the structure * }
664
TType : DWord; { * Exception Type * }
665
DAR : DWord; { * Exception Address Register * }
666
DSISR : DWord; { * Exception DSISR Reg * }
668
{ * This is undiscovered land...
669
* never assume a size of this structure
675
VERSION_TASKTRAPMESSAGE = $0;
680
TETask = packed record
691
{ * Don't touch!!!!!!!!!..there'll be an interface
693
* New Entries...most of the above entries
694
* are only their for structure compatability.
695
* They have no meaning as the OS never supported
699
{ * A Task Pool for the task.
703
{ * PPC's Stack Lower Ptr
704
* The initial stack is allocated through
705
* AllocVec, so a FreeVec(ETask^.PPCSPLower);
707
* If you use PPCStackSwap you must allocate
708
* your stack block with AllocVec();
712
{ * PPC's Stack Upper Ptr
714
PPCSPUpper : Pointer;
715
PPCRegFrame: Pointer;
716
PPCLibData : Pointer;
718
{ * On a PPC exception this msgport
719
* is sent an exception msg...
720
* the task is stopped until somebody
722
* (asynchron exception interface)
723
* If this Port is NULL the message is
724
* sent to SysBase->ex_PPCTrapMsgPort.
726
PPCTrapMsgPort: PMsgPort;
727
PPCTrapMessage: PTaskTrapMessage;
729
{ * This is undiscovered land...
730
* never assume a size of this structure
736
PTaskInitExtension = ^TTaskInitExtension;
737
TTaskInitExtension = packed record
738
{ * Must be filled with TRAP_PPCTASK
741
Extension: Word; { * Must be set to 0 * }
747
TASKTAG_DUMMY = (TAG_USER + $100000);
749
{ * Ptr to an ULONG Errorfield where a better error description
752
TASKTAG_ERROR = (TASKTAG_DUMMY + $0);
757
TASKTAG_CODETYPE = (TASKTAG_DUMMY + $1);
760
* code must be of TASKTAG_CODETYPE
762
TASKTAG_PC = (TASKTAG_DUMMY + $2);
765
* code must be of TASKTAG_CODETYPE
767
TASKTAG_FINALPC = (TASKTAG_DUMMY + $3);
769
{ * Stacksize...Default 8192
771
TASKTAG_STACKSIZE = (TASKTAG_DUMMY + $4);
774
* Default(use the stack defined by tc_SPLower..tc_SPUpper)
776
TASKTAG_STACKSIZE_M68K = (TASKTAG_DUMMY + $5);
778
{ * specify task name, name is copied
780
TASKTAG_NAME = (TASKTAG_DUMMY + $6);
784
TASKTAG_USERDATA = (TASKTAG_DUMMY + $7);
788
TASKTAG_PRI = (TASKTAG_DUMMY + $8);
790
{ * Pool's Puddlesize
792
TASKTAG_POOLPUDDLE = (TASKTAG_DUMMY + $9);
794
{ * Pool's ThreshSize
796
TASKTAG_POOLTHRESH = (TASKTAG_DUMMY + $a);
798
{ * PPC First Argument..gpr3
800
TASKTAG_PPC_ARG1 = (TASKTAG_DUMMY + $10);
802
{ * PPC First Argument..gpr4
804
TASKTAG_PPC_ARG2 = (TASKTAG_DUMMY + $11);
806
{ * PPC First Argument..gpr5
808
TASKTAG_PPC_ARG3 = (TASKTAG_DUMMY + $12);
810
{ * PPC First Argument..gpr6
812
TASKTAG_PPC_ARG4 = (TASKTAG_DUMMY + $13);
814
{ * PPC First Argument..gpr7
816
TASKTAG_PPC_ARG5 = (TASKTAG_DUMMY + $14);
818
{ * PPC First Argument..gpr8
820
TASKTAG_PPC_ARG6 = (TASKTAG_DUMMY + $15);
822
{ * PPC First Argument..gpr9
824
TASKTAG_PPC_ARG7 = (TASKTAG_DUMMY + $16);
826
{ * PPC First Argument..gpr10
828
TASKTAG_PPC_ARG8 = (TASKTAG_DUMMY + $17);
831
* Startup message to be passed to task/process, ReplyMsg'd at RemTask()
832
* ti_Data: struct Message *
834
TASKTAG_STARTUPMSG = (TASKTAG_DUMMY + $18);
837
* Create internal MsgPort for task/process, deleted at RemTask()
838
* ti_Data: struct MsgPort **, can be NULL
840
TASKTAG_TASKMSGPORT = (TASKTAG_DUMMY + $19);
852
TASKERROR_NOMEMORY = 1;
856
* Stack swap structure as passed to StackSwap() and PPCStackSwap()
859
PStackSwapStruct = ^TStackSwapStruct;
860
TStackSwapStruct = packed record
861
stk_Lower : Pointer; { * Lowest byte of stack * }
862
stk_Upper : Pointer; { *�Upper end of stack (size + Lowert) * }
863
stk_Pointer: Pointer; { * Stack pointer at switch point * }
867
PPPCStackSwapArgs = ^TPPCStackSwapArgs;
868
TPPCStackSwapArgs = packed record
869
Args: Array[0..7] Of DWord; { * The C register arguments from gpr3..gpr11 * }
874
* NewGetTaskAttrsA(), NewSetTaskAttrsA() tags
877
TASKINFOTYPE_ALLTASK = $0;
878
TASKINFOTYPE_NAME = $1;
879
TASKINFOTYPE_PRI = $2;
880
TASKINFOTYPE_TYPE = $3;
881
TASKINFOTYPE_STATE = $4;
882
TASKINFOTYPE_FLAGS = $5;
883
TASKINFOTYPE_SIGALLOC = $6;
884
TASKINFOTYPE_SIGWAIT = $7;
885
TASKINFOTYPE_SIGRECVD = $8;
886
TASKINFOTYPE_SIGEXCEPT = $9;
887
TASKINFOTYPE_EXCEPTDATA = $a;
888
TASKINFOTYPE_EXCEPTCODE = $b;
889
TASKINFOTYPE_TRAPDATA = $c;
890
TASKINFOTYPE_TRAPCODE = $d;
891
TASKINFOTYPE_STACKSIZE_M68K = $e;
892
TASKINFOTYPE_STACKSIZE = $f;
893
TASKINFOTYPE_USEDSTACKSIZE_M68K = $10;
894
TASKINFOTYPE_USEDSTACKSIZE = $11;
895
TASKINFOTYPE_TRAPMSGPORT = $12;
896
TASKINFOTYPE_STARTUPMSG = $13;
897
TASKINFOTYPE_TASKMSGPORT = $14;
898
TASKINFOTYPE_POOLPTR = $15;
899
TASKINFOTYPE_POOLMEMFLAGS = $16;
900
TASKINFOTYPE_POOLPUDDLESIZE = $17;
901
TASKINFOTYPE_POOLTHRESHSIZE = $18;
904
* Task Scheduler statistics (exec 50.42)
906
TASKINFOTYPE_NICE = $19;
907
TASKINFOTYPE_AGETICKS = $1a;
908
TASKINFOTYPE_CPUTIME = $1b;
909
TASKINFOTYPE_LASTSECCPUTIME = $1c;
910
TASKINFOTYPE_RECENTCPUTIME = $1d;
911
TASKINFOTYPE_VOLUNTARYCSW = $1e;
912
TASKINFOTYPE_INVOLUNTARYCSW = $1f;
913
TASKINFOTYPE_LASTSECVOLUNTARYCSW = $20;
914
TASKINFOTYPE_LASTSECINVOLUNTARYCSW = $21;
915
{ * Added in exec 50.45 * }
916
TASKINFOTYPE_LAUNCHTIMETICKS = $22;
917
TASKINFOTYPE_LAUNCHTIMETICKS1978 = $23;
918
TASKINFOTYPE_PID = $24;
920
TASKINFOTYPE_68K_NEWFRAME = $50;
922
TASKINFOTYPE_PPC_SRR0 = $100;
923
TASKINFOTYPE_PPC_SRR1 = $101;
924
TASKINFOTYPE_PPC_LR = $102;
925
TASKINFOTYPE_PPC_CTR = $103;
926
TASKINFOTYPE_PPC_CR = $104;
927
TASKINFOTYPE_PPC_XER = $105;
928
TASKINFOTYPE_PPC_GPR = $106;
929
TASKINFOTYPE_PPC_FPR = $107;
930
TASKINFOTYPE_PPC_FPSCR = $108;
931
TASKINFOTYPE_PPC_VSCR = $109;
932
TASKINFOTYPE_PPC_VMX = $10a;
933
TASKINFOTYPE_PPC_VSAVE = $10b;
934
TASKINFOTYPE_PPC_FRAME = $10c;
935
TASKINFOTYPE_PPC_FRAMESIZE = $10d;
936
TASKINFOTYPE_PPC_NEWFRAME = $10e;
938
TASKINFOTAG_DUMMY = (TAG_USER + $110000);
939
{ * Used with TASKINFOTYPE_ALLTASK
941
TASKINFOTAG_HOOK = (TASKINFOTAG_DUMMY + $0);
942
{ * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX
943
* to define the copy area
945
TASKINFOTAG_REGSTART = (TASKINFOTAG_DUMMY + $1);
946
{ * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX
947
* to define the copy area
949
TASKINFOTAG_REGCOUNT = (TASKINFOTAG_DUMMY + $2);
953
* NewSetTaskAttrsA(..,@TaskFrame68k,sizeof(TTaskFrame68k),TASKINFOTYPE_68K_NEWFRAME,...);
956
PTaskFrame68k = ^TTaskFrame68k;
957
TTaskFrame68k = packed record
960
Xn: Array[0..14] Of LongInt;
965
* Don't depend on these
968
DEFAULT_PPCSTACKSIZE = 32768;
969
DEFAULT_M68KSTACKSIZE = 2048;
970
DEFAULT_TASKPUDDLESIZE = 4096;
971
DEFAULT_TASKTHRESHSIZE = 4096;
974
{ * exec interrupt definitions (V50)
975
*********************************************************************
980
PInterrupt = ^TInterrupt;
981
TInterrupt = packed record
988
PIntVector = ^TIntVector;
989
TIntVector = packed record
996
PSoftIntList = ^TSoftIntList;
997
TSoftIntList = packed record
1007
INTF_NMI = (1 Shl INTB_NMI);
1011
{ * exec semaphore definitions (V50)
1012
*********************************************************************
1017
* Shouldn't be available public..
1020
PSemaphoreRequest = ^TSemaphoreRequest;
1021
TSemaphoreRequest = packed record
1027
PSignalSemaphore = ^TSignalSemaphore;
1028
TSignalSemaphore = packed record
1030
ss_NestCount : SmallInt;
1031
ss_WaitQueue : TMinList;
1032
ss_MultipleLink: TSemaphoreRequest;
1034
ss_QueueCount : SmallInt;
1038
PSemaphoreMessage = ^TSemaphoreMessage;
1039
TSemaphoreMessage = packed record
1040
ssm_Message : TMessage;
1041
ssm_Semaphore: PSignalSemaphore;
1051
{ * exec machine definitions (V50)
1052
*********************************************************************
1059
MACHINE_NO = $ffffffff;
1063
{ * exec library definitions (V50)
1064
*********************************************************************
1071
LIB_BASE = (-LIB_VECTSIZE);
1072
LIB_USERDEF = (LIB_BASE - (LIB_RESERVED * LIB_VECTSIZE));
1073
LIB_NONSTD = (LIB_USERDEF);
1079
LIB_GETQUERYATTR = -24; { * LIBF_QUERY * }
1083
PLibrary = ^TLibrary;
1084
TLibrary = packed record
1092
lib_IdString: PChar;
1099
LIBF_SUMMING = (1 Shl 0);
1100
LIBF_CHANGED = (1 Shl 1);
1101
LIBF_SUMUSED = (1 Shl 2);
1102
LIBF_DELEXP = (1 Shl 3);
1106
LIBF_RAMLIB = (1 Shl 4);
1108
* Needs to be set if the GetQueryAttr function is legal
1110
LIBF_QUERYINFO = (1 Shl 5);
1112
* The remaining bits are reserved and aren`t allowed to be touched
1116
{ * NewSetFunction extensions
1119
SETFUNCTAG_Dummy = (TAG_USER +$01000000);
1121
{ * Set the machine type of the function
1124
SETFUNCTAG_MACHINE = (SETFUNCTAG_Dummy + $1);
1126
{ * Function type specifier
1128
SETFUNCTAG_TYPE = (SETFUNCTAG_Dummy + $2);
1132
SETFUNCTAG_IDNAME = (SETFUNCTAG_Dummy + $3);
1135
* Set to TRUE if the replaced function will never be used
1138
SETFUNCTAG_DELETE = (SETFUNCTAG_Dummy + $4);
1141
{ * See emul/emulinterface.h for more informations
1144
{ * Save Emulation PPC Registers
1146
* Restore Emulation PPC Registers
1150
SETFUNCTYPE_NORMAL = 0;
1152
* Must use the global register settings of the emulation
1155
SETFUNCTYPE_QUICK = 1;
1156
{ * Save Emulation PPC Registers
1158
* Restore Emulation PPC Registers
1160
* Needed to replace functions like
1161
* forbid,obtainsemaphores which are
1162
* defined as trashing no registers
1164
SETFUNCTYPE_NORMALNR = 2;
1166
* Must use the global register settings of the emulation
1168
* Needed to replace functions like
1169
* forbid,obtainsemaphores which are
1170
* defined as trashing no registers
1172
SETFUNCTYPE_QUICKNR = 3;
1173
SETFUNCTYPE_NORMALSR = 4;
1174
SETFUNCTYPE_NORMALSRNR = 5;
1175
SETFUNCTYPE_NORMALD0_D1 = 6;
1176
SETFUNCTYPE_NORMALRESTORE = 7;
1177
SETFUNCTYPE_SYSTEMV = 8;
1178
SETFUNCTYPE_NORMALD0D1SR = 9;
1179
SETFUNCTYPE_NORMALD0D1A0A1SR = 10;
1182
{ * CreateLibrary extensions
1184
LIBTAG_BASE = (TAG_USER + $01000100);
1187
* Function/Vector Array
1189
LIBTAG_FUNCTIONINIT = (LIBTAG_BASE+$0);
1193
LIBTAG_STRUCTINIT = (LIBTAG_BASE+$1);
1197
LIBTAG_LIBRARYINIT = (LIBTAG_BASE+$2);
1201
LIBTAG_MACHINE = (LIBTAG_BASE+$3);
1205
LIBTAG_BASESIZE = (LIBTAG_BASE+$4);
1209
LIBTAG_SEGLIST = (LIBTAG_BASE+$5);
1213
LIBTAG_PRI = (LIBTAG_BASE+$6);
1215
* Library Type..Library,Device,Resource,whatever
1217
LIBTAG_TYPE = (LIBTAG_BASE+$7);
1222
LIBTAG_VERSION = (LIBTAG_BASE+$8);
1226
LIBTAG_FLAGS = (LIBTAG_BASE+$9);
1230
LIBTAG_NAME = (LIBTAG_BASE+$a);
1234
LIBTAG_IDSTRING = (LIBTAG_BASE+$b);
1236
* AddDevice(),AddLibrary(),AddResource()..
1237
* depends on LibNode.ln_Type field which
1238
* can be set by some Init function, Struct Scripts
1240
* If you set LIBTAG_PUBLIC the library
1241
* is added to the right system list.
1243
LIBTAG_PUBLIC = (LIBTAG_BASE+$c);
1248
LIBTAG_REVISION = (LIBTAG_BASE+$d);
1250
* Library QueryInfo Flag
1253
LIBTAG_QUERYINFO = (LIBTAG_BASE+$e);
1257
* don`t touch...floating design
1260
PFuncEntry = ^TFuncEntry;
1261
TFuncEntry = packed record
1262
EmulLibEntry : TEmulLibEntry;
1263
OldFunction : Pointer; { * Needed for bookkeeping * }
1266
PFuncOldEntry = ^TFuncOldEntry;
1267
TFuncOldEntry = packed record
1269
FuncEntry: PFuncEntry;
1274
* EmulLibEntry.Extension
1277
FUNCENTRYEXTF_LIBRARY = $1; { * Entry created by the OS * }
1280
* Functionarray first ULONG ID defines the format
1281
* of the functionarray for MakeFunctions()/MakeLibrary().
1283
* If there`s not such id the functionarray is a
1284
* 32Bit 68k function ptr array.
1285
* (ULONG) $ffffffff stops it
1288
{ * 68k 16bit relative functionarray ptrs
1289
* (UWORD) $ffff stops it
1292
FUNCARRAY_16BIT_OLD = $ffffffff;
1294
{ * PPC 32bit functionarray ptrs
1295
* (ULONG) $ffff stops it
1297
FUNCARRAY_32BIT_NATIVE = $fffefffe;
1299
{ * Starts a functionarray block.
1300
* This way it`s possible to mix 68k and PPC
1301
* function definitions.
1303
* FUNCTIONARRAY_BEGIN
1304
* FUNCARRAY_32BIT_NATIVE
1310
* FUNCn+1 (No ID->32Bit 68k)
1315
* FUNCARRAY_16BIT_OLD
1324
FUNCARRAY_BEGIN = $fffdfffd;
1326
{ * Ends a functionarray block.
1328
FUNCARRAY_END = $fffcfffc;
1330
{ * PPC 32bit Quick functionarray ptrs.
1331
* These functions must comply to the emulation's
1332
* register layout which is defined inside the
1333
* emul/emulregs.h. That means the register layout
1334
* MUST also be valid during interrupts/task switches.
1335
* You can't just destroy A7(r31), SR or PC.
1337
* You shouldn't use this for any normal code
1338
* as there's no real reason to do so. If you
1339
* really think you need to use it please ask
1340
* us first on the dev mailinglist.
1341
* (ULONG) $ffffffff stops it
1343
FUNCARRAY_32BIT_QUICK_NATIVE = $fffbfffb;
1345
{ * PPC 32bit QuickNR(No Result) functionarray ptrs
1346
* (ULONG) $ffffffff stops it
1348
FUNCARRAY_32BIT_QUICKNR_NATIVE = $fffafffa;
1350
{ * PPC 32bit no result functionarray ptrs
1351
* (ULONG) $ffffffff stops it
1353
FUNCARRAY_32BIT_NR_NATIVE = $fff9fff9;
1355
{ * PPC 32bit SR functionarray ptrs
1356
* (ULONG) $ffffffff stops it
1358
FUNCARRAY_32BIT_SR_NATIVE = $fff8fff8;
1360
{ * PPC 32bit SR(no result) functionarray ptrs
1361
* (ULONG) $ffffffff stops it
1363
FUNCARRAY_32BIT_SRNR_NATIVE = $fff7fff7;
1365
{ * PPC 32bit D0_D1 functionarray ptrs
1366
* (ULONG) $ffffffff stops it
1368
FUNCARRAY_32BIT_D0D1_NATIVE = $fff6fff6;
1370
{ * PPC 32bit Restore1 functionarray ptrs
1371
* (ULONG) $ffffffff stops it
1373
FUNCARRAY_32BIT_RESTORE_NATIVE = $fff5fff5;
1375
{ * PPC 32bit SystemV ABI entry
1376
* these function entries DON'T comply
1377
* to the amiga register modell REG_D0-A6
1378
* but comply to the PPC SystemV ABI so
1379
* you can directly use PPC C Argument
1380
* parsing. That way you're also not limited
1381
* with the register count.
1382
* Such library functions can't be used
1383
* by 68k emulation, so you can only use
1384
* them for new code.
1385
* As we allow these new functions to be
1386
* used with old functions we keep the
1387
* 6 bytes function entry steps in the library.
1390
* CODE_JMP, &FuncEntry ; Old Entry
1391
* CODE_ILLEGAL, Function ; SystemV ABI Entry
1394
* (ULONG) $ffffffff stops it
1396
FUNCARRAY_32BIT_SYSTEMV = $fff4fff4;
1398
{ * PPC 32bit D0D1SR functionarray ptrs
1399
* (ULONG) $ffffffff stops it
1401
FUNCARRAY_32BIT_D0D1SR_NATIVE = $fff3fff3;
1403
{ * PPC 32bit D0D1A0A1SR functionarray ptrs
1404
* (ULONG) $ffffffff stops it
1406
FUNCARRAY_32BIT_D0D1A0A1SR_NATIVE = $fff2fff2;
1410
{ * exec device definitions (V50)
1411
*********************************************************************
1417
TDevice = packed record
1418
dd_Library: TLibrary;
1423
TUnit = packed record
1424
unit_MsgPort: TMsgPort;
1432
UNITF_ACTIVE = (1 Shl 0);
1433
UNITF_INTASK = (1 Shl 1);
1437
{ * exec io definitions (V50)
1438
*********************************************************************
1443
PIORequest = ^TIORequest;
1444
TIORequest = packed record
1445
io_Message: TMessage;
1446
io_Device : PDevice;
1450
io_Error : ShortInt;
1454
PIOStdReq = ^TIOStdReq;
1455
TIOStdReq = packed record
1456
io_Message: TMessage;
1457
io_Device : PDevice;
1461
io_Error : ShortInt;
1474
IOF_QUICK = (1 Shl IOB_QUICK);
1489
{ * exec include (V50)
1490
*********************************************************************
1495
PExecBase = ^TExecBase;
1496
TExecBase = packed record
1499
LowMemChkSum: SmallInt;
1501
ColdCapture : Pointer;
1502
CoolCapture : Pointer;
1503
WarmCapture : Pointer;
1504
SysStkUpper : Pointer;
1505
SysStkLower : Pointer;
1507
DebugEntry : Pointer;
1508
DebugData : Pointer;
1509
AlertData : Pointer;
1510
MaxExtMem : Pointer;
1512
IntVects : Array[0..15] Of TIntVector;
1519
IDNestCnt : ShortInt;
1520
TDNestCnt : ShortInt;
1523
ResModules : Pointer;
1525
TaskTrapCode : Pointer;
1526
TaskExceptCode: Pointer;
1527
TaskExitCode : Pointer;
1528
TaskSigAlloc : DWord;
1529
TaskTrapAlloc : Word;
1532
ResourceList: TList;
1539
SoftInts : Array[0..5] Of TSoftIntList;
1540
LastAlert : Array[0..3] Of LongInt;
1542
VBlankFrequency : Byte;
1543
PowerSupplyFrequency: Byte;
1544
SemaphoreList : TList;
1545
KickMemPtr : Pointer;
1546
KickTagPtr : Pointer;
1547
KickCheckSum : Pointer;
1549
ex_LaunchPoint : DWord;
1550
ex_RamLibPrivate : Pointer;
1551
ex_EClockFrequency : DWord;
1552
ex_CacheControl : DWord;
1555
{ * New ABox Emulation Entries
1557
ex_EmulHandleSize : DWord; { * PPC EmulHandleSize..*private* * }
1558
ex_PPCTrapMsgPort : PMsgPort; { * PPC ABox Exception MsgPort..*private* * }
1559
ex_Reserved1 : Array[0..2] Of DWord;
1560
ex_MMULock : Pointer;
1561
ex_PatchPool : Pointer; { * PatchPool Ptr needed by SetFunction..*private* * }
1562
ex_PPCTaskExitCode : Pointer; { * PPC Task exit function * }
1563
ex_DebugFlags : DWord; { * Exec Debug Flags..*private* * }
1565
ex_MemHandlers : TMinList;
1566
ex_MemHandler : Pointer;
1571
* Outdated 68k cpu informations
1585
AFF_68010 = (1 Shl AFB_68010);
1586
AFF_68020 = (1 Shl AFB_68020);
1587
AFF_68030 = (1 Shl AFB_68030);
1588
AFF_68040 = (1 Shl AFB_68040);
1589
AFF_68881 = (1 Shl AFB_68881);
1590
AFF_68882 = (1 Shl AFB_68882);
1591
AFF_FPU40 = (1 Shl AFB_FPU40);
1592
AFF_68060 = (1 Shl AFB_68060);
1593
AFF_PRIVATE = (1 Shl AFB_PRIVATE);
1596
* Outdated 68k cache functionality
1597
* Mostly without function.
1600
CACRF_EnableI = (1 Shl 0);
1601
CACRF_FreezeI = (1 Shl 1);
1602
CACRF_ClearI = (1 Shl 3);
1603
CACRF_IBE = (1 Shl 4);
1604
CACRF_EnableD = (1 Shl 8);
1605
CACRF_FreezeD = (1 Shl 9);
1606
CACRF_ClearD = (1 Shl 11);
1607
CACRF_DBE = (1 Shl 12);
1608
CACRF_WriteAllocate = (1 Shl 13);
1609
CACRF_EnableE = (1 Shl 30);
1610
CACRF_CopyBack = (1 Shl 31);
1612
DMA_Continue = (1 Shl 1);
1613
DMA_NoModify = (1 Shl 2);
1614
DMA_ReadFromRAM = (1 Shl 3);
1620
SF_SAR = (1 Shl SB_SAR);
1621
SF_TQE = (1 Shl SB_TQE);
1622
SF_SINT = (1 Shl SB_SINT);
1625
{ ****** Debug Flags...(don`t depend on them) ********** }
1627
EXECDEBUGF_INITRESIDENT = $1;
1628
EXECDEBUGF_INITCODE = $2;
1629
EXECDEBUGF_FINDRESIDENT = $4;
1631
EXECDEBUGF_CREATELIBRARY = $10;
1632
EXECDEBUGF_SETFUNCTION = $20;
1633
EXECDEBUGF_NEWSETFUNCTION = $40;
1634
EXECDEBUGF_CHIPRAM = $80;
1636
EXECDEBUGF_ADDTASK = $100;
1637
EXECDEBUGF_REMTASK = $200;
1638
EXECDEBUGF_GETTASKATTR = $400;
1639
EXECDEBUGF_SETTASKATTR = $800;
1641
EXECDEBUGF_EXCEPTHANDLER = $1000;
1642
EXECDEBUGF_ADDDOSNODE = $2000;
1643
EXECDEBUGF_PCI = $4000;
1644
EXECDEBUGF_RAMLIB = $8000;
1646
EXECDEBUGF_NOLOGSERVER = $10000;
1647
EXECDEBUGF_NOLOGWINDOW = $20000;
1650
* "env:MorphOS/LogPath" contains the logfile path,
1651
* If not specified it`s using "ram:.morphoslog"
1653
EXECDEBUGF_LOGFILE = $40000;
1654
EXECDEBUGF_LOGKPRINTF = $80000;
1656
{ * Memory Tracking Flags
1658
EXECDEBUGF_PERMMEMTRACK = $100000;
1659
EXECDEBUGF_MEMTRACK = $200000;
1661
{ * CyberGuardPPC Flags
1663
EXECDEBUGF_CYBERGUARDDEADLY = $400000;
1667
EXECDEBUGF_LOADSEG = $01000000;
1668
EXECDEBUGF_UNLOADSEG = $02000000;
1669
EXECDEBUGF_PPCSTART = $04000000;
1675
* Enables debug output for cybergraphx
1678
EXECDEBUGF_CGXDEBUG = $08000000;
1681
* Should be used to control user LibInit/DevInit Debug output
1683
EXECDEBUGF_INIT = $40000000;
1686
* Should be used to control logging
1688
EXECDEBUGF_LOG = $80000000;
1693
EXECLIST_DEVICE = 0;
1694
EXECLIST_INTERRUPT = 1;
1695
EXECLIST_LIBRARY = 2;
1696
EXECLIST_MEMHANDLER = 3;
1697
EXECLIST_MEMHEADER = 4;
1699
EXECLIST_RESOURCE = 6;
1700
EXECLIST_SEMAPHORE = 7;
1705
* Execnotify hook message
1708
PExecNotifyMessage = ^TExecNotifyMessage;
1709
TExecNotifyMessage = packed record
1718
EXECNOTIFYF_REMOVE = (1 Shl 0); { * if clear, is ADD * }
1719
EXECNOTIFYF_POST = (1 Shl 1); { * if clear, is PRE * }
1723
* AddExecNodeTagList tags
1726
SAL_Dummy = (TAG_USER + 1000);
1727
SAL_Type = (SAL_Dummy + 1);
1728
SAL_Priority = (SAL_Dummy + 2);
1729
SAL_Name = (SAL_Dummy + 3);
1732
{$include utild2.inc}
1737
Revision 1.4 2005/02/14 17:13:30 peter
1740
Revision 1.3 2005/01/12 07:59:05 karoly
1741
* Integers changed to SmallInt to be compatible with all modes