execd.inc 40 KB

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