execd.inc 40 KB

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