execd.inc 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738
  1. {
  2. This file is part of the Free Pascal run time library.
  3. exec definitions (V50) for MorphOS/PowerPC
  4. Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved.
  5. Free Pascal conversion
  6. Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. {include emuld.inc}
  14. {$include utild1.inc}
  15. {$WARNING Ugly hack, remove this ASAP!}
  16. type
  17. PInterface = Pointer;
  18. { * exec node definitions (V50)
  19. *********************************************************************
  20. * }
  21. type
  22. PNode = ^TNode;
  23. TNode = packed record
  24. ln_Succ: PNode;
  25. ln_Pred: PNode;
  26. ln_Type: Byte;
  27. ln_Pri : ShortInt;
  28. ln_Name: PChar;
  29. end;
  30. type
  31. PMinNode = ^TMinNode;
  32. TMinNode = packed record
  33. mln_Succ: PMinNode;
  34. mln_Pred: PMinNode;
  35. end;
  36. const
  37. NT_UNKNOWN = 0;
  38. NT_TASK = 1;
  39. NT_INTERRUPT = 2;
  40. NT_DEVICE = 3;
  41. NT_MSGPORT = 4;
  42. NT_MESSAGE = 5;
  43. NT_FREEMSG = 6;
  44. NT_REPLYMSG = 7;
  45. NT_RESOURCE = 8;
  46. NT_LIBRARY = 9;
  47. NT_MEMORY = 10;
  48. NT_SOFTINT = 11;
  49. NT_FONT = 12;
  50. NT_PROCESS = 13;
  51. NT_SEMAPHORE = 14;
  52. NT_SIGNALSEM = 15;
  53. NT_BOOTNODE = 16;
  54. NT_KICKMEM = 17;
  55. NT_GRAPHICS = 18;
  56. NT_DEATHMESSAGE = 19;
  57. NT_USER = 254;
  58. NT_EXTENDED = 255;
  59. { * exec list definitions (V50)
  60. *********************************************************************
  61. * }
  62. type
  63. PList = ^TList;
  64. TList = packed record
  65. lh_Head : PNode;
  66. lh_Tail : PNode;
  67. lh_TailPred: PNode;
  68. lh_Type : Byte;
  69. lh_pad : Byte;
  70. end;
  71. type
  72. PMinList = ^TMinList;
  73. TMinList = packed record
  74. mlh_Head : PMinNode;
  75. mlh_Tail : PMinNode;
  76. mlh_TailPred: PMinNode;
  77. end;
  78. { * exec alert definitions (V50)
  79. *********************************************************************
  80. * }
  81. const
  82. ACPU_BusErr = $80000002;
  83. ACPU_AddressErr = $80000003;
  84. ACPU_InstErr = $80000004;
  85. ACPU_DivZero = $80000005;
  86. ACPU_CHK = $80000006;
  87. ACPU_TRAPV = $80000007;
  88. ACPU_PrivErr = $80000008;
  89. ACPU_Trace = $80000009;
  90. ACPU_LineA = $8000000A;
  91. ACPU_LineF = $8000000B;
  92. ACPU_Format = $8000000E;
  93. ACPU_Spurious = $80000018;
  94. ACPU_AutoVec1 = $80000019;
  95. ACPU_AutoVec2 = $8000001A;
  96. ACPU_AutoVec3 = $8000001B;
  97. ACPU_AutoVec4 = $8000001C;
  98. ACPU_AutoVec5 = $8000001D;
  99. ACPU_AutoVec6 = $8000001E;
  100. ACPU_AutoVec7 = $8000001F;
  101. AT_DeadEnd = $80000000;
  102. AT_Recovery = $00000000;
  103. AG_NoMemory = $00010000;
  104. AG_MakeLib = $00020000;
  105. AG_OpenLib = $00030000;
  106. AG_OpenDev = $00040000;
  107. AG_OpenRes = $00050000;
  108. AG_IOError = $00060000;
  109. AG_NoSignal = $00070000;
  110. AG_BadParm = $00080000;
  111. AG_CloseLib = $00090000;
  112. AG_CloseDev = $000A0000;
  113. AG_ProcCreate = $000B0000;
  114. AG_MsgPortNotEmpty = $000C0000 { * V50 * };
  115. AO_ExecLib = $00008001;
  116. AO_GraphicsLib = $00008002;
  117. AO_LayersLib = $00008003;
  118. AO_Intuition = $00008004;
  119. AO_MathLib = $00008005;
  120. AO_DOSLib = $00008007;
  121. AO_RAMLib = $00008008;
  122. AO_IconLib = $00008009;
  123. AO_ExpansionLib = $0000800A;
  124. AO_DiskfontLib = $0000800B;
  125. AO_UtilityLib = $0000800C;
  126. AO_KeyMapLib = $0000800D;
  127. AO_AudioDev = $00008010;
  128. AO_ConsoleDev = $00008011;
  129. AO_GamePortDev = $00008012;
  130. AO_KeyboardDev = $00008013;
  131. AO_TrackDiskDev = $00008014;
  132. AO_TimerDev = $00008015;
  133. AO_CIARsrc = $00008020;
  134. AO_DiskRsrc = $00008021;
  135. AO_MiscRsrc = $00008022;
  136. AO_BootStrap = $00008030;
  137. AO_Workbench = $00008031;
  138. AO_DiskCopy = $00008032;
  139. AO_GadTools = $00008033;
  140. AO_Unknown = $00008035;
  141. { *
  142. * exec.library
  143. * }
  144. const
  145. AN_ExecLib = $01000000;
  146. AN_ExcptVect = $01000001;
  147. AN_BaseChkSum = $01000002;
  148. AN_LibChkSum = $01000003;
  149. AN_MemCorrupt = $81000005;
  150. AN_IntrMem = $81000006;
  151. AN_InitAPtr = $01000007;
  152. AN_SemCorrupt = $01000008;
  153. AN_FreeTwice = $01000009;
  154. AN_BogusExcpt = $8100000A;
  155. AN_IOUsedTwice = $0100000B;
  156. AN_MemoryInsane = $0100000C;
  157. AN_IOAfterClose = $0100000D;
  158. AN_StackProbe = $0100000E;
  159. AN_BadFreeAddr = $0100000F;
  160. AN_BadSemaphore = $01000010;
  161. { *
  162. * graphics.library
  163. * }
  164. const
  165. AN_GraphicsLib = $02000000;
  166. AN_GfxNoMem = $82010000;
  167. AN_GfxNoMemMspc = $82010001;
  168. AN_LongFrame = $82010006;
  169. AN_ShortFrame = $82010007;
  170. AN_TextTmpRas = $02010009;
  171. AN_BltBitMap = $8201000A;
  172. AN_RegionMemory = $8201000B;
  173. AN_MakeVPort = $82010030;
  174. AN_GfxNewError = $0200000C;
  175. AN_GfxFreeError = $0200000D;
  176. AN_GfxNoLCM = $82011234;
  177. AN_ObsoleteFont = $02000401;
  178. { *
  179. * layers.library
  180. * }
  181. const
  182. AN_LayersLib = $03000000;
  183. AN_LayersNoMem = $83010000;
  184. { *
  185. * intuition.library
  186. * }
  187. const
  188. AN_Intuition = $04000000;
  189. AN_GadgetType = $84000001;
  190. AN_BadGadget = $04000001;
  191. AN_CreatePort = $84010002;
  192. AN_ItemAlloc = $04010003;
  193. AN_SubAlloc = $04010004;
  194. AN_PlaneAlloc = $84010005;
  195. AN_ItemBoxTop = $84000006;
  196. AN_OpenScreen = $84010007;
  197. AN_OpenScrnRast = $84010008;
  198. AN_SysScrnType = $84000009;
  199. AN_AddSWGadget = $8401000A;
  200. AN_OpenWindow = $8401000B;
  201. AN_BadState = $8400000C;
  202. AN_BadMessage = $8400000D;
  203. AN_WeirdEcho = $8400000E;
  204. AN_NoConsole = $8400000F;
  205. AN_NoISem = $04000010;
  206. AN_ISemOrder = $04000011;
  207. { *
  208. * math.library
  209. * }
  210. const
  211. AN_MathLib = $05000000;
  212. { *
  213. * dos.library
  214. * }
  215. const
  216. AN_DOSLib = $07000000;
  217. AN_StartMem = $07010001;
  218. AN_EndTask = $07000002;
  219. AN_QPktFail = $07000003;
  220. AN_AsyncPkt = $07000004;
  221. AN_FreeVec = $07000005;
  222. AN_DiskBlkSeq = $07000006;
  223. AN_BitMap = $07000007;
  224. AN_KeyFree = $07000008;
  225. AN_BadChkSum = $07000009;
  226. AN_DiskError = $0700000A;
  227. AN_KeyRange = $0700000B;
  228. AN_BadOverlay = $0700000C;
  229. AN_BadInitFunc = $0700000D;
  230. AN_FileReclosed = $0700000E;
  231. { *
  232. * ramlib.library
  233. * }
  234. const
  235. AN_RAMLib = $08000000;
  236. AN_BadSegList = $08000001;
  237. { *
  238. * icon.library
  239. * }
  240. const
  241. AN_IconLib = $09000000;
  242. { *
  243. * expansion.library
  244. * }
  245. const
  246. AN_ExpansionLib = $0A000000;
  247. AN_BadExpansionFree = $0A000001;
  248. { *
  249. * diskfont.library
  250. * }
  251. const
  252. AN_DiskfontLib = $0B000000;
  253. { *
  254. * audio.device
  255. * }
  256. const
  257. AN_AudioDev = $10000000;
  258. { *
  259. * console.device
  260. * }
  261. const
  262. AN_ConsoleDev = $11000000;
  263. AN_NoWindow = $11000001;
  264. { *
  265. * gameport.device
  266. * }
  267. const
  268. AN_GamePortDev = $12000000;
  269. { *
  270. * keyboard.device
  271. * }
  272. const
  273. AN_KeyboardDev = $13000000;
  274. { *
  275. * trackdisk.device
  276. * }
  277. const
  278. AN_TrackDiskDev = $14000000;
  279. AN_TDCalibSeek = $14000001;
  280. AN_TDDelay = $14000002;
  281. { *
  282. * timer.device
  283. * }
  284. const
  285. AN_TimerDev = $15000000;
  286. AN_TMBadReq = $15000001;
  287. AN_TMBadSupply = $15000002;
  288. { *
  289. * cia.resource
  290. * }
  291. const
  292. AN_CIARsrc = $20000000;
  293. { *
  294. * disk.resource
  295. * }
  296. const
  297. AN_DiskRsrc = $21000000;
  298. AN_DRHasDisk = $21000001;
  299. AN_DRIntNoAct = $21000002;
  300. { *
  301. * misc.resource
  302. * }
  303. const
  304. AN_MiscRsrc = $22000000;
  305. { *
  306. * bootstrap
  307. * }
  308. const
  309. AN_BootStrap = $30000000;
  310. AN_BootError = $30000001;
  311. { *
  312. * Workbench
  313. * }
  314. const
  315. AN_Workbench = $31000000;
  316. AN_NoFonts = $B1000001;
  317. AN_WBBadStartupMsg1 = $31000001;
  318. AN_WBBadStartupMsg2 = $31000002;
  319. AN_WBBadIOMsg = $31000003;
  320. AN_WBReLayoutToolMenu = $B1010009;
  321. { *
  322. * DiskCopy
  323. * }
  324. const
  325. AN_DiskCopy = $32000000;
  326. { *
  327. * toolkit for Intuition
  328. * }
  329. const
  330. AN_GadTools = $33000000;
  331. { *
  332. * System utility library
  333. * }
  334. const
  335. AN_UtilityLib = $34000000;
  336. { *
  337. * For use by any application that needs it
  338. * }
  339. const
  340. AN_Unknown = $35000000;
  341. { * exec error definitions (V50)
  342. *********************************************************************
  343. * }
  344. const
  345. IOERR_OPENFAIL = (-1);
  346. IOERR_ABORTED = (-2);
  347. IOERR_NOCMD = (-3);
  348. IOERR_BADLENGTH = (-4);
  349. IOERR_BADADDRESS = (-5);
  350. IOERR_UNITBUSY = (-6);
  351. IOERR_SELFTEST = (-7);
  352. IOERR_NOMEMORY = (-8);
  353. { * exec resident definitions (V50)
  354. *********************************************************************
  355. * }
  356. type
  357. PResident = ^TResident;
  358. TResident = packed record
  359. rt_MatchWord: Word;
  360. rt_MatchTag : PResident;
  361. rt_EndSkip : Pointer;
  362. rt_Flags : Byte;
  363. rt_Version : Byte;
  364. rt_Type : Byte;
  365. rt_Pri : Byte;
  366. rt_Name : PChar;
  367. rt_IdString : PChar;
  368. rt_Init : Pointer;
  369. { * Only valid when RTF_EXTENDED is set
  370. * }
  371. rt_Revision : Word; { * Revision Entry * }
  372. rt_Tags : Pointer;
  373. end;
  374. const
  375. RTC_MATCHWORD = $4AFC;
  376. RTF_AUTOINIT = (1 Shl 7);
  377. RTF_EXTENDED = (1 Shl 6); { * structure extension is valid * }
  378. { * rt_Init points to a PPC function which must be defined as
  379. *
  380. * struct Library* LIB_Init(struct Library *MyLibBase,
  381. * BPTR SegList,
  382. * struct ExecBase *SysBase)
  383. * }
  384. RTF_PPC = (1 Shl 3);
  385. RTF_AFTERDOS = (1 Shl 2);
  386. RTF_SINGLETASK = (1 Shl 1);
  387. RTF_COLDSTART = (1 Shl 0);
  388. RTW_NEVER = 0;
  389. RTW_COLDSTART = 1;
  390. { * exec memory definitions (V50)
  391. *********************************************************************
  392. * }
  393. type
  394. PMemChunk = ^TMemChunk;
  395. TMemChunk = packed record
  396. nc_Next : PMemChunk;
  397. nc_Bytes: DWord;
  398. end;
  399. type
  400. PMemHeader = ^TMemHeader;
  401. TMemHeader = packed record
  402. mh_Node : TNode;
  403. mh_Attributes: Word;
  404. mh_First : PMemChunk;
  405. mh_Lower : Pointer;
  406. mh_Upper : Pointer;
  407. mh_Free : DWord;
  408. end;
  409. type
  410. PMemEntry = ^TMemEntry;
  411. TMemEntry = packed record
  412. me_Un: packed record
  413. case Byte of
  414. 0 : (meu_Regs: DWord);
  415. 1 : (meu_Addr: Pointer)
  416. end;
  417. me_Length: DWord;
  418. end;
  419. type
  420. PMemList = ^TMemList;
  421. TMemList = packed record
  422. ml_Node : TNode;
  423. ml_NumEntries: Word;
  424. ml_ME : PMemEntry;
  425. end;
  426. const
  427. MEMF_ANY = 0;
  428. MEMF_PUBLIC = (1 Shl 0);
  429. MEMF_CHIP = (1 Shl 1);
  430. MEMF_FAST = (1 Shl 2);
  431. MEMF_LOCAL = (1 Shl 8);
  432. MEMF_24BITDMA = (1 Shl 9);
  433. MEMF_KICK = (1 Shl 10);
  434. MEMF_SWAP = (1 Shl 11); { * Memory that can be swapped out to disk * }
  435. MEMF_CLEAR = (1 Shl 16);
  436. MEMF_LARGEST = (1 Shl 17);
  437. MEMF_REVERSE = (1 Shl 18);
  438. MEMF_TOTAL = (1 Shl 19);
  439. MEMF_SEM_PROTECTED = (1 Shl 20); { * Pools: semaphore protection * }
  440. MEMF_NO_EXPUNGE = (1 Shl 31);
  441. MEM_BLOCKSIZE = 8;
  442. MEM_BLOCKMASK = (MEM_BLOCKSIZE - 1);
  443. type
  444. PMemHandlerData = ^TMemHandlerData;
  445. TMemHandlerData = packed record
  446. memh_RequestSize : DWord;
  447. memh_RequestFlags: DWord;
  448. memh_Flags : DWord;
  449. end;
  450. const
  451. MEMHF_RECYCLE = (1 Shl 0);
  452. MEM_DID_NOTHING = 0;
  453. MEM_ALL_DONE = -1;
  454. MEM_TRY_AGAIN = 1;
  455. { * exec port definitions (V50)
  456. *********************************************************************
  457. * }
  458. type
  459. PMsgPort = ^TMsgPort;
  460. TMsgPort = packed record
  461. mp_Node : TNode;
  462. mp_Flags : Byte;
  463. mp_SigBit : Byte;
  464. mp_SigTask: Pointer;
  465. mp_MsgList: TList;
  466. end;
  467. const
  468. PF_ACTION = 3;
  469. PA_SIGNAL = 0;
  470. PA_SOFTINT = 1;
  471. PA_IGNORE = 2;
  472. type
  473. PMessage = ^TMessage;
  474. TMessage = packed record
  475. mn_Node : TNode;
  476. mn_ReplyPort: PMsgPort;
  477. mn_Length : Word;
  478. end;
  479. { * exec task definitions (V50)
  480. *********************************************************************
  481. * }
  482. type
  483. PTask = ^TTask;
  484. TTask = packed record
  485. tc_Node : TNode;
  486. tc_Flags : Byte;
  487. tc_State : Byte;
  488. tc_IDNestCnt: ShortInt;
  489. tc_TDNestCnt: ShortInt;
  490. tc_SigAlloc : DWord;
  491. tc_SigWait : DWord;
  492. tc_SigRecvd : DWord;
  493. tc_SigExcept: DWord;
  494. {$IF 0}
  495. tc_TrapAlloc: Word;
  496. tc_TrapAble : Word;
  497. {$ELSE}
  498. tc_ETask: Pointer;
  499. {$ENDIF}
  500. tc_ExceptData: Pointer;
  501. tc_ExceptCode: Pointer;
  502. tc_TrapData : Pointer;
  503. tc_TrapCode : Pointer;
  504. tc_SPReg : Pointer;
  505. tc_SPLower : Pointer;
  506. tc_SPUpper : Pointer;
  507. tc_Switch : Pointer; { *** OBSOLETE *** }
  508. tc_Launch : Pointer; { *** OBSOLETE *** }
  509. tc_MemEntry : TList;
  510. tc_UserData : Pointer;
  511. end;
  512. const
  513. TB_PROCTIME = 0;
  514. TB_ETASK = 3;
  515. TB_STACKCHK = 4;
  516. TB_EXCEPT = 5;
  517. TB_SWITCH = 6;
  518. TB_LAUNCH = 7;
  519. TF_PROCTIME = (1 Shl TB_PROCTIME);
  520. TF_ETASK = (1 Shl TB_ETASK);
  521. TF_STACKCHK = (1 Shl TB_STACKCHK);
  522. TF_EXCEPT = (1 Shl TB_EXCEPT);
  523. TF_SWITCH = (1 Shl TB_SWITCH);
  524. TF_LAUNCH = (1 Shl TB_LAUNCH);
  525. TS_INVALID = 0;
  526. TS_ADDED = 1;
  527. TS_RUN = 2;
  528. TS_READY = 3;
  529. TS_WAIT = 4;
  530. TS_EXCEPT = 5;
  531. TS_REMOVED = 6;
  532. SIGB_ABORT = 0;
  533. SIGB_CHILD = 1;
  534. SIGB_BLIT = 4;
  535. SIGB_SINGLE = 4;
  536. SIGB_INTUITION = 5;
  537. SIGB_NET = 7;
  538. SIGB_DOS = 8;
  539. SIGF_ABORT = (1 Shl SIGB_ABORT);
  540. SIGF_CHILD = (1 Shl SIGB_CHILD);
  541. SIGF_BLIT = (1 Shl SIGB_BLIT);
  542. SIGF_SINGLE = (1 Shl SIGB_SINGLE);
  543. SIGF_INTUITION = (1 Shl SIGB_INTUITION);
  544. SIGF_NET = (1 Shl SIGB_NET);
  545. SIGF_DOS = (1 Shl SIGB_DOS);
  546. type
  547. PTaskTrapMessage = ^TTaskTrapMessage;
  548. TTaskTrapMessage = packed record
  549. Message: TMessage; { * Message Header * }
  550. Task : TTask; { * connected Task * }
  551. Version: DWord; { * version of the structure * }
  552. TType : DWord; { * Exception Type * }
  553. DAR : DWord; { * Exception Address Register * }
  554. DSISR : DWord; { * Exception DSISR Reg * }
  555. { * This is undiscovered land...
  556. * never assume a size of this structure
  557. * }
  558. end;
  559. const
  560. VERSION_TASKTRAPMESSAGE = $0;
  561. type
  562. PETask = ^TETask;
  563. TETask = packed record
  564. Message : TMessage;
  565. Parent : PTask;
  566. UniqueID : DWord;
  567. Children : TMinList;
  568. TrapAlloc: Word;
  569. TrapAble : Word;
  570. Result1 : DWord;
  571. Result2 : Pointer;
  572. MsgPort : TMsgPort;
  573. { * Don't touch!!!!!!!!!..there'll be an interface
  574. * sooner than later.
  575. * New Entries...most of the above entries
  576. * are only their for structure compatability.
  577. * They have no meaning as the OS never supported
  578. * them.
  579. * }
  580. { * A Task Pool for the task.
  581. * }
  582. MemPool: Pointer;
  583. { * PPC's Stack Lower Ptr
  584. * The initial stack is allocated through
  585. * AllocVec, so a FreeVec(ETask^.PPCSPLower);
  586. * would work.
  587. * If you use PPCStackSwap you must allocate
  588. * your stack block with AllocVec();
  589. * }
  590. PPCSPLower: Pointer;
  591. { * PPC's Stack Upper Ptr
  592. * }
  593. PPCSPUpper : Pointer;
  594. PPCRegFrame: Pointer;
  595. PPCLibData : Pointer;
  596. { * On a PPC exception this msgport
  597. * is sent an exception msg...
  598. * the task is stopped until somebody
  599. * wakes it up again.
  600. * (asynchron exception interface)
  601. * If this Port is NULL the message is
  602. * sent to SysBase->ex_PPCTrapMsgPort.
  603. * }
  604. PPCTrapMsgPort: PMsgPort;
  605. PPCTrapMessage: PTaskTrapMessage;
  606. { * This is undiscovered land...
  607. * never assume a size of this structure
  608. * }
  609. end;
  610. type
  611. PTaskInitExtension = ^TTaskInitExtension;
  612. TTaskInitExtension = packed record
  613. { * Must be filled with TRAP_PPCTASK
  614. * }
  615. Trap : Word;
  616. Extension: Word; { * Must be set to 0 * }
  617. Tags : Pointer;
  618. end;
  619. const
  620. TASKTAG_DUMMY = (TAG_USER + $100000);
  621. { * Ptr to an ULONG Errorfield where a better error description
  622. * can be stored.
  623. * }
  624. TASKTAG_ERROR = (TASKTAG_DUMMY + $0);
  625. { * Code type
  626. * can be stored.
  627. * }
  628. TASKTAG_CODETYPE = (TASKTAG_DUMMY + $1);
  629. { * Start PC
  630. * code must be of TASKTAG_CODETYPE
  631. * }
  632. TASKTAG_PC = (TASKTAG_DUMMY + $2);
  633. { * Final PC
  634. * code must be of TASKTAG_CODETYPE
  635. * }
  636. TASKTAG_FINALPC = (TASKTAG_DUMMY + $3);
  637. { * Stacksize...Default 8192
  638. * }
  639. TASKTAG_STACKSIZE = (TASKTAG_DUMMY + $4);
  640. { * Std Stacksize...
  641. * Default(use the stack defined by tc_SPLower..tc_SPUpper)
  642. * }
  643. TASKTAG_STACKSIZE_M68K = (TASKTAG_DUMMY + $5);
  644. { * specify task name, name is copied
  645. * }
  646. TASKTAG_NAME = (TASKTAG_DUMMY + $6);
  647. { * tc_UserData
  648. * }
  649. TASKTAG_USERDATA = (TASKTAG_DUMMY + $7);
  650. { * Task priority
  651. * }
  652. TASKTAG_PRI = (TASKTAG_DUMMY + $8);
  653. { * Pool's Puddlesize
  654. * }
  655. TASKTAG_POOLPUDDLE = (TASKTAG_DUMMY + $9);
  656. { * Pool's ThreshSize
  657. * }
  658. TASKTAG_POOLTHRESH = (TASKTAG_DUMMY + $a);
  659. { * PPC First Argument..gpr3
  660. * }
  661. TASKTAG_PPC_ARG1 = (TASKTAG_DUMMY + $10);
  662. { * PPC First Argument..gpr4
  663. * }
  664. TASKTAG_PPC_ARG2 = (TASKTAG_DUMMY + $11);
  665. { * PPC First Argument..gpr5
  666. * }
  667. TASKTAG_PPC_ARG3 = (TASKTAG_DUMMY + $12);
  668. { * PPC First Argument..gpr6
  669. * }
  670. TASKTAG_PPC_ARG4 = (TASKTAG_DUMMY + $13);
  671. { * PPC First Argument..gpr7
  672. * }
  673. TASKTAG_PPC_ARG5 = (TASKTAG_DUMMY + $14);
  674. { * PPC First Argument..gpr8
  675. * }
  676. TASKTAG_PPC_ARG6 = (TASKTAG_DUMMY + $15);
  677. { * PPC First Argument..gpr9
  678. * }
  679. TASKTAG_PPC_ARG7 = (TASKTAG_DUMMY + $16);
  680. { * PPC First Argument..gpr10
  681. * }
  682. TASKTAG_PPC_ARG8 = (TASKTAG_DUMMY + $17);
  683. { *
  684. * Startup message to be passed to task/process, ReplyMsg'd at RemTask()
  685. * ti_Data: struct Message *
  686. * }
  687. TASKTAG_STARTUPMSG = (TASKTAG_DUMMY + $18);
  688. { *
  689. * Create internal MsgPort for task/process, deleted at RemTask()
  690. * ti_Data: struct MsgPort **, can be NULL
  691. * }
  692. TASKTAG_TASKMSGPORT = (TASKTAG_DUMMY + $19);
  693. const
  694. CODETYPE_M68K = $0;
  695. { *
  696. * System V4 ABI
  697. * }
  698. CODETYPE_PPC = $1;
  699. const
  700. TASKERROR_OK = 0;
  701. TASKERROR_NOMEMORY = 1;
  702. { *
  703. * Stack swap structure as passed to StackSwap() and PPCStackSwap()
  704. * }
  705. type
  706. PStackSwapStruct = ^TStackSwapStruct;
  707. TStackSwapStruct = packed record
  708. stk_Lower : Pointer; { * Lowest byte of stack * }
  709. stk_Upper : Pointer; { * Upper end of stack (size + Lowert) * }
  710. stk_Pointer: Pointer; { * Stack pointer at switch point * }
  711. end;
  712. type
  713. PPPCStackSwapArgs = ^TPPCStackSwapArgs;
  714. TPPCStackSwapArgs = packed record
  715. Args: Array[0..7] Of DWord; { * The C register arguments from gpr3..gpr11 * }
  716. end;
  717. { *
  718. * NewGetTaskAttrsA(), NewSetTaskAttrsA() tags
  719. * }
  720. const
  721. TASKINFOTYPE_ALLTASK = $0;
  722. TASKINFOTYPE_NAME = $1;
  723. TASKINFOTYPE_PRI = $2;
  724. TASKINFOTYPE_TYPE = $3;
  725. TASKINFOTYPE_STATE = $4;
  726. TASKINFOTYPE_FLAGS = $5;
  727. TASKINFOTYPE_SIGALLOC = $6;
  728. TASKINFOTYPE_SIGWAIT = $7;
  729. TASKINFOTYPE_SIGRECVD = $8;
  730. TASKINFOTYPE_SIGEXCEPT = $9;
  731. TASKINFOTYPE_EXCEPTDATA = $a;
  732. TASKINFOTYPE_EXCEPTCODE = $b;
  733. TASKINFOTYPE_TRAPDATA = $c;
  734. TASKINFOTYPE_TRAPCODE = $d;
  735. TASKINFOTYPE_STACKSIZE_M68K = $e;
  736. TASKINFOTYPE_STACKSIZE = $f;
  737. TASKINFOTYPE_USEDSTACKSIZE_M68K = $10;
  738. TASKINFOTYPE_USEDSTACKSIZE = $11;
  739. TASKINFOTYPE_TRAPMSGPORT = $12;
  740. TASKINFOTYPE_STARTUPMSG = $13;
  741. TASKINFOTYPE_TASKMSGPORT = $14;
  742. TASKINFOTYPE_POOLPTR = $15;
  743. TASKINFOTYPE_POOLMEMFLAGS = $16;
  744. TASKINFOTYPE_POOLPUDDLESIZE = $17;
  745. TASKINFOTYPE_POOLTHRESHSIZE = $18;
  746. { *
  747. * Task Scheduler statistics (exec 50.42)
  748. * }
  749. TASKINFOTYPE_NICE = $19;
  750. TASKINFOTYPE_AGETICKS = $1a;
  751. TASKINFOTYPE_CPUTIME = $1b;
  752. TASKINFOTYPE_LASTSECCPUTIME = $1c;
  753. TASKINFOTYPE_RECENTCPUTIME = $1d;
  754. TASKINFOTYPE_VOLUNTARYCSW = $1e;
  755. TASKINFOTYPE_INVOLUNTARYCSW = $1f;
  756. TASKINFOTYPE_LASTSECVOLUNTARYCSW = $20;
  757. TASKINFOTYPE_LASTSECINVOLUNTARYCSW = $21;
  758. { * Added in exec 50.45 * }
  759. TASKINFOTYPE_LAUNCHTIMETICKS = $22;
  760. TASKINFOTYPE_LAUNCHTIMETICKS1978 = $23;
  761. TASKINFOTYPE_PID = $24;
  762. TASKINFOTYPE_68K_NEWFRAME = $50;
  763. TASKINFOTYPE_PPC_SRR0 = $100;
  764. TASKINFOTYPE_PPC_SRR1 = $101;
  765. TASKINFOTYPE_PPC_LR = $102;
  766. TASKINFOTYPE_PPC_CTR = $103;
  767. TASKINFOTYPE_PPC_CR = $104;
  768. TASKINFOTYPE_PPC_XER = $105;
  769. TASKINFOTYPE_PPC_GPR = $106;
  770. TASKINFOTYPE_PPC_FPR = $107;
  771. TASKINFOTYPE_PPC_FPSCR = $108;
  772. TASKINFOTYPE_PPC_VSCR = $109;
  773. TASKINFOTYPE_PPC_VMX = $10a;
  774. TASKINFOTYPE_PPC_VSAVE = $10b;
  775. TASKINFOTYPE_PPC_FRAME = $10c;
  776. TASKINFOTYPE_PPC_FRAMESIZE = $10d;
  777. TASKINFOTYPE_PPC_NEWFRAME = $10e;
  778. TASKINFOTAG_DUMMY = (TAG_USER + $110000);
  779. { * Used with TASKINFOTYPE_ALLTASK
  780. * }
  781. TASKINFOTAG_HOOK = (TASKINFOTAG_DUMMY + $0);
  782. { * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX
  783. * to define the copy area
  784. * }
  785. TASKINFOTAG_REGSTART = (TASKINFOTAG_DUMMY + $1);
  786. { * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX
  787. * to define the copy area
  788. * }
  789. TASKINFOTAG_REGCOUNT = (TASKINFOTAG_DUMMY + $2);
  790. { *
  791. * NewSetTaskAttrsA(..,@TaskFrame68k,sizeof(TTaskFrame68k),TASKINFOTYPE_68K_NEWFRAME,...);
  792. * }
  793. type
  794. PTaskFrame68k = ^TTaskFrame68k;
  795. TTaskFrame68k = packed record
  796. PC: Pointer;
  797. SR: Word;
  798. Xn: Array[0..14] Of LongInt;
  799. end;
  800. { *
  801. * Don't depend on these
  802. * }
  803. const
  804. DEFAULT_PPCSTACKSIZE = 32768;
  805. DEFAULT_M68KSTACKSIZE = 2048;
  806. DEFAULT_TASKPUDDLESIZE = 4096;
  807. DEFAULT_TASKTHRESHSIZE = 4096;
  808. { * exec interrupt definitions (V50)
  809. *********************************************************************
  810. * }
  811. type
  812. PInterrupt = ^TInterrupt;
  813. TInterrupt = packed record
  814. is_Node: TNode;
  815. is_Data: Pointer;
  816. is_Code: Pointer;
  817. end;
  818. type
  819. PIntVector = ^TIntVector;
  820. TIntVector = packed record
  821. iv_Data: Pointer;
  822. iv_Code: Pointer;
  823. iv_Node: PNode;
  824. end;
  825. type
  826. PSoftIntList = ^TSoftIntList;
  827. TSoftIntList = packed record
  828. sh_List: TList;
  829. sh_Pad : Word;
  830. end;
  831. const
  832. SIH_PRIMASK = $f0;
  833. INTB_NMI = 15;
  834. INTF_NMI = (1 Shl INTB_NMI);
  835. { * exec semaphore definitions (V50)
  836. *********************************************************************
  837. * }
  838. { *
  839. * Shouldn't be available public..
  840. * }
  841. type
  842. PSemaphoreRequest = ^TSemaphoreRequest;
  843. TSemaphoreRequest = packed record
  844. sr_Link : TMinNode;
  845. sr_Waiter: PTask;
  846. end;
  847. type
  848. PSignalSemaphore = ^TSignalSemaphore;
  849. TSignalSemaphore = packed record
  850. ss_Link : TNode;
  851. ss_NestCount : SmallInt;
  852. ss_WaitQueue : TMinList;
  853. ss_MultipleLink: TSemaphoreRequest;
  854. ss_Owner : PTask;
  855. ss_QueueCount : SmallInt;
  856. end;
  857. type
  858. PSemaphoreMessage = ^TSemaphoreMessage;
  859. TSemaphoreMessage = packed record
  860. ssm_Message : TMessage;
  861. ssm_Semaphore: PSignalSemaphore;
  862. end;
  863. const
  864. SM_SHARED = 1;
  865. SM_EXCLUSIVE = 0;
  866. { * exec machine definitions (V50)
  867. *********************************************************************
  868. * }
  869. const
  870. MACHINE_M68k = $0;
  871. MACHINE_PPC = $1;
  872. MACHINE_NO = $ffffffff;
  873. { * exec library definitions (V50)
  874. *********************************************************************
  875. * }
  876. const
  877. LIB_VECTSIZE = 6;
  878. LIB_RESERVED = 4;
  879. LIB_BASE = (-LIB_VECTSIZE);
  880. LIB_USERDEF = (LIB_BASE - (LIB_RESERVED * LIB_VECTSIZE));
  881. LIB_NONSTD = (LIB_USERDEF);
  882. LIB_OPEN = -6;
  883. LIB_CLOSE = -12;
  884. LIB_EXPUNGE = -18;
  885. LIB_EXTFUNC = -24;
  886. LIB_GETQUERYATTR = -24; { * LIBF_QUERY * }
  887. type
  888. PLibrary = ^TLibrary;
  889. TLibrary = packed record
  890. lib_Node : TNode;
  891. lib_Flags : Byte;
  892. lib_pad : Byte;
  893. lib_MegSize : Word;
  894. lib_PosSize : Word;
  895. lib_Version : Word;
  896. lib_Revision: Word;
  897. lib_IdString: PChar;
  898. lib_Sum : DWord;
  899. lib_OpenCnt : Word;
  900. end;
  901. const
  902. LIBF_SUMMING = (1 Shl 0);
  903. LIBF_CHANGED = (1 Shl 1);
  904. LIBF_SUMUSED = (1 Shl 2);
  905. LIBF_DELEXP = (1 Shl 3);
  906. { *
  907. * private
  908. * }
  909. LIBF_RAMLIB = (1 Shl 4);
  910. { *
  911. * Needs to be set if the GetQueryAttr function is legal
  912. * }
  913. LIBF_QUERYINFO = (1 Shl 5);
  914. { *
  915. * The remaining bits are reserved and aren`t allowed to be touched
  916. * }
  917. { * NewSetFunction extensions
  918. * }
  919. const
  920. SETFUNCTAG_Dummy = (TAG_USER +$01000000);
  921. { * Set the machine type of the function
  922. * Default is 68k
  923. * }
  924. SETFUNCTAG_MACHINE = (SETFUNCTAG_Dummy + $1);
  925. { * Function type specifier
  926. * }
  927. SETFUNCTAG_TYPE = (SETFUNCTAG_Dummy + $2);
  928. { * ID String
  929. * }
  930. SETFUNCTAG_IDNAME = (SETFUNCTAG_Dummy + $3);
  931. { *
  932. * Set to TRUE if the replaced function will never be used
  933. * again.
  934. * }
  935. SETFUNCTAG_DELETE = (SETFUNCTAG_Dummy + $4);
  936. { * See emul/emulinterface.h for more informations
  937. * }
  938. { * Save Emulation PPC Registers
  939. * Call Function
  940. * Restore Emulation PPC Registers
  941. * REG_D0 = Result
  942. * }
  943. const
  944. SETFUNCTYPE_NORMAL = 0;
  945. { * Call Function
  946. * Must use the global register settings of the emulation
  947. * REG_D0 = Result
  948. * }
  949. SETFUNCTYPE_QUICK = 1;
  950. { * Save Emulation PPC Registers
  951. * Call Function
  952. * Restore Emulation PPC Registers
  953. * No Result
  954. * Needed to replace functions like
  955. * forbid,obtainsemaphores which are
  956. * defined as trashing no registers
  957. * }
  958. SETFUNCTYPE_NORMALNR = 2;
  959. { * Call Function
  960. * Must use the global register settings of the emulation
  961. * No Result
  962. * Needed to replace functions like
  963. * forbid,obtainsemaphores which are
  964. * defined as trashing no registers
  965. * }
  966. SETFUNCTYPE_QUICKNR = 3;
  967. SETFUNCTYPE_NORMALSR = 4;
  968. SETFUNCTYPE_NORMALSRNR = 5;
  969. SETFUNCTYPE_NORMALD0_D1 = 6;
  970. SETFUNCTYPE_NORMALRESTORE = 7;
  971. SETFUNCTYPE_SYSTEMV = 8;
  972. SETFUNCTYPE_NORMALD0D1SR = 9;
  973. SETFUNCTYPE_NORMALD0D1A0A1SR = 10;
  974. { * CreateLibrary extensions
  975. * }
  976. LIBTAG_BASE = (TAG_USER + $01000100);
  977. { *
  978. * Function/Vector Array
  979. * }
  980. LIBTAG_FUNCTIONINIT = (LIBTAG_BASE+$0);
  981. { *
  982. * Struct Init
  983. * }
  984. LIBTAG_STRUCTINIT = (LIBTAG_BASE+$1);
  985. { *
  986. * Library Init
  987. * }
  988. LIBTAG_LIBRARYINIT = (LIBTAG_BASE+$2);
  989. { *
  990. * Init Code Type
  991. * }
  992. LIBTAG_MACHINE = (LIBTAG_BASE+$3);
  993. { *
  994. * Library Base Size
  995. * }
  996. LIBTAG_BASESIZE = (LIBTAG_BASE+$4);
  997. { *
  998. * SegList Ptr
  999. * }
  1000. LIBTAG_SEGLIST = (LIBTAG_BASE+$5);
  1001. { *
  1002. * Library Priority
  1003. * }
  1004. LIBTAG_PRI = (LIBTAG_BASE+$6);
  1005. { *
  1006. * Library Type..Library,Device,Resource,whatever
  1007. * }
  1008. LIBTAG_TYPE = (LIBTAG_BASE+$7);
  1009. { *
  1010. * Library Version
  1011. * (UWORD)
  1012. * }
  1013. LIBTAG_VERSION = (LIBTAG_BASE+$8);
  1014. { *
  1015. * Library Flags
  1016. * }
  1017. LIBTAG_FLAGS = (LIBTAG_BASE+$9);
  1018. { *
  1019. * Library Name
  1020. * }
  1021. LIBTAG_NAME = (LIBTAG_BASE+$a);
  1022. { *
  1023. * Library IDString
  1024. * }
  1025. LIBTAG_IDSTRING = (LIBTAG_BASE+$b);
  1026. { *
  1027. * AddDevice(),AddLibrary(),AddResource()..
  1028. * depends on LibNode.ln_Type field which
  1029. * can be set by some Init function, Struct Scripts
  1030. * or LIBTAG_TYPE.
  1031. * If you set LIBTAG_PUBLIC the library
  1032. * is added to the right system list.
  1033. * }
  1034. LIBTAG_PUBLIC = (LIBTAG_BASE+$c);
  1035. { *
  1036. * Library Revision
  1037. * (UWORD)
  1038. * }
  1039. LIBTAG_REVISION = (LIBTAG_BASE+$d);
  1040. { *
  1041. * Library QueryInfo Flag
  1042. * (Boolean)
  1043. * }
  1044. LIBTAG_QUERYINFO = (LIBTAG_BASE+$e);
  1045. { * Private
  1046. * don`t touch...floating design
  1047. * }
  1048. {
  1049. type
  1050. PFuncEntry = ^TFuncEntry;
  1051. TFuncEntry = packed record
  1052. EmulLibEntry : TEmulLibEntry;
  1053. OldFunction : Pointer; { * Needed for bookkeeping * }
  1054. end;
  1055. PFuncOldEntry = ^TFuncOldEntry;
  1056. TFuncOldEntry = packed record
  1057. Command : Word;
  1058. FuncEntry: PFuncEntry;
  1059. end;
  1060. }
  1061. { *
  1062. * EmulLibEntry.Extension
  1063. * }
  1064. const
  1065. FUNCENTRYEXTF_LIBRARY = $1; { * Entry created by the OS * }
  1066. { *
  1067. * Functionarray first ULONG ID defines the format
  1068. * of the functionarray for MakeFunctions()/MakeLibrary().
  1069. *
  1070. * If there`s not such id the functionarray is a
  1071. * 32Bit 68k function ptr array.
  1072. * (ULONG) $ffffffff stops it
  1073. * }
  1074. { * 68k 16bit relative functionarray ptrs
  1075. * (UWORD) $ffff stops it
  1076. * }
  1077. FUNCARRAY_16BIT_OLD = $ffffffff;
  1078. { * PPC 32bit functionarray ptrs
  1079. * (ULONG) $ffff stops it
  1080. * }
  1081. FUNCARRAY_32BIT_NATIVE = $fffefffe;
  1082. { * Starts a functionarray block.
  1083. * This way it`s possible to mix 68k and PPC
  1084. * function definitions.
  1085. * BASE:
  1086. * FUNCTIONARRAY_BEGIN
  1087. * FUNCARRAY_32BIT_NATIVE
  1088. * FUNC0
  1089. * FUNC1
  1090. * .
  1091. * FUNCn
  1092. * $ffffffff
  1093. * FUNCn+1 (No ID->32Bit 68k)
  1094. * FUNCn+2
  1095. * .
  1096. * FUNCm
  1097. * $ffffffff
  1098. * FUNCARRAY_16BIT_OLD
  1099. * FUNCm+1-BASE
  1100. * FUNCm+2-BASE
  1101. * .
  1102. * FUNCo-BASE
  1103. * $ffff
  1104. * FUNCTIONARRAY_END
  1105. * }
  1106. FUNCARRAY_BEGIN = $fffdfffd;
  1107. { * Ends a functionarray block.
  1108. * }
  1109. FUNCARRAY_END = $fffcfffc;
  1110. { * PPC 32bit Quick functionarray ptrs.
  1111. * These functions must comply to the emulation's
  1112. * register layout which is defined inside the
  1113. * emul/emulregs.h. That means the register layout
  1114. * MUST also be valid during interrupts/task switches.
  1115. * You can't just destroy A7(r31), SR or PC.
  1116. *
  1117. * You shouldn't use this for any normal code
  1118. * as there's no real reason to do so. If you
  1119. * really think you need to use it please ask
  1120. * us first on the dev mailinglist.
  1121. * (ULONG) $ffffffff stops it
  1122. * }
  1123. FUNCARRAY_32BIT_QUICK_NATIVE = $fffbfffb;
  1124. { * PPC 32bit QuickNR(No Result) functionarray ptrs
  1125. * (ULONG) $ffffffff stops it
  1126. * }
  1127. FUNCARRAY_32BIT_QUICKNR_NATIVE = $fffafffa;
  1128. { * PPC 32bit no result functionarray ptrs
  1129. * (ULONG) $ffffffff stops it
  1130. * }
  1131. FUNCARRAY_32BIT_NR_NATIVE = $fff9fff9;
  1132. { * PPC 32bit SR functionarray ptrs
  1133. * (ULONG) $ffffffff stops it
  1134. * }
  1135. FUNCARRAY_32BIT_SR_NATIVE = $fff8fff8;
  1136. { * PPC 32bit SR(no result) functionarray ptrs
  1137. * (ULONG) $ffffffff stops it
  1138. * }
  1139. FUNCARRAY_32BIT_SRNR_NATIVE = $fff7fff7;
  1140. { * PPC 32bit D0_D1 functionarray ptrs
  1141. * (ULONG) $ffffffff stops it
  1142. * }
  1143. FUNCARRAY_32BIT_D0D1_NATIVE = $fff6fff6;
  1144. { * PPC 32bit Restore1 functionarray ptrs
  1145. * (ULONG) $ffffffff stops it
  1146. * }
  1147. FUNCARRAY_32BIT_RESTORE_NATIVE = $fff5fff5;
  1148. { * PPC 32bit SystemV ABI entry
  1149. * these function entries DON'T comply
  1150. * to the amiga register modell REG_D0-A6
  1151. * but comply to the PPC SystemV ABI so
  1152. * you can directly use PPC C Argument
  1153. * parsing. That way you're also not limited
  1154. * with the register count.
  1155. * Such library functions can't be used
  1156. * by 68k emulation, so you can only use
  1157. * them for new code.
  1158. * As we allow these new functions to be
  1159. * used with old functions we keep the
  1160. * 6 bytes function entry steps in the library.
  1161. * Layout is
  1162. *
  1163. * CODE_JMP, &FuncEntry ; Old Entry
  1164. * CODE_ILLEGAL, Function ; SystemV ABI Entry
  1165. *
  1166. *
  1167. * (ULONG) $ffffffff stops it
  1168. * }
  1169. FUNCARRAY_32BIT_SYSTEMV = $fff4fff4;
  1170. { * PPC 32bit D0D1SR functionarray ptrs
  1171. * (ULONG) $ffffffff stops it
  1172. * }
  1173. FUNCARRAY_32BIT_D0D1SR_NATIVE = $fff3fff3;
  1174. { * PPC 32bit D0D1A0A1SR functionarray ptrs
  1175. * (ULONG) $ffffffff stops it
  1176. * }
  1177. FUNCARRAY_32BIT_D0D1A0A1SR_NATIVE = $fff2fff2;
  1178. { * exec device definitions (V50)
  1179. *********************************************************************
  1180. * }
  1181. type
  1182. PDevice = ^TDevice;
  1183. TDevice = packed record
  1184. dd_Library: TLibrary;
  1185. end;
  1186. type
  1187. PUnit = ^TUnit;
  1188. TUnit = packed record
  1189. unit_MsgPort: TMsgPort;
  1190. unit_flags : Byte;
  1191. unit_pad : Byte;
  1192. unit_OpenCnt: Word;
  1193. end;
  1194. const
  1195. UNITF_ACTIVE = (1 Shl 0);
  1196. UNITF_INTASK = (1 Shl 1);
  1197. { * exec io definitions (V50)
  1198. *********************************************************************
  1199. * }
  1200. type
  1201. PIORequest = ^TIORequest;
  1202. TIORequest = packed record
  1203. io_Message: TMessage;
  1204. io_Device : PDevice;
  1205. io_Unit : PUnit;
  1206. io_Command: Word;
  1207. io_Flags : Byte;
  1208. io_Error : ShortInt;
  1209. end;
  1210. type
  1211. PIOStdReq = ^TIOStdReq;
  1212. TIOStdReq = packed record
  1213. io_Message: TMessage;
  1214. io_Device : PDevice;
  1215. io_Unit : PUnit;
  1216. io_Command: Word;
  1217. io_Flags : Byte;
  1218. io_Error : ShortInt;
  1219. io_Actual : DWord;
  1220. io_Length : DWord;
  1221. io_Data : Pointer;
  1222. io_Offset : DWord;
  1223. end;
  1224. const
  1225. DEV_BEGINIO = -30;
  1226. DEV_ABORTIO = -36;
  1227. IOB_QUICK = 0;
  1228. IOF_QUICK = (1 Shl IOB_QUICK);
  1229. CMD_INVALID = 0;
  1230. CMD_RESET = 1;
  1231. CMD_READ = 2;
  1232. CMD_WRITE = 3;
  1233. CMD_UPDATE = 4;
  1234. CMD_CLEAR = 5;
  1235. CMD_STOP = 6;
  1236. CMD_START = 7;
  1237. CMD_FLUSH = 8;
  1238. CMD_NONSTD = 9;
  1239. { * exec include (V50)
  1240. *********************************************************************
  1241. * }
  1242. type
  1243. PExecBase = ^TExecBase;
  1244. TExecBase = packed record
  1245. LIbNode : TLibrary;
  1246. SoftVer : Word;
  1247. LowMemChkSum: SmallInt;
  1248. ChkBase : DWord;
  1249. ColdCapture : Pointer;
  1250. CoolCapture : Pointer;
  1251. WarmCapture : Pointer;
  1252. SysStkUpper : Pointer;
  1253. SysStkLower : Pointer;
  1254. MaxLocMem : DWord;
  1255. DebugEntry : Pointer;
  1256. DebugData : Pointer;
  1257. AlertData : Pointer;
  1258. MaxExtMem : Pointer;
  1259. ChkSum : Word;
  1260. IntVects : Array[0..15] Of TIntVector;
  1261. ThisTask : PTask;
  1262. IdleCount : DWord;
  1263. DispCount : DWord;
  1264. Quantum : Word;
  1265. Elapsed : Word;
  1266. SysFlags : Word;
  1267. IDNestCnt : ShortInt;
  1268. TDNestCnt : ShortInt;
  1269. AttnFlags : Word;
  1270. AttnResched : Word;
  1271. ResModules : Pointer;
  1272. TaskTrapCode : Pointer;
  1273. TaskExceptCode: Pointer;
  1274. TaskExitCode : Pointer;
  1275. TaskSigAlloc : DWord;
  1276. TaskTrapAlloc : Word;
  1277. MemList : TList;
  1278. ResourceList: TList;
  1279. DeviceList : TList;
  1280. IntrList : TList;
  1281. LibList : TList;
  1282. PortList : TList;
  1283. TaskReady : TList;
  1284. TaskWait : TList;
  1285. SoftInts : Array[0..5] Of TSoftIntList;
  1286. LastAlert : Array[0..3] Of LongInt;
  1287. VBlankFrequency : Byte;
  1288. PowerSupplyFrequency: Byte;
  1289. SemaphoreList : TList;
  1290. KickMemPtr : Pointer;
  1291. KickTagPtr : Pointer;
  1292. KickCheckSum : Pointer;
  1293. ex_Pad0 : Word;
  1294. ex_LaunchPoint : DWord;
  1295. ex_RamLibPrivate : Pointer;
  1296. ex_EClockFrequency : DWord;
  1297. ex_CacheControl : DWord;
  1298. ex_TaskID : DWord;
  1299. { * New ABox Emulation Entries
  1300. * }
  1301. ex_EmulHandleSize : DWord; { * PPC EmulHandleSize..*private* * }
  1302. ex_PPCTrapMsgPort : PMsgPort; { * PPC ABox Exception MsgPort..*private* * }
  1303. ex_Reserved1 : Array[0..2] Of DWord;
  1304. ex_MMULock : Pointer;
  1305. ex_PatchPool : Pointer; { * PatchPool Ptr needed by SetFunction..*private* * }
  1306. ex_PPCTaskExitCode : Pointer; { * PPC Task exit function * }
  1307. ex_DebugFlags : DWord; { * Exec Debug Flags..*private* * }
  1308. ex_MemHandlers : TMinList;
  1309. ex_MemHandler : Pointer;
  1310. end;
  1311. { *
  1312. * Outdated 68k cpu informations
  1313. *
  1314. * }
  1315. const
  1316. AFB_68010 = 0;
  1317. AFB_68020 = 1;
  1318. AFB_68030 = 2;
  1319. AFB_68040 = 3;
  1320. AFB_68881 = 4;
  1321. AFB_68882 = 5;
  1322. AFB_FPU40 = 6;
  1323. AFB_68060 = 7;
  1324. AFB_PRIVATE = 15;
  1325. AFF_68010 = (1 Shl AFB_68010);
  1326. AFF_68020 = (1 Shl AFB_68020);
  1327. AFF_68030 = (1 Shl AFB_68030);
  1328. AFF_68040 = (1 Shl AFB_68040);
  1329. AFF_68881 = (1 Shl AFB_68881);
  1330. AFF_68882 = (1 Shl AFB_68882);
  1331. AFF_FPU40 = (1 Shl AFB_FPU40);
  1332. AFF_68060 = (1 Shl AFB_68060);
  1333. AFF_PRIVATE = (1 Shl AFB_PRIVATE);
  1334. { *
  1335. * Outdated 68k cache functionality
  1336. * Mostly without function.
  1337. * }
  1338. const
  1339. CACRF_EnableI = (1 Shl 0);
  1340. CACRF_FreezeI = (1 Shl 1);
  1341. CACRF_ClearI = (1 Shl 3);
  1342. CACRF_IBE = (1 Shl 4);
  1343. CACRF_EnableD = (1 Shl 8);
  1344. CACRF_FreezeD = (1 Shl 9);
  1345. CACRF_ClearD = (1 Shl 11);
  1346. CACRF_DBE = (1 Shl 12);
  1347. CACRF_WriteAllocate = (1 Shl 13);
  1348. CACRF_EnableE = (1 Shl 30);
  1349. CACRF_CopyBack = (1 Shl 31);
  1350. DMA_Continue = (1 Shl 1);
  1351. DMA_NoModify = (1 Shl 2);
  1352. DMA_ReadFromRAM = (1 Shl 3);
  1353. SB_SAR = 15;
  1354. SB_TQE = 14;
  1355. SB_SINT = 13;
  1356. SF_SAR = (1 Shl SB_SAR);
  1357. SF_TQE = (1 Shl SB_TQE);
  1358. SF_SINT = (1 Shl SB_SINT);
  1359. { ****** Debug Flags...(don`t depend on them) ********** }
  1360. const
  1361. EXECDEBUGF_INITRESIDENT = $1;
  1362. EXECDEBUGF_INITCODE = $2;
  1363. EXECDEBUGF_FINDRESIDENT = $4;
  1364. EXECDEBUGF_CREATELIBRARY = $10;
  1365. EXECDEBUGF_SETFUNCTION = $20;
  1366. EXECDEBUGF_NEWSETFUNCTION = $40;
  1367. EXECDEBUGF_CHIPRAM = $80;
  1368. EXECDEBUGF_ADDTASK = $100;
  1369. EXECDEBUGF_REMTASK = $200;
  1370. EXECDEBUGF_GETTASKATTR = $400;
  1371. EXECDEBUGF_SETTASKATTR = $800;
  1372. EXECDEBUGF_EXCEPTHANDLER = $1000;
  1373. EXECDEBUGF_ADDDOSNODE = $2000;
  1374. EXECDEBUGF_PCI = $4000;
  1375. EXECDEBUGF_RAMLIB = $8000;
  1376. EXECDEBUGF_NOLOGSERVER = $10000;
  1377. EXECDEBUGF_NOLOGWINDOW = $20000;
  1378. { *
  1379. * "env:MorphOS/LogPath" contains the logfile path,
  1380. * If not specified it`s using "ram:.morphoslog"
  1381. * }
  1382. EXECDEBUGF_LOGFILE = $40000;
  1383. EXECDEBUGF_LOGKPRINTF = $80000;
  1384. { * Memory Tracking Flags
  1385. * }
  1386. EXECDEBUGF_PERMMEMTRACK = $100000;
  1387. EXECDEBUGF_MEMTRACK = $200000;
  1388. { * CyberGuardPPC Flags
  1389. * }
  1390. EXECDEBUGF_CYBERGUARDDEADLY = $400000;
  1391. { * PPCLib Flags
  1392. * }
  1393. EXECDEBUGF_LOADSEG = $01000000;
  1394. EXECDEBUGF_UNLOADSEG = $02000000;
  1395. EXECDEBUGF_PPCSTART = $04000000;
  1396. { * UserFlags
  1397. * }
  1398. { *
  1399. * Enables debug output for cybergraphx
  1400. * }
  1401. const
  1402. EXECDEBUGF_CGXDEBUG = $08000000;
  1403. { *
  1404. * Should be used to control user LibInit/DevInit Debug output
  1405. * }
  1406. EXECDEBUGF_INIT = $40000000;
  1407. { *
  1408. * Should be used to control logging
  1409. * }
  1410. EXECDEBUGF_LOG = $80000000;
  1411. { *
  1412. * Execbase list IDs
  1413. * }
  1414. EXECLIST_DEVICE = 0;
  1415. EXECLIST_INTERRUPT = 1;
  1416. EXECLIST_LIBRARY = 2;
  1417. EXECLIST_MEMHANDLER = 3;
  1418. EXECLIST_MEMHEADER = 4;
  1419. EXECLIST_PORT = 5;
  1420. EXECLIST_RESOURCE = 6;
  1421. EXECLIST_SEMAPHORE = 7;
  1422. EXECLIST_TASK = 8;
  1423. { *
  1424. * Execnotify hook message
  1425. * }
  1426. type
  1427. PExecNotifyMessage = ^TExecNotifyMessage;
  1428. TExecNotifyMessage = packed record
  1429. MType : DWord;
  1430. Flags : DWord;
  1431. Extra : DWord;
  1432. Extension: Pointer;
  1433. end;
  1434. const
  1435. EXECNOTIFYF_REMOVE = (1 Shl 0); { * if clear, is ADD * }
  1436. EXECNOTIFYF_POST = (1 Shl 1); { * if clear, is PRE * }
  1437. { *
  1438. * AddExecNodeTagList tags
  1439. * }
  1440. const
  1441. SAL_Dummy = (TAG_USER + 1000);
  1442. SAL_Type = (SAL_Dummy + 1);
  1443. SAL_Priority = (SAL_Dummy + 2);
  1444. SAL_Name = (SAL_Dummy + 3);
  1445. {$include utild2.inc}