2
This file is part of the Free Pascal run time library.
4
exec definitions (V50) for MorphOS/PowerPC
5
Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved.
8
Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
10
See the file COPYING.FPC, included in this distribution,
11
for details about the copyright.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
**********************************************************************}
23
{ * exec node definitions (V50)
24
*********************************************************************
40
TMinNode = packed record
72
{ * exec list definitions (V50)
73
*********************************************************************
89
TMinList = packed record
92
mlh_TailPred: PMinNode;
97
{ * exec alert definitions (V50)
98
*********************************************************************
103
ACPU_BusErr = $80000002;
104
ACPU_AddressErr = $80000003;
105
ACPU_InstErr = $80000004;
106
ACPU_DivZero = $80000005;
107
ACPU_CHK = $80000006;
108
ACPU_TRAPV = $80000007;
109
ACPU_PrivErr = $80000008;
110
ACPU_Trace = $80000009;
111
ACPU_LineA = $8000000A;
112
ACPU_LineF = $8000000B;
113
ACPU_Format = $8000000E;
114
ACPU_Spurious = $80000018;
115
ACPU_AutoVec1 = $80000019;
116
ACPU_AutoVec2 = $8000001A;
117
ACPU_AutoVec3 = $8000001B;
118
ACPU_AutoVec4 = $8000001C;
119
ACPU_AutoVec5 = $8000001D;
120
ACPU_AutoVec6 = $8000001E;
121
ACPU_AutoVec7 = $8000001F;
123
AT_DeadEnd = $80000000;
124
AT_Recovery = $00000000;
126
AG_NoMemory = $00010000;
127
AG_MakeLib = $00020000;
128
AG_OpenLib = $00030000;
129
AG_OpenDev = $00040000;
130
AG_OpenRes = $00050000;
131
AG_IOError = $00060000;
132
AG_NoSignal = $00070000;
133
AG_BadParm = $00080000;
134
AG_CloseLib = $00090000;
135
AG_CloseDev = $000A0000;
136
AG_ProcCreate = $000B0000;
137
AG_MsgPortNotEmpty = $000C0000 { * V50 * };
139
AO_ExecLib = $00008001;
140
AO_GraphicsLib = $00008002;
141
AO_LayersLib = $00008003;
142
AO_Intuition = $00008004;
143
AO_MathLib = $00008005;
144
AO_DOSLib = $00008007;
145
AO_RAMLib = $00008008;
146
AO_IconLib = $00008009;
147
AO_ExpansionLib = $0000800A;
148
AO_DiskfontLib = $0000800B;
149
AO_UtilityLib = $0000800C;
150
AO_KeyMapLib = $0000800D;
152
AO_AudioDev = $00008010;
153
AO_ConsoleDev = $00008011;
154
AO_GamePortDev = $00008012;
155
AO_KeyboardDev = $00008013;
156
AO_TrackDiskDev = $00008014;
157
AO_TimerDev = $00008015;
159
AO_CIARsrc = $00008020;
160
AO_DiskRsrc = $00008021;
161
AO_MiscRsrc = $00008022;
163
AO_BootStrap = $00008030;
164
AO_Workbench = $00008031;
165
AO_DiskCopy = $00008032;
166
AO_GadTools = $00008033;
167
AO_Unknown = $00008035;
174
AN_ExecLib = $01000000;
175
AN_ExcptVect = $01000001;
176
AN_BaseChkSum = $01000002;
177
AN_LibChkSum = $01000003;
179
AN_MemCorrupt = $81000005;
180
AN_IntrMem = $81000006;
181
AN_InitAPtr = $01000007;
182
AN_SemCorrupt = $01000008;
184
AN_FreeTwice = $01000009;
185
AN_BogusExcpt = $8100000A;
186
AN_IOUsedTwice = $0100000B;
187
AN_MemoryInsane = $0100000C;
189
AN_IOAfterClose = $0100000D;
190
AN_StackProbe = $0100000E;
191
AN_BadFreeAddr = $0100000F;
192
AN_BadSemaphore = $01000010;
198
AN_GraphicsLib = $02000000;
199
AN_GfxNoMem = $82010000;
200
AN_GfxNoMemMspc = $82010001;
201
AN_LongFrame = $82010006;
202
AN_ShortFrame = $82010007;
203
AN_TextTmpRas = $02010009;
204
AN_BltBitMap = $8201000A;
205
AN_RegionMemory = $8201000B;
206
AN_MakeVPort = $82010030;
207
AN_GfxNewError = $0200000C;
208
AN_GfxFreeError = $0200000D;
210
AN_GfxNoLCM = $82011234;
212
AN_ObsoleteFont = $02000401;
218
AN_LayersLib = $03000000;
219
AN_LayersNoMem = $83010000;
225
AN_Intuition = $04000000;
226
AN_GadgetType = $84000001;
227
AN_BadGadget = $04000001;
228
AN_CreatePort = $84010002;
229
AN_ItemAlloc = $04010003;
230
AN_SubAlloc = $04010004;
231
AN_PlaneAlloc = $84010005;
232
AN_ItemBoxTop = $84000006;
233
AN_OpenScreen = $84010007;
234
AN_OpenScrnRast = $84010008;
235
AN_SysScrnType = $84000009;
236
AN_AddSWGadget = $8401000A;
237
AN_OpenWindow = $8401000B;
238
AN_BadState = $8400000C;
239
AN_BadMessage = $8400000D;
240
AN_WeirdEcho = $8400000E;
241
AN_NoConsole = $8400000F;
242
AN_NoISem = $04000010;
243
AN_ISemOrder = $04000011;
249
AN_MathLib = $05000000;
255
AN_DOSLib = $07000000;
256
AN_StartMem = $07010001;
257
AN_EndTask = $07000002;
258
AN_QPktFail = $07000003;
259
AN_AsyncPkt = $07000004;
260
AN_FreeVec = $07000005;
261
AN_DiskBlkSeq = $07000006;
262
AN_BitMap = $07000007;
263
AN_KeyFree = $07000008;
264
AN_BadChkSum = $07000009;
265
AN_DiskError = $0700000A;
266
AN_KeyRange = $0700000B;
267
AN_BadOverlay = $0700000C;
268
AN_BadInitFunc = $0700000D;
269
AN_FileReclosed = $0700000E;
275
AN_RAMLib = $08000000;
276
AN_BadSegList = $08000001;
282
AN_IconLib = $09000000;
288
AN_ExpansionLib = $0A000000;
289
AN_BadExpansionFree = $0A000001;
295
AN_DiskfontLib = $0B000000;
301
AN_AudioDev = $10000000;
307
AN_ConsoleDev = $11000000;
308
AN_NoWindow = $11000001;
314
AN_GamePortDev = $12000000;
320
AN_KeyboardDev = $13000000;
326
AN_TrackDiskDev = $14000000;
327
AN_TDCalibSeek = $14000001;
328
AN_TDDelay = $14000002;
334
AN_TimerDev = $15000000;
335
AN_TMBadReq = $15000001;
336
AN_TMBadSupply = $15000002;
342
AN_CIARsrc = $20000000;
348
AN_DiskRsrc = $21000000;
349
AN_DRHasDisk = $21000001;
350
AN_DRIntNoAct = $21000002;
356
AN_MiscRsrc = $22000000;
362
AN_BootStrap = $30000000;
363
AN_BootError = $30000001;
369
AN_Workbench = $31000000;
370
AN_NoFonts = $B1000001;
371
AN_WBBadStartupMsg1 = $31000001;
372
AN_WBBadStartupMsg2 = $31000002;
373
AN_WBBadIOMsg = $31000003;
374
AN_WBReLayoutToolMenu = $B1010009;
380
AN_DiskCopy = $32000000;
383
* toolkit for Intuition
386
AN_GadTools = $33000000;
389
* System utility library
392
AN_UtilityLib = $34000000;
395
* For use by any application that needs it
398
AN_Unknown = $35000000;
402
{ * exec error definitions (V50)
403
*********************************************************************
408
IOERR_OPENFAIL = (-1);
409
IOERR_ABORTED = (-2);
411
IOERR_BADLENGTH = (-4);
412
IOERR_BADADDRESS = (-5);
413
IOERR_UNITBUSY = (-6);
414
IOERR_SELFTEST = (-7);
415
IOERR_NOMEMORY = (-8);
419
{ * exec resident definitions (V50)
420
*********************************************************************
425
PResident = ^TResident;
426
TResident = packed record
428
rt_MatchTag : PResident;
429
rt_EndSkip : Pointer;
437
{ * Only valid when RTF_EXTENDED is set
439
rt_Revision : Word; { * Revision Entry * }
445
RTC_MATCHWORD = $4AFC;
447
RTF_AUTOINIT = (1 Shl 7);
448
RTF_EXTENDED = (1 Shl 6); { * structure extension is valid * }
449
{ * rt_Init points to a PPC function which must be defined as
451
* struct Library* LIB_Init(struct Library *MyLibBase,
453
* struct ExecBase *SysBase)
456
RTF_AFTERDOS = (1 Shl 2);
457
RTF_SINGLETASK = (1 Shl 1);
458
RTF_COLDSTART = (1 Shl 0);
465
{ * exec memory definitions (V50)
466
*********************************************************************
471
PMemChunk = ^TMemChunk;
472
TMemChunk = packed record
478
PMemHeader = ^TMemHeader;
479
TMemHeader = packed record
482
mh_First : PMemChunk;
489
PMemEntry = ^TMemEntry;
490
TMemEntry = packed record
493
0 : (meu_Regs: DWord);
494
1 : (meu_Addr: Pointer)
500
PMemList = ^TMemList;
501
TMemList = packed record
510
MEMF_PUBLIC = (1 Shl 0);
511
MEMF_CHIP = (1 Shl 1);
512
MEMF_FAST = (1 Shl 2);
513
MEMF_LOCAL = (1 Shl 8);
514
MEMF_24BITDMA = (1 Shl 9);
515
MEMF_KICK = (1 Shl 10);
516
MEMF_SWAP = (1 Shl 11); { * Memory that can be swapped out to disk * }
518
MEMF_CLEAR = (1 Shl 16);
519
MEMF_LARGEST = (1 Shl 17);
520
MEMF_REVERSE = (1 Shl 18);
521
MEMF_TOTAL = (1 Shl 19);
522
MEMF_SEM_PROTECTED = (1 Shl 20); { * Pools: semaphore protection * }
523
MEMF_NO_EXPUNGE = (1 Shl 31);
526
MEM_BLOCKMASK = (MEM_BLOCKSIZE - 1);
530
PMemHandlerData = ^TMemHandlerData;
531
TMemHandlerData = packed record
532
memh_RequestSize : DWord;
533
memh_RequestFlags: DWord;
539
MEMHF_RECYCLE = (1 Shl 0);
547
{ * exec port definitions (V50)
548
*********************************************************************
553
PMsgPort = ^TMsgPort;
554
TMsgPort = packed record
571
PMessage = ^TMessage;
572
TMessage = packed record
574
mn_ReplyPort: PMsgPort;
580
{ * exec task definitions (V50)
581
*********************************************************************
587
TTask = packed record
591
tc_IDNestCnt: ShortInt;
592
tc_TDNestCnt: ShortInt;
603
tc_ExceptData: Pointer;
604
tc_ExceptCode: Pointer;
605
tc_TrapData : Pointer;
606
tc_TrapCode : Pointer;
608
tc_SPLower : Pointer;
609
tc_SPUpper : Pointer;
610
tc_Switch : Pointer; { *** OBSOLETE *** }
611
tc_Launch : Pointer; { *** OBSOLETE *** }
613
tc_UserData : Pointer;
625
TF_PROCTIME = (1 Shl TB_PROCTIME);
626
TF_ETASK = (1 Shl TB_ETASK);
627
TF_STACKCHK = (1 Shl TB_STACKCHK);
628
TF_EXCEPT = (1 Shl TB_EXCEPT);
629
TF_SWITCH = (1 Shl TB_SWITCH);
630
TF_LAUNCH = (1 Shl TB_LAUNCH);
648
SIGF_ABORT = (1 Shl SIGB_ABORT);
649
SIGF_CHILD = (1 Shl SIGB_CHILD);
650
SIGF_BLIT = (1 Shl SIGB_BLIT);
651
SIGF_SINGLE = (1 Shl SIGB_SINGLE);
652
SIGF_INTUITION = (1 Shl SIGB_INTUITION);
653
SIGF_NET = (1 Shl SIGB_NET);
654
SIGF_DOS = (1 Shl SIGB_DOS);
658
PTaskTrapMessage = ^TTaskTrapMessage;
659
TTaskTrapMessage = packed record
660
Message: TMessage; { * Message Header * }
661
Task : TTask; { * connected Task * }
662
Version: DWord; { * version of the structure * }
663
TType : DWord; { * Exception Type * }
664
DAR : DWord; { * Exception Address Register * }
665
DSISR : DWord; { * Exception DSISR Reg * }
667
{ * This is undiscovered land...
668
* never assume a size of this structure
674
VERSION_TASKTRAPMESSAGE = $0;
679
TETask = packed record
690
{ * Don't touch!!!!!!!!!..there'll be an interface
692
* New Entries...most of the above entries
693
* are only their for structure compatability.
694
* They have no meaning as the OS never supported
698
{ * A Task Pool for the task.
702
{ * PPC's Stack Lower Ptr
703
* The initial stack is allocated through
704
* AllocVec, so a FreeVec(ETask^.PPCSPLower);
706
* If you use PPCStackSwap you must allocate
707
* your stack block with AllocVec();
711
{ * PPC's Stack Upper Ptr
713
PPCSPUpper : Pointer;
714
PPCRegFrame: Pointer;
715
PPCLibData : Pointer;
717
{ * On a PPC exception this msgport
718
* is sent an exception msg...
719
* the task is stopped until somebody
721
* (asynchron exception interface)
722
* If this Port is NULL the message is
723
* sent to SysBase->ex_PPCTrapMsgPort.
725
PPCTrapMsgPort: PMsgPort;
726
PPCTrapMessage: PTaskTrapMessage;
728
{ * This is undiscovered land...
729
* never assume a size of this structure
735
PTaskInitExtension = ^TTaskInitExtension;
736
TTaskInitExtension = packed record
737
{ * Must be filled with TRAP_PPCTASK
740
Extension: Word; { * Must be set to 0 * }
746
TASKTAG_DUMMY = (TAG_USER + $100000);
748
{ * Ptr to an ULONG Errorfield where a better error description
751
TASKTAG_ERROR = (TASKTAG_DUMMY + $0);
756
TASKTAG_CODETYPE = (TASKTAG_DUMMY + $1);
759
* code must be of TASKTAG_CODETYPE
761
TASKTAG_PC = (TASKTAG_DUMMY + $2);
764
* code must be of TASKTAG_CODETYPE
766
TASKTAG_FINALPC = (TASKTAG_DUMMY + $3);
768
{ * Stacksize...Default 8192
770
TASKTAG_STACKSIZE = (TASKTAG_DUMMY + $4);
773
* Default(use the stack defined by tc_SPLower..tc_SPUpper)
775
TASKTAG_STACKSIZE_M68K = (TASKTAG_DUMMY + $5);
777
{ * specify task name, name is copied
779
TASKTAG_NAME = (TASKTAG_DUMMY + $6);
783
TASKTAG_USERDATA = (TASKTAG_DUMMY + $7);
787
TASKTAG_PRI = (TASKTAG_DUMMY + $8);
789
{ * Pool's Puddlesize
791
TASKTAG_POOLPUDDLE = (TASKTAG_DUMMY + $9);
793
{ * Pool's ThreshSize
795
TASKTAG_POOLTHRESH = (TASKTAG_DUMMY + $a);
797
{ * PPC First Argument..gpr3
799
TASKTAG_PPC_ARG1 = (TASKTAG_DUMMY + $10);
801
{ * PPC First Argument..gpr4
803
TASKTAG_PPC_ARG2 = (TASKTAG_DUMMY + $11);
805
{ * PPC First Argument..gpr5
807
TASKTAG_PPC_ARG3 = (TASKTAG_DUMMY + $12);
809
{ * PPC First Argument..gpr6
811
TASKTAG_PPC_ARG4 = (TASKTAG_DUMMY + $13);
813
{ * PPC First Argument..gpr7
815
TASKTAG_PPC_ARG5 = (TASKTAG_DUMMY + $14);
817
{ * PPC First Argument..gpr8
819
TASKTAG_PPC_ARG6 = (TASKTAG_DUMMY + $15);
821
{ * PPC First Argument..gpr9
823
TASKTAG_PPC_ARG7 = (TASKTAG_DUMMY + $16);
825
{ * PPC First Argument..gpr10
827
TASKTAG_PPC_ARG8 = (TASKTAG_DUMMY + $17);
830
* Startup message to be passed to task/process, ReplyMsg'd at RemTask()
831
* ti_Data: struct Message *
833
TASKTAG_STARTUPMSG = (TASKTAG_DUMMY + $18);
836
* Create internal MsgPort for task/process, deleted at RemTask()
837
* ti_Data: struct MsgPort **, can be NULL
839
TASKTAG_TASKMSGPORT = (TASKTAG_DUMMY + $19);
851
TASKERROR_NOMEMORY = 1;
855
* Stack swap structure as passed to StackSwap() and PPCStackSwap()
858
PStackSwapStruct = ^TStackSwapStruct;
859
TStackSwapStruct = packed record
860
stk_Lower : Pointer; { * Lowest byte of stack * }
861
stk_Upper : Pointer; { *�Upper end of stack (size + Lowert) * }
862
stk_Pointer: Pointer; { * Stack pointer at switch point * }
866
PPPCStackSwapArgs = ^TPPCStackSwapArgs;
867
TPPCStackSwapArgs = packed record
868
Args: Array[0..7] Of DWord; { * The C register arguments from gpr3..gpr11 * }
873
* NewGetTaskAttrsA(), NewSetTaskAttrsA() tags
876
TASKINFOTYPE_ALLTASK = $0;
877
TASKINFOTYPE_NAME = $1;
878
TASKINFOTYPE_PRI = $2;
879
TASKINFOTYPE_TYPE = $3;
880
TASKINFOTYPE_STATE = $4;
881
TASKINFOTYPE_FLAGS = $5;
882
TASKINFOTYPE_SIGALLOC = $6;
883
TASKINFOTYPE_SIGWAIT = $7;
884
TASKINFOTYPE_SIGRECVD = $8;
885
TASKINFOTYPE_SIGEXCEPT = $9;
886
TASKINFOTYPE_EXCEPTDATA = $a;
887
TASKINFOTYPE_EXCEPTCODE = $b;
888
TASKINFOTYPE_TRAPDATA = $c;
889
TASKINFOTYPE_TRAPCODE = $d;
890
TASKINFOTYPE_STACKSIZE_M68K = $e;
891
TASKINFOTYPE_STACKSIZE = $f;
892
TASKINFOTYPE_USEDSTACKSIZE_M68K = $10;
893
TASKINFOTYPE_USEDSTACKSIZE = $11;
894
TASKINFOTYPE_TRAPMSGPORT = $12;
895
TASKINFOTYPE_STARTUPMSG = $13;
896
TASKINFOTYPE_TASKMSGPORT = $14;
897
TASKINFOTYPE_POOLPTR = $15;
898
TASKINFOTYPE_POOLMEMFLAGS = $16;
899
TASKINFOTYPE_POOLPUDDLESIZE = $17;
900
TASKINFOTYPE_POOLTHRESHSIZE = $18;
903
* Task Scheduler statistics (exec 50.42)
905
TASKINFOTYPE_NICE = $19;
906
TASKINFOTYPE_AGETICKS = $1a;
907
TASKINFOTYPE_CPUTIME = $1b;
908
TASKINFOTYPE_LASTSECCPUTIME = $1c;
909
TASKINFOTYPE_RECENTCPUTIME = $1d;
910
TASKINFOTYPE_VOLUNTARYCSW = $1e;
911
TASKINFOTYPE_INVOLUNTARYCSW = $1f;
912
TASKINFOTYPE_LASTSECVOLUNTARYCSW = $20;
913
TASKINFOTYPE_LASTSECINVOLUNTARYCSW = $21;
914
{ * Added in exec 50.45 * }
915
TASKINFOTYPE_LAUNCHTIMETICKS = $22;
916
TASKINFOTYPE_LAUNCHTIMETICKS1978 = $23;
917
TASKINFOTYPE_PID = $24;
919
TASKINFOTYPE_68K_NEWFRAME = $50;
921
TASKINFOTYPE_PPC_SRR0 = $100;
922
TASKINFOTYPE_PPC_SRR1 = $101;
923
TASKINFOTYPE_PPC_LR = $102;
924
TASKINFOTYPE_PPC_CTR = $103;
925
TASKINFOTYPE_PPC_CR = $104;
926
TASKINFOTYPE_PPC_XER = $105;
927
TASKINFOTYPE_PPC_GPR = $106;
928
TASKINFOTYPE_PPC_FPR = $107;
929
TASKINFOTYPE_PPC_FPSCR = $108;
930
TASKINFOTYPE_PPC_VSCR = $109;
931
TASKINFOTYPE_PPC_VMX = $10a;
932
TASKINFOTYPE_PPC_VSAVE = $10b;
933
TASKINFOTYPE_PPC_FRAME = $10c;
934
TASKINFOTYPE_PPC_FRAMESIZE = $10d;
935
TASKINFOTYPE_PPC_NEWFRAME = $10e;
937
TASKINFOTAG_DUMMY = (TAG_USER + $110000);
938
{ * Used with TASKINFOTYPE_ALLTASK
940
TASKINFOTAG_HOOK = (TASKINFOTAG_DUMMY + $0);
941
{ * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX
942
* to define the copy area
944
TASKINFOTAG_REGSTART = (TASKINFOTAG_DUMMY + $1);
945
{ * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX
946
* to define the copy area
948
TASKINFOTAG_REGCOUNT = (TASKINFOTAG_DUMMY + $2);
952
* NewSetTaskAttrsA(..,@TaskFrame68k,sizeof(TTaskFrame68k),TASKINFOTYPE_68K_NEWFRAME,...);
955
PTaskFrame68k = ^TTaskFrame68k;
956
TTaskFrame68k = packed record
959
Xn: Array[0..14] Of LongInt;
964
* Don't depend on these
967
DEFAULT_PPCSTACKSIZE = 32768;
968
DEFAULT_M68KSTACKSIZE = 2048;
969
DEFAULT_TASKPUDDLESIZE = 4096;
970
DEFAULT_TASKTHRESHSIZE = 4096;
973
{ * exec interrupt definitions (V50)
974
*********************************************************************
979
PInterrupt = ^TInterrupt;
980
TInterrupt = packed record
987
PIntVector = ^TIntVector;
988
TIntVector = packed record
995
PSoftIntList = ^TSoftIntList;
996
TSoftIntList = packed record
1006
INTF_NMI = (1 Shl INTB_NMI);
1010
{ * exec semaphore definitions (V50)
1011
*********************************************************************
1016
* Shouldn't be available public..
1019
PSemaphoreRequest = ^TSemaphoreRequest;
1020
TSemaphoreRequest = packed record
1026
PSignalSemaphore = ^TSignalSemaphore;
1027
TSignalSemaphore = packed record
1029
ss_NestCount : SmallInt;
1030
ss_WaitQueue : TMinList;
1031
ss_MultipleLink: TSemaphoreRequest;
1033
ss_QueueCount : SmallInt;
1037
PSemaphoreMessage = ^TSemaphoreMessage;
1038
TSemaphoreMessage = packed record
1039
ssm_Message : TMessage;
1040
ssm_Semaphore: PSignalSemaphore;
1050
{ * exec machine definitions (V50)
1051
*********************************************************************
1058
MACHINE_NO = $ffffffff;
1062
{ * exec library definitions (V50)
1063
*********************************************************************
1070
LIB_BASE = (-LIB_VECTSIZE);
1071
LIB_USERDEF = (LIB_BASE - (LIB_RESERVED * LIB_VECTSIZE));
1072
LIB_NONSTD = (LIB_USERDEF);
1078
LIB_GETQUERYATTR = -24; { * LIBF_QUERY * }
1082
PLibrary = ^TLibrary;
1083
TLibrary = packed record
1091
lib_IdString: PChar;
1098
LIBF_SUMMING = (1 Shl 0);
1099
LIBF_CHANGED = (1 Shl 1);
1100
LIBF_SUMUSED = (1 Shl 2);
1101
LIBF_DELEXP = (1 Shl 3);
1105
LIBF_RAMLIB = (1 Shl 4);
1107
* Needs to be set if the GetQueryAttr function is legal
1109
LIBF_QUERYINFO = (1 Shl 5);
1111
* The remaining bits are reserved and aren`t allowed to be touched
1115
{ * NewSetFunction extensions
1118
SETFUNCTAG_Dummy = (TAG_USER +$01000000);
1120
{ * Set the machine type of the function
1123
SETFUNCTAG_MACHINE = (SETFUNCTAG_Dummy + $1);
1125
{ * Function type specifier
1127
SETFUNCTAG_TYPE = (SETFUNCTAG_Dummy + $2);
1131
SETFUNCTAG_IDNAME = (SETFUNCTAG_Dummy + $3);
1134
* Set to TRUE if the replaced function will never be used
1137
SETFUNCTAG_DELETE = (SETFUNCTAG_Dummy + $4);
1140
{ * See emul/emulinterface.h for more informations
1143
{ * Save Emulation PPC Registers
1145
* Restore Emulation PPC Registers
1149
SETFUNCTYPE_NORMAL = 0;
1151
* Must use the global register settings of the emulation
1154
SETFUNCTYPE_QUICK = 1;
1155
{ * Save Emulation PPC Registers
1157
* Restore Emulation PPC Registers
1159
* Needed to replace functions like
1160
* forbid,obtainsemaphores which are
1161
* defined as trashing no registers
1163
SETFUNCTYPE_NORMALNR = 2;
1165
* Must use the global register settings of the emulation
1167
* Needed to replace functions like
1168
* forbid,obtainsemaphores which are
1169
* defined as trashing no registers
1171
SETFUNCTYPE_QUICKNR = 3;
1172
SETFUNCTYPE_NORMALSR = 4;
1173
SETFUNCTYPE_NORMALSRNR = 5;
1174
SETFUNCTYPE_NORMALD0_D1 = 6;
1175
SETFUNCTYPE_NORMALRESTORE = 7;
1176
SETFUNCTYPE_SYSTEMV = 8;
1177
SETFUNCTYPE_NORMALD0D1SR = 9;
1178
SETFUNCTYPE_NORMALD0D1A0A1SR = 10;
1181
{ * CreateLibrary extensions
1183
LIBTAG_BASE = (TAG_USER + $01000100);
1186
* Function/Vector Array
1188
LIBTAG_FUNCTIONINIT = (LIBTAG_BASE+$0);
1192
LIBTAG_STRUCTINIT = (LIBTAG_BASE+$1);
1196
LIBTAG_LIBRARYINIT = (LIBTAG_BASE+$2);
1200
LIBTAG_MACHINE = (LIBTAG_BASE+$3);
1204
LIBTAG_BASESIZE = (LIBTAG_BASE+$4);
1208
LIBTAG_SEGLIST = (LIBTAG_BASE+$5);
1212
LIBTAG_PRI = (LIBTAG_BASE+$6);
1214
* Library Type..Library,Device,Resource,whatever
1216
LIBTAG_TYPE = (LIBTAG_BASE+$7);
1221
LIBTAG_VERSION = (LIBTAG_BASE+$8);
1225
LIBTAG_FLAGS = (LIBTAG_BASE+$9);
1229
LIBTAG_NAME = (LIBTAG_BASE+$a);
1233
LIBTAG_IDSTRING = (LIBTAG_BASE+$b);
1235
* AddDevice(),AddLibrary(),AddResource()..
1236
* depends on LibNode.ln_Type field which
1237
* can be set by some Init function, Struct Scripts
1239
* If you set LIBTAG_PUBLIC the library
1240
* is added to the right system list.
1242
LIBTAG_PUBLIC = (LIBTAG_BASE+$c);
1247
LIBTAG_REVISION = (LIBTAG_BASE+$d);
1249
* Library QueryInfo Flag
1252
LIBTAG_QUERYINFO = (LIBTAG_BASE+$e);
1256
* don`t touch...floating design
1259
PFuncEntry = ^TFuncEntry;
1260
TFuncEntry = packed record
1261
EmulLibEntry : TEmulLibEntry;
1262
OldFunction : Pointer; { * Needed for bookkeeping * }
1265
PFuncOldEntry = ^TFuncOldEntry;
1266
TFuncOldEntry = packed record
1268
FuncEntry: PFuncEntry;
1273
* EmulLibEntry.Extension
1276
FUNCENTRYEXTF_LIBRARY = $1; { * Entry created by the OS * }
1279
* Functionarray first ULONG ID defines the format
1280
* of the functionarray for MakeFunctions()/MakeLibrary().
1282
* If there`s not such id the functionarray is a
1283
* 32Bit 68k function ptr array.
1284
* (ULONG) $ffffffff stops it
1287
{ * 68k 16bit relative functionarray ptrs
1288
* (UWORD) $ffff stops it
1291
FUNCARRAY_16BIT_OLD = $ffffffff;
1293
{ * PPC 32bit functionarray ptrs
1294
* (ULONG) $ffff stops it
1296
FUNCARRAY_32BIT_NATIVE = $fffefffe;
1298
{ * Starts a functionarray block.
1299
* This way it`s possible to mix 68k and PPC
1300
* function definitions.
1302
* FUNCTIONARRAY_BEGIN
1303
* FUNCARRAY_32BIT_NATIVE
1309
* FUNCn+1 (No ID->32Bit 68k)
1314
* FUNCARRAY_16BIT_OLD
1323
FUNCARRAY_BEGIN = $fffdfffd;
1325
{ * Ends a functionarray block.
1327
FUNCARRAY_END = $fffcfffc;
1329
{ * PPC 32bit Quick functionarray ptrs.
1330
* These functions must comply to the emulation's
1331
* register layout which is defined inside the
1332
* emul/emulregs.h. That means the register layout
1333
* MUST also be valid during interrupts/task switches.
1334
* You can't just destroy A7(r31), SR or PC.
1336
* You shouldn't use this for any normal code
1337
* as there's no real reason to do so. If you
1338
* really think you need to use it please ask
1339
* us first on the dev mailinglist.
1340
* (ULONG) $ffffffff stops it
1342
FUNCARRAY_32BIT_QUICK_NATIVE = $fffbfffb;
1344
{ * PPC 32bit QuickNR(No Result) functionarray ptrs
1345
* (ULONG) $ffffffff stops it
1347
FUNCARRAY_32BIT_QUICKNR_NATIVE = $fffafffa;
1349
{ * PPC 32bit no result functionarray ptrs
1350
* (ULONG) $ffffffff stops it
1352
FUNCARRAY_32BIT_NR_NATIVE = $fff9fff9;
1354
{ * PPC 32bit SR functionarray ptrs
1355
* (ULONG) $ffffffff stops it
1357
FUNCARRAY_32BIT_SR_NATIVE = $fff8fff8;
1359
{ * PPC 32bit SR(no result) functionarray ptrs
1360
* (ULONG) $ffffffff stops it
1362
FUNCARRAY_32BIT_SRNR_NATIVE = $fff7fff7;
1364
{ * PPC 32bit D0_D1 functionarray ptrs
1365
* (ULONG) $ffffffff stops it
1367
FUNCARRAY_32BIT_D0D1_NATIVE = $fff6fff6;
1369
{ * PPC 32bit Restore1 functionarray ptrs
1370
* (ULONG) $ffffffff stops it
1372
FUNCARRAY_32BIT_RESTORE_NATIVE = $fff5fff5;
1374
{ * PPC 32bit SystemV ABI entry
1375
* these function entries DON'T comply
1376
* to the amiga register modell REG_D0-A6
1377
* but comply to the PPC SystemV ABI so
1378
* you can directly use PPC C Argument
1379
* parsing. That way you're also not limited
1380
* with the register count.
1381
* Such library functions can't be used
1382
* by 68k emulation, so you can only use
1383
* them for new code.
1384
* As we allow these new functions to be
1385
* used with old functions we keep the
1386
* 6 bytes function entry steps in the library.
1389
* CODE_JMP, &FuncEntry ; Old Entry
1390
* CODE_ILLEGAL, Function ; SystemV ABI Entry
1393
* (ULONG) $ffffffff stops it
1395
FUNCARRAY_32BIT_SYSTEMV = $fff4fff4;
1397
{ * PPC 32bit D0D1SR functionarray ptrs
1398
* (ULONG) $ffffffff stops it
1400
FUNCARRAY_32BIT_D0D1SR_NATIVE = $fff3fff3;
1402
{ * PPC 32bit D0D1A0A1SR functionarray ptrs
1403
* (ULONG) $ffffffff stops it
1405
FUNCARRAY_32BIT_D0D1A0A1SR_NATIVE = $fff2fff2;
1409
{ * exec device definitions (V50)
1410
*********************************************************************
1416
TDevice = packed record
1417
dd_Library: TLibrary;
1422
TUnit = packed record
1423
unit_MsgPort: TMsgPort;
1431
UNITF_ACTIVE = (1 Shl 0);
1432
UNITF_INTASK = (1 Shl 1);
1436
{ * exec io definitions (V50)
1437
*********************************************************************
1442
PIORequest = ^TIORequest;
1443
TIORequest = packed record
1444
io_Message: TMessage;
1445
io_Device : PDevice;
1449
io_Error : ShortInt;
1453
PIOStdReq = ^TIOStdReq;
1454
TIOStdReq = packed record
1455
io_Message: TMessage;
1456
io_Device : PDevice;
1460
io_Error : ShortInt;
1473
IOF_QUICK = (1 Shl IOB_QUICK);
1488
{ * exec include (V50)
1489
*********************************************************************
1494
PExecBase = ^TExecBase;
1495
TExecBase = packed record
1498
LowMemChkSum: SmallInt;
1500
ColdCapture : Pointer;
1501
CoolCapture : Pointer;
1502
WarmCapture : Pointer;
1503
SysStkUpper : Pointer;
1504
SysStkLower : Pointer;
1506
DebugEntry : Pointer;
1507
DebugData : Pointer;
1508
AlertData : Pointer;
1509
MaxExtMem : Pointer;
1511
IntVects : Array[0..15] Of TIntVector;
1518
IDNestCnt : ShortInt;
1519
TDNestCnt : ShortInt;
1522
ResModules : Pointer;
1524
TaskTrapCode : Pointer;
1525
TaskExceptCode: Pointer;
1526
TaskExitCode : Pointer;
1527
TaskSigAlloc : DWord;
1528
TaskTrapAlloc : Word;
1531
ResourceList: TList;
1538
SoftInts : Array[0..5] Of TSoftIntList;
1539
LastAlert : Array[0..3] Of LongInt;
1541
VBlankFrequency : Byte;
1542
PowerSupplyFrequency: Byte;
1543
SemaphoreList : TList;
1544
KickMemPtr : Pointer;
1545
KickTagPtr : Pointer;
1546
KickCheckSum : Pointer;
1548
ex_LaunchPoint : DWord;
1549
ex_RamLibPrivate : Pointer;
1550
ex_EClockFrequency : DWord;
1551
ex_CacheControl : DWord;
1554
{ * New ABox Emulation Entries
1556
ex_EmulHandleSize : DWord; { * PPC EmulHandleSize..*private* * }
1557
ex_PPCTrapMsgPort : PMsgPort; { * PPC ABox Exception MsgPort..*private* * }
1558
ex_Reserved1 : Array[0..2] Of DWord;
1559
ex_MMULock : Pointer;
1560
ex_PatchPool : Pointer; { * PatchPool Ptr needed by SetFunction..*private* * }
1561
ex_PPCTaskExitCode : Pointer; { * PPC Task exit function * }
1562
ex_DebugFlags : DWord; { * Exec Debug Flags..*private* * }
1564
ex_MemHandlers : TMinList;
1565
ex_MemHandler : Pointer;
1570
* Outdated 68k cpu informations
1584
AFF_68010 = (1 Shl AFB_68010);
1585
AFF_68020 = (1 Shl AFB_68020);
1586
AFF_68030 = (1 Shl AFB_68030);
1587
AFF_68040 = (1 Shl AFB_68040);
1588
AFF_68881 = (1 Shl AFB_68881);
1589
AFF_68882 = (1 Shl AFB_68882);
1590
AFF_FPU40 = (1 Shl AFB_FPU40);
1591
AFF_68060 = (1 Shl AFB_68060);
1592
AFF_PRIVATE = (1 Shl AFB_PRIVATE);
1595
* Outdated 68k cache functionality
1596
* Mostly without function.
1599
CACRF_EnableI = (1 Shl 0);
1600
CACRF_FreezeI = (1 Shl 1);
1601
CACRF_ClearI = (1 Shl 3);
1602
CACRF_IBE = (1 Shl 4);
1603
CACRF_EnableD = (1 Shl 8);
1604
CACRF_FreezeD = (1 Shl 9);
1605
CACRF_ClearD = (1 Shl 11);
1606
CACRF_DBE = (1 Shl 12);
1607
CACRF_WriteAllocate = (1 Shl 13);
1608
CACRF_EnableE = (1 Shl 30);
1609
CACRF_CopyBack = (1 Shl 31);
1611
DMA_Continue = (1 Shl 1);
1612
DMA_NoModify = (1 Shl 2);
1613
DMA_ReadFromRAM = (1 Shl 3);
1619
SF_SAR = (1 Shl SB_SAR);
1620
SF_TQE = (1 Shl SB_TQE);
1621
SF_SINT = (1 Shl SB_SINT);
1624
{ ****** Debug Flags...(don`t depend on them) ********** }
1626
EXECDEBUGF_INITRESIDENT = $1;
1627
EXECDEBUGF_INITCODE = $2;
1628
EXECDEBUGF_FINDRESIDENT = $4;
1630
EXECDEBUGF_CREATELIBRARY = $10;
1631
EXECDEBUGF_SETFUNCTION = $20;
1632
EXECDEBUGF_NEWSETFUNCTION = $40;
1633
EXECDEBUGF_CHIPRAM = $80;
1635
EXECDEBUGF_ADDTASK = $100;
1636
EXECDEBUGF_REMTASK = $200;
1637
EXECDEBUGF_GETTASKATTR = $400;
1638
EXECDEBUGF_SETTASKATTR = $800;
1640
EXECDEBUGF_EXCEPTHANDLER = $1000;
1641
EXECDEBUGF_ADDDOSNODE = $2000;
1642
EXECDEBUGF_PCI = $4000;
1643
EXECDEBUGF_RAMLIB = $8000;
1645
EXECDEBUGF_NOLOGSERVER = $10000;
1646
EXECDEBUGF_NOLOGWINDOW = $20000;
1649
* "env:MorphOS/LogPath" contains the logfile path,
1650
* If not specified it`s using "ram:.morphoslog"
1652
EXECDEBUGF_LOGFILE = $40000;
1653
EXECDEBUGF_LOGKPRINTF = $80000;
1655
{ * Memory Tracking Flags
1657
EXECDEBUGF_PERMMEMTRACK = $100000;
1658
EXECDEBUGF_MEMTRACK = $200000;
1660
{ * CyberGuardPPC Flags
1662
EXECDEBUGF_CYBERGUARDDEADLY = $400000;
1666
EXECDEBUGF_LOADSEG = $01000000;
1667
EXECDEBUGF_UNLOADSEG = $02000000;
1668
EXECDEBUGF_PPCSTART = $04000000;
1674
* Enables debug output for cybergraphx
1677
EXECDEBUGF_CGXDEBUG = $08000000;
1680
* Should be used to control user LibInit/DevInit Debug output
1682
EXECDEBUGF_INIT = $40000000;
1685
* Should be used to control logging
1687
EXECDEBUGF_LOG = $80000000;
1692
EXECLIST_DEVICE = 0;
1693
EXECLIST_INTERRUPT = 1;
1694
EXECLIST_LIBRARY = 2;
1695
EXECLIST_MEMHANDLER = 3;
1696
EXECLIST_MEMHEADER = 4;
1698
EXECLIST_RESOURCE = 6;
1699
EXECLIST_SEMAPHORE = 7;
1704
* Execnotify hook message
1707
PExecNotifyMessage = ^TExecNotifyMessage;
1708
TExecNotifyMessage = packed record
1717
EXECNOTIFYF_REMOVE = (1 Shl 0); { * if clear, is ADD * }
1718
EXECNOTIFYF_POST = (1 Shl 1); { * if clear, is PRE * }
1722
* AddExecNodeTagList tags
1725
SAL_Dummy = (TAG_USER + 1000);
1726
SAL_Type = (SAL_Dummy + 1);
1727
SAL_Priority = (SAL_Dummy + 2);
1728
SAL_Name = (SAL_Dummy + 3);
1731
{$include utild2.inc}