exec.pas 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540
  1. {
  2. This file is part of the Free Pascal run time library.
  3. Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
  4. exec.library interface unit for MorphOS/PowerPC
  5. MorphOS port was done on a free Pegasos II/G4 machine
  6. provided by 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. unit exec;
  14. interface
  15. var
  16. ExecBase: Pointer;
  17. { Some types for classic Amiga and AROS compatibility }
  18. type
  19. STRPTR = PChar;
  20. ULONG = Longword;
  21. LONG = Longint;
  22. APTR = Pointer;
  23. BPTR = Longint;
  24. BSTR = Longint;
  25. BOOL = Smallint; { I think this could be changed to WordBool (KB) }
  26. UWORD = Word;
  27. WORDBITS = Word;
  28. LONGBITS = Longword;
  29. PLONGBITS = ^LONGBITS;
  30. UBYTE = Byte;
  31. PULONG = ^Longword;
  32. PAPTR = ^APTR;
  33. PLONG = ^LONG;
  34. { Some constants for classic Amiga and AROS compatibility }
  35. const
  36. LTrue : Longint = 1;
  37. LFalse : Longint = 0;
  38. { * emulinterface consts from MorphOS SDK * }
  39. const
  40. TRAP_MASK = $00ff;
  41. TRAP_AREA_START = $ff00; { * $ff00 .. $ffff area * }
  42. TRAP_LIB = $ff00;
  43. TRAP_LIB_QUICK = $ff01;
  44. TRAP_LIBNR = $ff05;
  45. TRAP_LIBNR_QUICK = $ff06;
  46. TRAP_ISYNC = $ff0f;
  47. TRAP_SYNC = $ff10;
  48. TRAP_EIEIO = $ff11;
  49. TRAP_LIBSR = $ff12;
  50. TRAP_LIBSRNR = $ff13;
  51. TRAP_LIBD0_D1 = $ff14;
  52. TRAP_LIBRESTORE = $ff15;
  53. TRAP_LIBD0D1SR = $ff17;
  54. TRAP_LIBD0D1A0A1SR = $ff18;
  55. const
  56. EMULTAG_NAME = $0; { * Gives back a Name Ptr * }
  57. EMULTAG_VERSION = $1; { * Gives back a Version * }
  58. EMULTAG_REVISION = $2; { * Gives back a Revision * }
  59. EMULTAG_OPCODETABLE = $3; { * Gives back the 16 Bit Opcodetable Ptr or NULL * }
  60. EMULTAG_TYPE = $4; { * Gives back the emulation type * }
  61. EMULTAG_EMULHANDLE = $5; { * Gives back the EmulHandle Ptr * }
  62. EMULTAG_EMULHANDLESIZE = $6; { * Gives back the EmulHandle Size * }
  63. EMULTAG_SUPERHANDLE = $7; { * Gives back the SuperHandle Ptr * }
  64. EMULTAG_SUPERHANDLESIZE = $8; { * Gives back the SuperHandle Size * }
  65. { * emulinterface structures from MorphOS SDK * }
  66. type
  67. PEmulLibEntry = ^TEmulLibEntry;
  68. TEmulLibEntry = packed record
  69. Trap : Word;
  70. Extension: Word; { * MUST be set to 0 if you create it by hand * }
  71. Func : Pointer;
  72. end;
  73. type
  74. TEmulRegs = (regD0,regD1,regD2,regD3,regD4,regD5,regD6,regD7,regA0,regA1,regA2,regA3,regA4,regA5,regA6,regA7,regPC,regSR);
  75. type
  76. PEmulHandle = ^TEmulHandle;
  77. TEmulHandle = packed record
  78. reg: array[TEmulRegs] of LongWord; {* 0x00-0x44 68k emulation registers *}
  79. SuperHandle: Pointer; {* 0x48 pointer to SuperHandle *}
  80. _Type: ULONG; {* 0x4c EmulHandle type *}
  81. Flags: ULONG; {* 0x50 Flags *}
  82. EmulFunc: procedure; cdecl; {* 0x54 *}
  83. EmulCallOS: function(EmulCaos: pointer): ULONG; cdecl; {* 0x58 *}
  84. EmulCall68k: function(EmulCaos: pointer): ULONG; cdecl; {* 0x5c *}
  85. EmulCallQuick68k: function(EmulCaos: pointer): ULONG; cdecl; {* 0x60 *}
  86. EmulCallDirectOS: function(arg: LONG): ULONG; cdecl; {* 0x64 *}
  87. EmulCallDirect68k: function(arg: Pointer): ULONG; cdecl; {* 0x68 *}
  88. OldEmulHandle: PEmulHandle; {* 0x6c Here we record the previous EmulHandle *}
  89. { * TODO: but wait, there's more... * }
  90. end;
  91. function GetEmulHandle: PEmulHandle;
  92. function REG_D0: DWord;
  93. function REG_D1: DWord;
  94. function REG_D2: DWord;
  95. function REG_D3: DWord;
  96. function REG_D4: DWord;
  97. function REG_D5: DWord;
  98. function REG_D6: DWord;
  99. function REG_D7: DWord;
  100. function REG_A0: Pointer;
  101. function REG_A1: Pointer;
  102. function REG_A2: Pointer;
  103. function REG_A3: Pointer;
  104. function REG_A4: Pointer;
  105. function REG_A5: Pointer;
  106. function REG_A6: Pointer;
  107. function REG_A7: Pointer;
  108. function REG_PC: Pointer;
  109. function REG_SR: DWord;
  110. { * "dummy" definitions from utility, which we can't include here because it
  111. * would create a circular dependency (KB) }
  112. type
  113. PTagItem = Pointer;
  114. PHook = Pointer;
  115. { * exec node definitions (V50)
  116. *********************************************************************
  117. * }
  118. type
  119. PNode = ^TNode;
  120. TNode = packed record
  121. ln_Succ: PNode;
  122. ln_Pred: PNode;
  123. ln_Type: Byte;
  124. ln_Pri : ShortInt;
  125. ln_Name: PChar;
  126. end;
  127. type
  128. PMinNode = ^TMinNode;
  129. TMinNode = packed record
  130. mln_Succ: PMinNode;
  131. mln_Pred: PMinNode;
  132. end;
  133. const
  134. NT_UNKNOWN = 0;
  135. NT_TASK = 1;
  136. NT_INTERRUPT = 2;
  137. NT_DEVICE = 3;
  138. NT_MSGPORT = 4;
  139. NT_MESSAGE = 5;
  140. NT_FREEMSG = 6;
  141. NT_REPLYMSG = 7;
  142. NT_RESOURCE = 8;
  143. NT_LIBRARY = 9;
  144. NT_MEMORY = 10;
  145. NT_SOFTINT = 11;
  146. NT_FONT = 12;
  147. NT_PROCESS = 13;
  148. NT_SEMAPHORE = 14;
  149. NT_SIGNALSEM = 15;
  150. NT_BOOTNODE = 16;
  151. NT_KICKMEM = 17;
  152. NT_GRAPHICS = 18;
  153. NT_DEATHMESSAGE = 19;
  154. NT_USER = 254;
  155. NT_EXTENDED = 255;
  156. { * exec list definitions (V50)
  157. *********************************************************************
  158. * }
  159. type
  160. PList = ^TList;
  161. TList = packed record
  162. lh_Head : PNode;
  163. lh_Tail : PNode;
  164. lh_TailPred: PNode;
  165. lh_Type : Byte;
  166. lh_pad : Byte;
  167. end;
  168. type
  169. PMinList = ^TMinList;
  170. TMinList = packed record
  171. mlh_Head : PMinNode;
  172. mlh_Tail : PMinNode;
  173. mlh_TailPred: PMinNode;
  174. end;
  175. { * exec alert definitions (V50)
  176. *********************************************************************
  177. * }
  178. const
  179. ACPU_BusErr = $80000002;
  180. ACPU_AddressErr = $80000003;
  181. ACPU_InstErr = $80000004;
  182. ACPU_DivZero = $80000005;
  183. ACPU_CHK = $80000006;
  184. ACPU_TRAPV = $80000007;
  185. ACPU_PrivErr = $80000008;
  186. ACPU_Trace = $80000009;
  187. ACPU_LineA = $8000000A;
  188. ACPU_LineF = $8000000B;
  189. ACPU_Format = $8000000E;
  190. ACPU_Spurious = $80000018;
  191. ACPU_AutoVec1 = $80000019;
  192. ACPU_AutoVec2 = $8000001A;
  193. ACPU_AutoVec3 = $8000001B;
  194. ACPU_AutoVec4 = $8000001C;
  195. ACPU_AutoVec5 = $8000001D;
  196. ACPU_AutoVec6 = $8000001E;
  197. ACPU_AutoVec7 = $8000001F;
  198. AT_DeadEnd = $80000000;
  199. AT_Recovery = $00000000;
  200. AG_NoMemory = $00010000;
  201. AG_MakeLib = $00020000;
  202. AG_OpenLib = $00030000;
  203. AG_OpenDev = $00040000;
  204. AG_OpenRes = $00050000;
  205. AG_IOError = $00060000;
  206. AG_NoSignal = $00070000;
  207. AG_BadParm = $00080000;
  208. AG_CloseLib = $00090000;
  209. AG_CloseDev = $000A0000;
  210. AG_ProcCreate = $000B0000;
  211. AG_MsgPortNotEmpty = $000C0000 { * V50 * };
  212. AO_ExecLib = $00008001;
  213. AO_GraphicsLib = $00008002;
  214. AO_LayersLib = $00008003;
  215. AO_Intuition = $00008004;
  216. AO_MathLib = $00008005;
  217. AO_DOSLib = $00008007;
  218. AO_RAMLib = $00008008;
  219. AO_IconLib = $00008009;
  220. AO_ExpansionLib = $0000800A;
  221. AO_DiskfontLib = $0000800B;
  222. AO_UtilityLib = $0000800C;
  223. AO_KeyMapLib = $0000800D;
  224. AO_AudioDev = $00008010;
  225. AO_ConsoleDev = $00008011;
  226. AO_GamePortDev = $00008012;
  227. AO_KeyboardDev = $00008013;
  228. AO_TrackDiskDev = $00008014;
  229. AO_TimerDev = $00008015;
  230. AO_CIARsrc = $00008020;
  231. AO_DiskRsrc = $00008021;
  232. AO_MiscRsrc = $00008022;
  233. AO_BootStrap = $00008030;
  234. AO_Workbench = $00008031;
  235. AO_DiskCopy = $00008032;
  236. AO_GadTools = $00008033;
  237. AO_Unknown = $00008035;
  238. { *
  239. * exec.library
  240. * }
  241. const
  242. AN_ExecLib = $01000000;
  243. AN_ExcptVect = $01000001;
  244. AN_BaseChkSum = $01000002;
  245. AN_LibChkSum = $01000003;
  246. AN_MemCorrupt = $81000005;
  247. AN_IntrMem = $81000006;
  248. AN_InitAPtr = $01000007;
  249. AN_SemCorrupt = $01000008;
  250. AN_FreeTwice = $01000009;
  251. AN_BogusExcpt = $8100000A;
  252. AN_IOUsedTwice = $0100000B;
  253. AN_MemoryInsane = $0100000C;
  254. AN_IOAfterClose = $0100000D;
  255. AN_StackProbe = $0100000E;
  256. AN_BadFreeAddr = $0100000F;
  257. AN_BadSemaphore = $01000010;
  258. { *
  259. * graphics.library
  260. * }
  261. const
  262. AN_GraphicsLib = $02000000;
  263. AN_GfxNoMem = $82010000;
  264. AN_GfxNoMemMspc = $82010001;
  265. AN_LongFrame = $82010006;
  266. AN_ShortFrame = $82010007;
  267. AN_TextTmpRas = $02010009;
  268. AN_BltBitMap = $8201000A;
  269. AN_RegionMemory = $8201000B;
  270. AN_MakeVPort = $82010030;
  271. AN_GfxNewError = $0200000C;
  272. AN_GfxFreeError = $0200000D;
  273. AN_GfxNoLCM = $82011234;
  274. AN_ObsoleteFont = $02000401;
  275. { *
  276. * layers.library
  277. * }
  278. const
  279. AN_LayersLib = $03000000;
  280. AN_LayersNoMem = $83010000;
  281. { *
  282. * intuition.library
  283. * }
  284. const
  285. AN_Intuition = $04000000;
  286. AN_GadgetType = $84000001;
  287. AN_BadGadget = $04000001;
  288. AN_CreatePort = $84010002;
  289. AN_ItemAlloc = $04010003;
  290. AN_SubAlloc = $04010004;
  291. AN_PlaneAlloc = $84010005;
  292. AN_ItemBoxTop = $84000006;
  293. AN_OpenScreen = $84010007;
  294. AN_OpenScrnRast = $84010008;
  295. AN_SysScrnType = $84000009;
  296. AN_AddSWGadget = $8401000A;
  297. AN_OpenWindow = $8401000B;
  298. AN_BadState = $8400000C;
  299. AN_BadMessage = $8400000D;
  300. AN_WeirdEcho = $8400000E;
  301. AN_NoConsole = $8400000F;
  302. AN_NoISem = $04000010;
  303. AN_ISemOrder = $04000011;
  304. { *
  305. * math.library
  306. * }
  307. const
  308. AN_MathLib = $05000000;
  309. { *
  310. * dos.library
  311. * }
  312. const
  313. AN_DOSLib = $07000000;
  314. AN_StartMem = $07010001;
  315. AN_EndTask = $07000002;
  316. AN_QPktFail = $07000003;
  317. AN_AsyncPkt = $07000004;
  318. AN_FreeVec = $07000005;
  319. AN_DiskBlkSeq = $07000006;
  320. AN_BitMap = $07000007;
  321. AN_KeyFree = $07000008;
  322. AN_BadChkSum = $07000009;
  323. AN_DiskError = $0700000A;
  324. AN_KeyRange = $0700000B;
  325. AN_BadOverlay = $0700000C;
  326. AN_BadInitFunc = $0700000D;
  327. AN_FileReclosed = $0700000E;
  328. { *
  329. * ramlib.library
  330. * }
  331. const
  332. AN_RAMLib = $08000000;
  333. AN_BadSegList = $08000001;
  334. { *
  335. * icon.library
  336. * }
  337. const
  338. AN_IconLib = $09000000;
  339. { *
  340. * expansion.library
  341. * }
  342. const
  343. AN_ExpansionLib = $0A000000;
  344. AN_BadExpansionFree = $0A000001;
  345. { *
  346. * diskfont.library
  347. * }
  348. const
  349. AN_DiskfontLib = $0B000000;
  350. { *
  351. * audio.device
  352. * }
  353. const
  354. AN_AudioDev = $10000000;
  355. { *
  356. * console.device
  357. * }
  358. const
  359. AN_ConsoleDev = $11000000;
  360. AN_NoWindow = $11000001;
  361. { *
  362. * gameport.device
  363. * }
  364. const
  365. AN_GamePortDev = $12000000;
  366. { *
  367. * keyboard.device
  368. * }
  369. const
  370. AN_KeyboardDev = $13000000;
  371. { *
  372. * trackdisk.device
  373. * }
  374. const
  375. AN_TrackDiskDev = $14000000;
  376. AN_TDCalibSeek = $14000001;
  377. AN_TDDelay = $14000002;
  378. { *
  379. * timer.device
  380. * }
  381. const
  382. AN_TimerDev = $15000000;
  383. AN_TMBadReq = $15000001;
  384. AN_TMBadSupply = $15000002;
  385. { *
  386. * cia.resource
  387. * }
  388. const
  389. AN_CIARsrc = $20000000;
  390. { *
  391. * disk.resource
  392. * }
  393. const
  394. AN_DiskRsrc = $21000000;
  395. AN_DRHasDisk = $21000001;
  396. AN_DRIntNoAct = $21000002;
  397. { *
  398. * misc.resource
  399. * }
  400. const
  401. AN_MiscRsrc = $22000000;
  402. { *
  403. * bootstrap
  404. * }
  405. const
  406. AN_BootStrap = $30000000;
  407. AN_BootError = $30000001;
  408. { *
  409. * Workbench
  410. * }
  411. const
  412. AN_Workbench = $31000000;
  413. AN_NoFonts = $B1000001;
  414. AN_WBBadStartupMsg1 = $31000001;
  415. AN_WBBadStartupMsg2 = $31000002;
  416. AN_WBBadIOMsg = $31000003;
  417. AN_WBReLayoutToolMenu = $B1010009;
  418. { *
  419. * DiskCopy
  420. * }
  421. const
  422. AN_DiskCopy = $32000000;
  423. { *
  424. * toolkit for Intuition
  425. * }
  426. const
  427. AN_GadTools = $33000000;
  428. { *
  429. * System utility library
  430. * }
  431. const
  432. AN_UtilityLib = $34000000;
  433. { *
  434. * For use by any application that needs it
  435. * }
  436. const
  437. AN_Unknown = $35000000;
  438. { * exec error definitions (V50)
  439. *********************************************************************
  440. * }
  441. const
  442. IOERR_OPENFAIL = (-1);
  443. IOERR_ABORTED = (-2);
  444. IOERR_NOCMD = (-3);
  445. IOERR_BADLENGTH = (-4);
  446. IOERR_BADADDRESS = (-5);
  447. IOERR_UNITBUSY = (-6);
  448. IOERR_SELFTEST = (-7);
  449. IOERR_NOMEMORY = (-8);
  450. { * exec resident definitions (V50)
  451. *********************************************************************
  452. * }
  453. type
  454. PResident = ^TResident;
  455. TResident = packed record
  456. rt_MatchWord: Word;
  457. rt_MatchTag : PResident;
  458. rt_EndSkip : Pointer;
  459. rt_Flags : Byte;
  460. rt_Version : Byte;
  461. rt_Type : Byte;
  462. rt_Pri : Byte;
  463. rt_Name : PChar;
  464. rt_IdString : PChar;
  465. rt_Init : Pointer;
  466. { * Only valid when RTF_EXTENDED is set
  467. * }
  468. rt_Revision : Word; { * Revision Entry * }
  469. rt_Tags : Pointer;
  470. end;
  471. const
  472. RTC_MATCHWORD = $4AFC;
  473. RTF_AUTOINIT = (1 Shl 7);
  474. RTF_EXTENDED = (1 Shl 6); { * structure extension is valid * }
  475. { * rt_Init points to a PPC function which must be defined as
  476. *
  477. * struct Library* LIB_Init(struct Library *MyLibBase,
  478. * BPTR SegList,
  479. * struct ExecBase *SysBase)
  480. * }
  481. RTF_PPC = (1 Shl 3);
  482. RTF_AFTERDOS = (1 Shl 2);
  483. RTF_SINGLETASK = (1 Shl 1);
  484. RTF_COLDSTART = (1 Shl 0);
  485. RTW_NEVER = 0;
  486. RTW_COLDSTART = 1;
  487. { * exec memory definitions (V50)
  488. *********************************************************************
  489. * }
  490. type
  491. PMemChunk = ^TMemChunk;
  492. TMemChunk = packed record
  493. mc_Next : PMemChunk;
  494. mc_Bytes: DWord;
  495. end;
  496. type
  497. PMemHeader = ^TMemHeader;
  498. TMemHeader = packed record
  499. mh_Node : TNode;
  500. mh_Attributes: Word;
  501. mh_First : PMemChunk;
  502. mh_Lower : Pointer;
  503. mh_Upper : Pointer;
  504. mh_Free : DWord;
  505. end;
  506. type
  507. PMemEntry = ^TMemEntry;
  508. TMemEntry = packed record
  509. me_Un: packed record
  510. case Byte of
  511. 0 : (meu_Reqs: DWord);
  512. 1 : (meu_Addr: Pointer)
  513. end;
  514. me_Length: DWord;
  515. end;
  516. type
  517. PMemList = ^TMemList;
  518. TMemList = packed record
  519. ml_Node : TNode;
  520. ml_NumEntries: Word;
  521. ml_ME : array [0..0] of TMemEntry;
  522. end;
  523. const
  524. MEMF_ANY = 0;
  525. MEMF_PUBLIC = (1 Shl 0);
  526. MEMF_CHIP = (1 Shl 1);
  527. MEMF_FAST = (1 Shl 2);
  528. MEMF_LOCAL = (1 Shl 8);
  529. MEMF_24BITDMA = (1 Shl 9);
  530. MEMF_KICK = (1 Shl 10);
  531. MEMF_SWAP = (1 Shl 11); { * Memory that can be swapped out to disk * }
  532. MEMF_CLEAR = (1 Shl 16);
  533. MEMF_LARGEST = (1 Shl 17);
  534. MEMF_REVERSE = (1 Shl 18);
  535. MEMF_TOTAL = (1 Shl 19);
  536. MEMF_SEM_PROTECTED = (1 Shl 20); { * Pools: semaphore protection * }
  537. MEMF_NO_EXPUNGE = (1 Shl 31);
  538. MEM_BLOCKSIZE = 8;
  539. MEM_BLOCKMASK = (MEM_BLOCKSIZE - 1);
  540. type
  541. PMemHandlerData = ^TMemHandlerData;
  542. TMemHandlerData = packed record
  543. memh_RequestSize : DWord;
  544. memh_RequestFlags: DWord;
  545. memh_Flags : DWord;
  546. end;
  547. const
  548. MEMHF_RECYCLE = (1 Shl 0);
  549. MEM_DID_NOTHING = 0;
  550. MEM_ALL_DONE = -1;
  551. MEM_TRY_AGAIN = 1;
  552. { * exec port definitions (V50)
  553. *********************************************************************
  554. * }
  555. type
  556. PMsgPort = ^TMsgPort;
  557. TMsgPort = packed record
  558. mp_Node : TNode;
  559. mp_Flags : Byte;
  560. mp_SigBit : Byte;
  561. mp_SigTask: Pointer;
  562. mp_MsgList: TList;
  563. end;
  564. const
  565. PF_ACTION = 3;
  566. PA_SIGNAL = 0;
  567. PA_SOFTINT = 1;
  568. PA_IGNORE = 2;
  569. type
  570. PMessage = ^TMessage;
  571. TMessage = packed record
  572. mn_Node : TNode;
  573. mn_ReplyPort: PMsgPort;
  574. mn_Length : Word;
  575. end;
  576. { * exec task definitions (V50)
  577. *********************************************************************
  578. * }
  579. type
  580. PTask = ^TTask;
  581. TTask = packed record
  582. tc_Node : TNode;
  583. tc_Flags : Byte;
  584. tc_State : Byte;
  585. tc_IDNestCnt: ShortInt;
  586. tc_TDNestCnt: ShortInt;
  587. tc_SigAlloc : DWord;
  588. tc_SigWait : DWord;
  589. tc_SigRecvd : DWord;
  590. tc_SigExcept: DWord;
  591. {$IF 0}
  592. tc_TrapAlloc: Word;
  593. tc_TrapAble : Word;
  594. {$ELSE}
  595. tc_ETask: Pointer;
  596. {$ENDIF}
  597. tc_ExceptData: Pointer;
  598. tc_ExceptCode: Pointer;
  599. tc_TrapData : Pointer;
  600. tc_TrapCode : Pointer;
  601. tc_SPReg : Pointer;
  602. tc_SPLower : Pointer;
  603. tc_SPUpper : Pointer;
  604. tc_Switch : Pointer; { *** OBSOLETE *** }
  605. tc_Launch : Pointer; { *** OBSOLETE *** }
  606. tc_MemEntry : TList;
  607. tc_UserData : Pointer;
  608. end;
  609. const
  610. TB_PROCTIME = 0;
  611. TB_ETASK = 3;
  612. TB_STACKCHK = 4;
  613. TB_EXCEPT = 5;
  614. TB_SWITCH = 6;
  615. TB_LAUNCH = 7;
  616. TF_PROCTIME = (1 Shl TB_PROCTIME);
  617. TF_ETASK = (1 Shl TB_ETASK);
  618. TF_STACKCHK = (1 Shl TB_STACKCHK);
  619. TF_EXCEPT = (1 Shl TB_EXCEPT);
  620. TF_SWITCH = (1 Shl TB_SWITCH);
  621. TF_LAUNCH = (1 Shl TB_LAUNCH);
  622. TS_INVALID = 0;
  623. TS_ADDED = 1;
  624. TS_RUN = 2;
  625. TS_READY = 3;
  626. TS_WAIT = 4;
  627. TS_EXCEPT = 5;
  628. TS_REMOVED = 6;
  629. SIGB_ABORT = 0;
  630. SIGB_CHILD = 1;
  631. SIGB_BLIT = 4;
  632. SIGB_SINGLE = 4;
  633. SIGB_INTUITION = 5;
  634. SIGB_NET = 7;
  635. SIGB_DOS = 8;
  636. SIGF_ABORT = (1 Shl SIGB_ABORT);
  637. SIGF_CHILD = (1 Shl SIGB_CHILD);
  638. SIGF_BLIT = (1 Shl SIGB_BLIT);
  639. SIGF_SINGLE = (1 Shl SIGB_SINGLE);
  640. SIGF_INTUITION = (1 Shl SIGB_INTUITION);
  641. SIGF_NET = (1 Shl SIGB_NET);
  642. SIGF_DOS = (1 Shl SIGB_DOS);
  643. type
  644. PTaskTrapMessage = ^TTaskTrapMessage;
  645. TTaskTrapMessage = packed record
  646. Message: TMessage; { * Message Header * }
  647. Task : TTask; { * connected Task * }
  648. Version: DWord; { * version of the structure * }
  649. TType : DWord; { * Exception Type * }
  650. DAR : DWord; { * Exception Address Register * }
  651. DSISR : DWord; { * Exception DSISR Reg * }
  652. { * This is undiscovered land...
  653. * never assume a size of this structure
  654. * }
  655. end;
  656. const
  657. VERSION_TASKTRAPMESSAGE = $0;
  658. type
  659. PETask = ^TETask;
  660. TETask = packed record
  661. Message : TMessage;
  662. Parent : PTask;
  663. UniqueID : DWord;
  664. Children : TMinList;
  665. TrapAlloc: Word;
  666. TrapAble : Word;
  667. Result1 : DWord;
  668. Result2 : Pointer;
  669. MsgPort : TMsgPort;
  670. { * Don't touch!!!!!!!!!..there'll be an interface
  671. * sooner than later.
  672. * New Entries...most of the above entries
  673. * are only their for structure compatability.
  674. * They have no meaning as the OS never supported
  675. * them.
  676. * }
  677. { * A Task Pool for the task.
  678. * }
  679. MemPool: Pointer;
  680. { * PPC's Stack Lower Ptr
  681. * The initial stack is allocated through
  682. * AllocVec, so a FreeVec(ETask^.PPCSPLower);
  683. * would work.
  684. * If you use PPCStackSwap you must allocate
  685. * your stack block with AllocVec();
  686. * }
  687. PPCSPLower: Pointer;
  688. { * PPC's Stack Upper Ptr
  689. * }
  690. PPCSPUpper : Pointer;
  691. PPCRegFrame: Pointer;
  692. PPCLibData : Pointer;
  693. { * On a PPC exception this msgport
  694. * is sent an exception msg...
  695. * the task is stopped until somebody
  696. * wakes it up again.
  697. * (asynchron exception interface)
  698. * If this Port is NULL the message is
  699. * sent to SysBase->ex_PPCTrapMsgPort.
  700. * }
  701. PPCTrapMsgPort: PMsgPort;
  702. PPCTrapMessage: PTaskTrapMessage;
  703. { * This is undiscovered land...
  704. * never assume a size of this structure
  705. * }
  706. end;
  707. type
  708. PTaskInitExtension = ^TTaskInitExtension;
  709. TTaskInitExtension = packed record
  710. { * Must be filled with TRAP_PPCTASK
  711. * }
  712. Trap : Word;
  713. Extension: Word; { * Must be set to 0 * }
  714. Tags : Pointer;
  715. end;
  716. { * This is normally in utility headers, but in Pascal that would
  717. * cause a circular dependency, so have it duplicated here... (KB) }
  718. const
  719. TAG_USER = 1 Shl 31;
  720. const
  721. TASKTAG_DUMMY = (TAG_USER + $100000);
  722. { * Ptr to an ULONG Errorfield where a better error description
  723. * can be stored.
  724. * }
  725. TASKTAG_ERROR = (TASKTAG_DUMMY + $0);
  726. { * Code type
  727. * can be stored.
  728. * }
  729. TASKTAG_CODETYPE = (TASKTAG_DUMMY + $1);
  730. { * Start PC
  731. * code must be of TASKTAG_CODETYPE
  732. * }
  733. TASKTAG_PC = (TASKTAG_DUMMY + $2);
  734. { * Final PC
  735. * code must be of TASKTAG_CODETYPE
  736. * }
  737. TASKTAG_FINALPC = (TASKTAG_DUMMY + $3);
  738. { * Stacksize...Default 8192
  739. * }
  740. TASKTAG_STACKSIZE = (TASKTAG_DUMMY + $4);
  741. { * Std Stacksize...
  742. * Default(use the stack defined by tc_SPLower..tc_SPUpper)
  743. * }
  744. TASKTAG_STACKSIZE_M68K = (TASKTAG_DUMMY + $5);
  745. { * specify task name, name is copied
  746. * }
  747. TASKTAG_NAME = (TASKTAG_DUMMY + $6);
  748. { * tc_UserData
  749. * }
  750. TASKTAG_USERDATA = (TASKTAG_DUMMY + $7);
  751. { * Task priority
  752. * }
  753. TASKTAG_PRI = (TASKTAG_DUMMY + $8);
  754. { * Pool's Puddlesize
  755. * }
  756. TASKTAG_POOLPUDDLE = (TASKTAG_DUMMY + $9);
  757. { * Pool's ThreshSize
  758. * }
  759. TASKTAG_POOLTHRESH = (TASKTAG_DUMMY + $a);
  760. { * PPC First Argument..gpr3
  761. * }
  762. TASKTAG_PPC_ARG1 = (TASKTAG_DUMMY + $10);
  763. { * PPC First Argument..gpr4
  764. * }
  765. TASKTAG_PPC_ARG2 = (TASKTAG_DUMMY + $11);
  766. { * PPC First Argument..gpr5
  767. * }
  768. TASKTAG_PPC_ARG3 = (TASKTAG_DUMMY + $12);
  769. { * PPC First Argument..gpr6
  770. * }
  771. TASKTAG_PPC_ARG4 = (TASKTAG_DUMMY + $13);
  772. { * PPC First Argument..gpr7
  773. * }
  774. TASKTAG_PPC_ARG5 = (TASKTAG_DUMMY + $14);
  775. { * PPC First Argument..gpr8
  776. * }
  777. TASKTAG_PPC_ARG6 = (TASKTAG_DUMMY + $15);
  778. { * PPC First Argument..gpr9
  779. * }
  780. TASKTAG_PPC_ARG7 = (TASKTAG_DUMMY + $16);
  781. { * PPC First Argument..gpr10
  782. * }
  783. TASKTAG_PPC_ARG8 = (TASKTAG_DUMMY + $17);
  784. { *
  785. * Startup message to be passed to task/process, ReplyMsg'd at RemTask()
  786. * ti_Data: struct Message *
  787. * }
  788. TASKTAG_STARTUPMSG = (TASKTAG_DUMMY + $18);
  789. { *
  790. * Create internal MsgPort for task/process, deleted at RemTask()
  791. * ti_Data: struct MsgPort **, can be NULL
  792. * }
  793. TASKTAG_TASKMSGPORT = (TASKTAG_DUMMY + $19);
  794. const
  795. CODETYPE_M68K = $0;
  796. { *
  797. * System V4 ABI
  798. * }
  799. CODETYPE_PPC = $1;
  800. const
  801. TASKERROR_OK = 0;
  802. TASKERROR_NOMEMORY = 1;
  803. { *
  804. * Stack swap structure as passed to StackSwap() and PPCStackSwap()
  805. * }
  806. type
  807. PStackSwapStruct = ^TStackSwapStruct;
  808. TStackSwapStruct = packed record
  809. stk_Lower : Pointer; { * Lowest byte of stack * }
  810. stk_Upper : Pointer; { * Upper end of stack (size + Lowert) * }
  811. stk_Pointer: Pointer; { * Stack pointer at switch point * }
  812. end;
  813. type
  814. PPPCStackSwapArgs = ^TPPCStackSwapArgs;
  815. TPPCStackSwapArgs = packed record
  816. Args: Array[0..7] Of DWord; { * The C register arguments from gpr3..gpr11 * }
  817. end;
  818. { *
  819. * NewGetTaskAttrsA(), NewSetTaskAttrsA() tags
  820. * }
  821. const
  822. TASKINFOTYPE_ALLTASK = $0;
  823. TASKINFOTYPE_NAME = $1;
  824. TASKINFOTYPE_PRI = $2;
  825. TASKINFOTYPE_TYPE = $3;
  826. TASKINFOTYPE_STATE = $4;
  827. TASKINFOTYPE_FLAGS = $5;
  828. TASKINFOTYPE_SIGALLOC = $6;
  829. TASKINFOTYPE_SIGWAIT = $7;
  830. TASKINFOTYPE_SIGRECVD = $8;
  831. TASKINFOTYPE_SIGEXCEPT = $9;
  832. TASKINFOTYPE_EXCEPTDATA = $a;
  833. TASKINFOTYPE_EXCEPTCODE = $b;
  834. TASKINFOTYPE_TRAPDATA = $c;
  835. TASKINFOTYPE_TRAPCODE = $d;
  836. TASKINFOTYPE_STACKSIZE_M68K = $e;
  837. TASKINFOTYPE_STACKSIZE = $f;
  838. TASKINFOTYPE_USEDSTACKSIZE_M68K = $10;
  839. TASKINFOTYPE_USEDSTACKSIZE = $11;
  840. TASKINFOTYPE_TRAPMSGPORT = $12;
  841. TASKINFOTYPE_STARTUPMSG = $13;
  842. TASKINFOTYPE_TASKMSGPORT = $14;
  843. TASKINFOTYPE_POOLPTR = $15;
  844. TASKINFOTYPE_POOLMEMFLAGS = $16;
  845. TASKINFOTYPE_POOLPUDDLESIZE = $17;
  846. TASKINFOTYPE_POOLTHRESHSIZE = $18;
  847. { *
  848. * Task Scheduler statistics (exec 50.42)
  849. * }
  850. TASKINFOTYPE_NICE = $19;
  851. TASKINFOTYPE_AGETICKS = $1a;
  852. TASKINFOTYPE_CPUTIME = $1b;
  853. TASKINFOTYPE_LASTSECCPUTIME = $1c;
  854. TASKINFOTYPE_RECENTCPUTIME = $1d;
  855. TASKINFOTYPE_VOLUNTARYCSW = $1e;
  856. TASKINFOTYPE_INVOLUNTARYCSW = $1f;
  857. TASKINFOTYPE_LASTSECVOLUNTARYCSW = $20;
  858. TASKINFOTYPE_LASTSECINVOLUNTARYCSW = $21;
  859. { * Added in exec 50.45 * }
  860. TASKINFOTYPE_LAUNCHTIMETICKS = $22;
  861. TASKINFOTYPE_LAUNCHTIMETICKS1978 = $23;
  862. TASKINFOTYPE_PID = $24;
  863. TASKINFOTYPE_68K_NEWFRAME = $50;
  864. TASKINFOTYPE_PPC_SRR0 = $100;
  865. TASKINFOTYPE_PPC_SRR1 = $101;
  866. TASKINFOTYPE_PPC_LR = $102;
  867. TASKINFOTYPE_PPC_CTR = $103;
  868. TASKINFOTYPE_PPC_CR = $104;
  869. TASKINFOTYPE_PPC_XER = $105;
  870. TASKINFOTYPE_PPC_GPR = $106;
  871. TASKINFOTYPE_PPC_FPR = $107;
  872. TASKINFOTYPE_PPC_FPSCR = $108;
  873. TASKINFOTYPE_PPC_VSCR = $109;
  874. TASKINFOTYPE_PPC_VMX = $10a;
  875. TASKINFOTYPE_PPC_VSAVE = $10b;
  876. TASKINFOTYPE_PPC_FRAME = $10c;
  877. TASKINFOTYPE_PPC_FRAMESIZE = $10d;
  878. TASKINFOTYPE_PPC_NEWFRAME = $10e;
  879. TASKINFOTAG_DUMMY = (TAG_USER + $110000);
  880. { * Used with TASKINFOTYPE_ALLTASK
  881. * }
  882. TASKINFOTAG_HOOK = (TASKINFOTAG_DUMMY + $0);
  883. { * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX
  884. * to define the copy area
  885. * }
  886. TASKINFOTAG_REGSTART = (TASKINFOTAG_DUMMY + $1);
  887. { * Used with TASKINFOTYPE_PPC_GPR,TASKINFOTYPE_PPC_FPR,TASKINFOTYPE_PPC_VMX
  888. * to define the copy area
  889. * }
  890. TASKINFOTAG_REGCOUNT = (TASKINFOTAG_DUMMY + $2);
  891. { *
  892. * NewSetTaskAttrsA(..,@TaskFrame68k,sizeof(TTaskFrame68k),TASKINFOTYPE_68K_NEWFRAME,...);
  893. * }
  894. type
  895. PTaskFrame68k = ^TTaskFrame68k;
  896. TTaskFrame68k = packed record
  897. PC: Pointer;
  898. SR: Word;
  899. Xn: Array[0..14] Of LongInt;
  900. end;
  901. { *
  902. * Don't depend on these
  903. * }
  904. const
  905. DEFAULT_PPCSTACKSIZE = 32768;
  906. DEFAULT_M68KSTACKSIZE = 2048;
  907. DEFAULT_TASKPUDDLESIZE = 4096;
  908. DEFAULT_TASKTHRESHSIZE = 4096;
  909. { * exec interrupt definitions (V50)
  910. *********************************************************************
  911. * }
  912. type
  913. PInterrupt = ^TInterrupt;
  914. TInterrupt = packed record
  915. is_Node: TNode;
  916. is_Data: Pointer;
  917. is_Code: Pointer;
  918. end;
  919. type
  920. PIntVector = ^TIntVector;
  921. TIntVector = packed record
  922. iv_Data: Pointer;
  923. iv_Code: Pointer;
  924. iv_Node: PNode;
  925. end;
  926. type
  927. PSoftIntList = ^TSoftIntList;
  928. TSoftIntList = packed record
  929. sh_List: TList;
  930. sh_Pad : Word;
  931. end;
  932. const
  933. SIH_PRIMASK = $f0;
  934. INTB_NMI = 15;
  935. INTF_NMI = (1 Shl INTB_NMI);
  936. { * exec semaphore definitions (V50)
  937. *********************************************************************
  938. * }
  939. { *
  940. * Shouldn't be available public..
  941. * }
  942. type
  943. PSemaphoreRequest = ^TSemaphoreRequest;
  944. TSemaphoreRequest = packed record
  945. sr_Link : TMinNode;
  946. sr_Waiter: PTask;
  947. end;
  948. type
  949. PSignalSemaphore = ^TSignalSemaphore;
  950. TSignalSemaphore = packed record
  951. ss_Link : TNode;
  952. ss_NestCount : SmallInt;
  953. ss_WaitQueue : TMinList;
  954. ss_MultipleLink: TSemaphoreRequest;
  955. ss_Owner : PTask;
  956. ss_QueueCount : SmallInt;
  957. end;
  958. type
  959. PSemaphoreMessage = ^TSemaphoreMessage;
  960. TSemaphoreMessage = packed record
  961. ssm_Message : TMessage;
  962. ssm_Semaphore: PSignalSemaphore;
  963. end;
  964. const
  965. SM_SHARED = 1;
  966. SM_EXCLUSIVE = 0;
  967. { * exec machine definitions (V50)
  968. *********************************************************************
  969. * }
  970. const
  971. MACHINE_M68k = $0;
  972. MACHINE_PPC = $1;
  973. MACHINE_NO = $ffffffff;
  974. { * exec library definitions (V50)
  975. *********************************************************************
  976. * }
  977. const
  978. LIB_VECTSIZE = 6;
  979. LIB_RESERVED = 4;
  980. LIB_BASE = (-LIB_VECTSIZE);
  981. LIB_USERDEF = (LIB_BASE - (LIB_RESERVED * LIB_VECTSIZE));
  982. LIB_NONSTD = (LIB_USERDEF);
  983. LIB_OPEN = -6;
  984. LIB_CLOSE = -12;
  985. LIB_EXPUNGE = -18;
  986. LIB_EXTFUNC = -24;
  987. LIB_GETQUERYATTR = -24; { * LIBF_QUERY * }
  988. type
  989. PLibrary = ^TLibrary;
  990. TLibrary = packed record
  991. lib_Node : TNode;
  992. lib_Flags : Byte;
  993. lib_pad : Byte;
  994. lib_MegSize : Word;
  995. lib_PosSize : Word;
  996. lib_Version : Word;
  997. lib_Revision: Word;
  998. lib_IdString: PChar;
  999. lib_Sum : DWord;
  1000. lib_OpenCnt : Word;
  1001. end;
  1002. const
  1003. LIBF_SUMMING = (1 Shl 0);
  1004. LIBF_CHANGED = (1 Shl 1);
  1005. LIBF_SUMUSED = (1 Shl 2);
  1006. LIBF_DELEXP = (1 Shl 3);
  1007. { *
  1008. * private
  1009. * }
  1010. LIBF_RAMLIB = (1 Shl 4);
  1011. { *
  1012. * Needs to be set if the GetQueryAttr function is legal
  1013. * }
  1014. LIBF_QUERYINFO = (1 Shl 5);
  1015. { *
  1016. * The remaining bits are reserved and aren`t allowed to be touched
  1017. * }
  1018. { * NewSetFunction extensions
  1019. * }
  1020. const
  1021. SETFUNCTAG_Dummy = (TAG_USER +$01000000);
  1022. { * Set the machine type of the function
  1023. * Default is 68k
  1024. * }
  1025. SETFUNCTAG_MACHINE = (SETFUNCTAG_Dummy + $1);
  1026. { * Function type specifier
  1027. * }
  1028. SETFUNCTAG_TYPE = (SETFUNCTAG_Dummy + $2);
  1029. { * ID String
  1030. * }
  1031. SETFUNCTAG_IDNAME = (SETFUNCTAG_Dummy + $3);
  1032. { *
  1033. * Set to TRUE if the replaced function will never be used
  1034. * again.
  1035. * }
  1036. SETFUNCTAG_DELETE = (SETFUNCTAG_Dummy + $4);
  1037. { * See emul/emulinterface.h for more informations
  1038. * }
  1039. { * Save Emulation PPC Registers
  1040. * Call Function
  1041. * Restore Emulation PPC Registers
  1042. * REG_D0 = Result
  1043. * }
  1044. const
  1045. SETFUNCTYPE_NORMAL = 0;
  1046. { * Call Function
  1047. * Must use the global register settings of the emulation
  1048. * REG_D0 = Result
  1049. * }
  1050. SETFUNCTYPE_QUICK = 1;
  1051. { * Save Emulation PPC Registers
  1052. * Call Function
  1053. * Restore Emulation PPC Registers
  1054. * No Result
  1055. * Needed to replace functions like
  1056. * forbid,obtainsemaphores which are
  1057. * defined as trashing no registers
  1058. * }
  1059. SETFUNCTYPE_NORMALNR = 2;
  1060. { * Call Function
  1061. * Must use the global register settings of the emulation
  1062. * No Result
  1063. * Needed to replace functions like
  1064. * forbid,obtainsemaphores which are
  1065. * defined as trashing no registers
  1066. * }
  1067. SETFUNCTYPE_QUICKNR = 3;
  1068. SETFUNCTYPE_NORMALSR = 4;
  1069. SETFUNCTYPE_NORMALSRNR = 5;
  1070. SETFUNCTYPE_NORMALD0_D1 = 6;
  1071. SETFUNCTYPE_NORMALRESTORE = 7;
  1072. SETFUNCTYPE_SYSTEMV = 8;
  1073. SETFUNCTYPE_NORMALD0D1SR = 9;
  1074. SETFUNCTYPE_NORMALD0D1A0A1SR = 10;
  1075. { * CreateLibrary extensions
  1076. * }
  1077. LIBTAG_BASE = (TAG_USER + $01000100);
  1078. { *
  1079. * Function/Vector Array
  1080. * }
  1081. LIBTAG_FUNCTIONINIT = (LIBTAG_BASE+$0);
  1082. { *
  1083. * Struct Init
  1084. * }
  1085. LIBTAG_STRUCTINIT = (LIBTAG_BASE+$1);
  1086. { *
  1087. * Library Init
  1088. * }
  1089. LIBTAG_LIBRARYINIT = (LIBTAG_BASE+$2);
  1090. { *
  1091. * Init Code Type
  1092. * }
  1093. LIBTAG_MACHINE = (LIBTAG_BASE+$3);
  1094. { *
  1095. * Library Base Size
  1096. * }
  1097. LIBTAG_BASESIZE = (LIBTAG_BASE+$4);
  1098. { *
  1099. * SegList Ptr
  1100. * }
  1101. LIBTAG_SEGLIST = (LIBTAG_BASE+$5);
  1102. { *
  1103. * Library Priority
  1104. * }
  1105. LIBTAG_PRI = (LIBTAG_BASE+$6);
  1106. { *
  1107. * Library Type..Library,Device,Resource,whatever
  1108. * }
  1109. LIBTAG_TYPE = (LIBTAG_BASE+$7);
  1110. { *
  1111. * Library Version
  1112. * (UWORD)
  1113. * }
  1114. LIBTAG_VERSION = (LIBTAG_BASE+$8);
  1115. { *
  1116. * Library Flags
  1117. * }
  1118. LIBTAG_FLAGS = (LIBTAG_BASE+$9);
  1119. { *
  1120. * Library Name
  1121. * }
  1122. LIBTAG_NAME = (LIBTAG_BASE+$a);
  1123. { *
  1124. * Library IDString
  1125. * }
  1126. LIBTAG_IDSTRING = (LIBTAG_BASE+$b);
  1127. { *
  1128. * AddDevice(),AddLibrary(),AddResource()..
  1129. * depends on LibNode.ln_Type field which
  1130. * can be set by some Init function, Struct Scripts
  1131. * or LIBTAG_TYPE.
  1132. * If you set LIBTAG_PUBLIC the library
  1133. * is added to the right system list.
  1134. * }
  1135. LIBTAG_PUBLIC = (LIBTAG_BASE+$c);
  1136. { *
  1137. * Library Revision
  1138. * (UWORD)
  1139. * }
  1140. LIBTAG_REVISION = (LIBTAG_BASE+$d);
  1141. { *
  1142. * Library QueryInfo Flag
  1143. * (Boolean)
  1144. * }
  1145. LIBTAG_QUERYINFO = (LIBTAG_BASE+$e);
  1146. { * Private
  1147. * don`t touch...floating design
  1148. * }
  1149. type
  1150. PFuncEntry = ^TFuncEntry;
  1151. TFuncEntry = packed record
  1152. EmulLibEntry : TEmulLibEntry;
  1153. OldFunction : Pointer; { * Needed for bookkeeping * }
  1154. end;
  1155. PFuncOldEntry = ^TFuncOldEntry;
  1156. TFuncOldEntry = packed record
  1157. Command : Word;
  1158. FuncEntry: PFuncEntry;
  1159. end;
  1160. { *
  1161. * EmulLibEntry.Extension
  1162. * }
  1163. const
  1164. FUNCENTRYEXTF_LIBRARY = $1; { * Entry created by the OS * }
  1165. { *
  1166. * Functionarray first ULONG ID defines the format
  1167. * of the functionarray for MakeFunctions()/MakeLibrary().
  1168. *
  1169. * If there`s not such id the functionarray is a
  1170. * 32Bit 68k function ptr array.
  1171. * (ULONG) $ffffffff stops it
  1172. * }
  1173. { * 68k 16bit relative functionarray ptrs
  1174. * (UWORD) $ffff stops it
  1175. * }
  1176. FUNCARRAY_16BIT_OLD = $ffffffff;
  1177. { * PPC 32bit functionarray ptrs
  1178. * (ULONG) $ffff stops it
  1179. * }
  1180. FUNCARRAY_32BIT_NATIVE = $fffefffe;
  1181. { * Starts a functionarray block.
  1182. * This way it`s possible to mix 68k and PPC
  1183. * function definitions.
  1184. * BASE:
  1185. * FUNCTIONARRAY_BEGIN
  1186. * FUNCARRAY_32BIT_NATIVE
  1187. * FUNC0
  1188. * FUNC1
  1189. * .
  1190. * FUNCn
  1191. * $ffffffff
  1192. * FUNCn+1 (No ID->32Bit 68k)
  1193. * FUNCn+2
  1194. * .
  1195. * FUNCm
  1196. * $ffffffff
  1197. * FUNCARRAY_16BIT_OLD
  1198. * FUNCm+1-BASE
  1199. * FUNCm+2-BASE
  1200. * .
  1201. * FUNCo-BASE
  1202. * $ffff
  1203. * FUNCTIONARRAY_END
  1204. * }
  1205. FUNCARRAY_BEGIN = $fffdfffd;
  1206. { * Ends a functionarray block.
  1207. * }
  1208. FUNCARRAY_END = $fffcfffc;
  1209. { * PPC 32bit Quick functionarray ptrs.
  1210. * These functions must comply to the emulation's
  1211. * register layout which is defined inside the
  1212. * emul/emulregs.h. That means the register layout
  1213. * MUST also be valid during interrupts/task switches.
  1214. * You can't just destroy A7(r31), SR or PC.
  1215. *
  1216. * You shouldn't use this for any normal code
  1217. * as there's no real reason to do so. If you
  1218. * really think you need to use it please ask
  1219. * us first on the dev mailinglist.
  1220. * (ULONG) $ffffffff stops it
  1221. * }
  1222. FUNCARRAY_32BIT_QUICK_NATIVE = $fffbfffb;
  1223. { * PPC 32bit QuickNR(No Result) functionarray ptrs
  1224. * (ULONG) $ffffffff stops it
  1225. * }
  1226. FUNCARRAY_32BIT_QUICKNR_NATIVE = $fffafffa;
  1227. { * PPC 32bit no result functionarray ptrs
  1228. * (ULONG) $ffffffff stops it
  1229. * }
  1230. FUNCARRAY_32BIT_NR_NATIVE = $fff9fff9;
  1231. { * PPC 32bit SR functionarray ptrs
  1232. * (ULONG) $ffffffff stops it
  1233. * }
  1234. FUNCARRAY_32BIT_SR_NATIVE = $fff8fff8;
  1235. { * PPC 32bit SR(no result) functionarray ptrs
  1236. * (ULONG) $ffffffff stops it
  1237. * }
  1238. FUNCARRAY_32BIT_SRNR_NATIVE = $fff7fff7;
  1239. { * PPC 32bit D0_D1 functionarray ptrs
  1240. * (ULONG) $ffffffff stops it
  1241. * }
  1242. FUNCARRAY_32BIT_D0D1_NATIVE = $fff6fff6;
  1243. { * PPC 32bit Restore1 functionarray ptrs
  1244. * (ULONG) $ffffffff stops it
  1245. * }
  1246. FUNCARRAY_32BIT_RESTORE_NATIVE = $fff5fff5;
  1247. { * PPC 32bit SystemV ABI entry
  1248. * these function entries DON'T comply
  1249. * to the amiga register modell REG_D0-A6
  1250. * but comply to the PPC SystemV ABI so
  1251. * you can directly use PPC C Argument
  1252. * parsing. That way you're also not limited
  1253. * with the register count.
  1254. * Such library functions can't be used
  1255. * by 68k emulation, so you can only use
  1256. * them for new code.
  1257. * As we allow these new functions to be
  1258. * used with old functions we keep the
  1259. * 6 bytes function entry steps in the library.
  1260. * Layout is
  1261. *
  1262. * CODE_JMP, &FuncEntry ; Old Entry
  1263. * CODE_ILLEGAL, Function ; SystemV ABI Entry
  1264. *
  1265. *
  1266. * (ULONG) $ffffffff stops it
  1267. * }
  1268. FUNCARRAY_32BIT_SYSTEMV = $fff4fff4;
  1269. { * PPC 32bit D0D1SR functionarray ptrs
  1270. * (ULONG) $ffffffff stops it
  1271. * }
  1272. FUNCARRAY_32BIT_D0D1SR_NATIVE = $fff3fff3;
  1273. { * PPC 32bit D0D1A0A1SR functionarray ptrs
  1274. * (ULONG) $ffffffff stops it
  1275. * }
  1276. FUNCARRAY_32BIT_D0D1A0A1SR_NATIVE = $fff2fff2;
  1277. { * exec device definitions (V50)
  1278. *********************************************************************
  1279. * }
  1280. type
  1281. PDevice = ^TDevice;
  1282. TDevice = packed record
  1283. dd_Library: TLibrary;
  1284. end;
  1285. type
  1286. PUnit = ^TUnit;
  1287. TUnit = packed record
  1288. unit_MsgPort: TMsgPort;
  1289. unit_flags : Byte;
  1290. unit_pad : Byte;
  1291. unit_OpenCnt: Word;
  1292. end;
  1293. const
  1294. UNITF_ACTIVE = (1 Shl 0);
  1295. UNITF_INTASK = (1 Shl 1);
  1296. { * exec io definitions (V50)
  1297. *********************************************************************
  1298. * }
  1299. type
  1300. PIORequest = ^TIORequest;
  1301. TIORequest = packed record
  1302. io_Message: TMessage;
  1303. io_Device : PDevice;
  1304. io_Unit : PUnit;
  1305. io_Command: Word;
  1306. io_Flags : Byte;
  1307. io_Error : ShortInt;
  1308. end;
  1309. type
  1310. PIOStdReq = ^TIOStdReq;
  1311. TIOStdReq = packed record
  1312. io_Message: TMessage;
  1313. io_Device : PDevice;
  1314. io_Unit : PUnit;
  1315. io_Command: Word;
  1316. io_Flags : Byte;
  1317. io_Error : ShortInt;
  1318. io_Actual : DWord;
  1319. io_Length : DWord;
  1320. io_Data : Pointer;
  1321. io_Offset : DWord;
  1322. end;
  1323. const
  1324. DEV_BEGINIO = -30;
  1325. DEV_ABORTIO = -36;
  1326. IOB_QUICK = 0;
  1327. IOF_QUICK = (1 Shl IOB_QUICK);
  1328. CMD_INVALID = 0;
  1329. CMD_RESET = 1;
  1330. CMD_READ = 2;
  1331. CMD_WRITE = 3;
  1332. CMD_UPDATE = 4;
  1333. CMD_CLEAR = 5;
  1334. CMD_STOP = 6;
  1335. CMD_START = 7;
  1336. CMD_FLUSH = 8;
  1337. CMD_NONSTD = 9;
  1338. { * exec include (V50)
  1339. *********************************************************************
  1340. * }
  1341. type
  1342. PExecBase = ^TExecBase;
  1343. TExecBase = packed record
  1344. LIbNode : TLibrary;
  1345. SoftVer : Word;
  1346. LowMemChkSum: SmallInt;
  1347. ChkBase : DWord;
  1348. ColdCapture : Pointer;
  1349. CoolCapture : Pointer;
  1350. WarmCapture : Pointer;
  1351. SysStkUpper : Pointer;
  1352. SysStkLower : Pointer;
  1353. MaxLocMem : DWord;
  1354. DebugEntry : Pointer;
  1355. DebugData : Pointer;
  1356. AlertData : Pointer;
  1357. MaxExtMem : Pointer;
  1358. ChkSum : Word;
  1359. IntVects : Array[0..15] Of TIntVector;
  1360. ThisTask : PTask;
  1361. IdleCount : DWord;
  1362. DispCount : DWord;
  1363. Quantum : Word;
  1364. Elapsed : Word;
  1365. SysFlags : Word;
  1366. IDNestCnt : ShortInt;
  1367. TDNestCnt : ShortInt;
  1368. AttnFlags : Word;
  1369. AttnResched : Word;
  1370. ResModules : Pointer;
  1371. TaskTrapCode : Pointer;
  1372. TaskExceptCode: Pointer;
  1373. TaskExitCode : Pointer;
  1374. TaskSigAlloc : DWord;
  1375. TaskTrapAlloc : Word;
  1376. MemList : TList;
  1377. ResourceList: TList;
  1378. DeviceList : TList;
  1379. IntrList : TList;
  1380. LibList : TList;
  1381. PortList : TList;
  1382. TaskReady : TList;
  1383. TaskWait : TList;
  1384. SoftInts : Array[0..5] Of TSoftIntList;
  1385. LastAlert : Array[0..3] Of LongInt;
  1386. VBlankFrequency : Byte;
  1387. PowerSupplyFrequency: Byte;
  1388. SemaphoreList : TList;
  1389. KickMemPtr : Pointer;
  1390. KickTagPtr : Pointer;
  1391. KickCheckSum : Pointer;
  1392. ex_Pad0 : Word;
  1393. ex_LaunchPoint : DWord;
  1394. ex_RamLibPrivate : Pointer;
  1395. ex_EClockFrequency : DWord;
  1396. ex_CacheControl : DWord;
  1397. ex_TaskID : DWord;
  1398. { * New ABox Emulation Entries
  1399. * }
  1400. ex_EmulHandleSize : DWord; { * PPC EmulHandleSize..*private* * }
  1401. ex_PPCTrapMsgPort : PMsgPort; { * PPC ABox Exception MsgPort..*private* * }
  1402. ex_Reserved1 : Array[0..2] Of DWord;
  1403. ex_MMULock : Pointer;
  1404. ex_PatchPool : Pointer; { * PatchPool Ptr needed by SetFunction..*private* * }
  1405. ex_PPCTaskExitCode : Pointer; { * PPC Task exit function * }
  1406. ex_DebugFlags : DWord; { * Exec Debug Flags..*private* * }
  1407. ex_MemHandlers : TMinList;
  1408. ex_MemHandler : Pointer;
  1409. end;
  1410. { *
  1411. * Outdated 68k cpu informations
  1412. *
  1413. * }
  1414. const
  1415. AFB_68010 = 0;
  1416. AFB_68020 = 1;
  1417. AFB_68030 = 2;
  1418. AFB_68040 = 3;
  1419. AFB_68881 = 4;
  1420. AFB_68882 = 5;
  1421. AFB_FPU40 = 6;
  1422. AFB_68060 = 7;
  1423. AFB_PRIVATE = 15;
  1424. AFF_68010 = (1 Shl AFB_68010);
  1425. AFF_68020 = (1 Shl AFB_68020);
  1426. AFF_68030 = (1 Shl AFB_68030);
  1427. AFF_68040 = (1 Shl AFB_68040);
  1428. AFF_68881 = (1 Shl AFB_68881);
  1429. AFF_68882 = (1 Shl AFB_68882);
  1430. AFF_FPU40 = (1 Shl AFB_FPU40);
  1431. AFF_68060 = (1 Shl AFB_68060);
  1432. AFF_PRIVATE = (1 Shl AFB_PRIVATE);
  1433. { *
  1434. * Outdated 68k cache functionality
  1435. * Mostly without function.
  1436. * }
  1437. const
  1438. CACRF_EnableI = (1 Shl 0);
  1439. CACRF_FreezeI = (1 Shl 1);
  1440. CACRF_ClearI = (1 Shl 3);
  1441. CACRF_IBE = (1 Shl 4);
  1442. CACRF_EnableD = (1 Shl 8);
  1443. CACRF_FreezeD = (1 Shl 9);
  1444. CACRF_ClearD = (1 Shl 11);
  1445. CACRF_DBE = (1 Shl 12);
  1446. CACRF_WriteAllocate = (1 Shl 13);
  1447. CACRF_EnableE = (1 Shl 30);
  1448. CACRF_CopyBack = (1 Shl 31);
  1449. DMA_Continue = (1 Shl 1);
  1450. DMA_NoModify = (1 Shl 2);
  1451. DMA_ReadFromRAM = (1 Shl 3);
  1452. SB_SAR = 15;
  1453. SB_TQE = 14;
  1454. SB_SINT = 13;
  1455. SF_SAR = (1 Shl SB_SAR);
  1456. SF_TQE = (1 Shl SB_TQE);
  1457. SF_SINT = (1 Shl SB_SINT);
  1458. { ****** Debug Flags...(don`t depend on them) ********** }
  1459. const
  1460. EXECDEBUGF_INITRESIDENT = $1;
  1461. EXECDEBUGF_INITCODE = $2;
  1462. EXECDEBUGF_FINDRESIDENT = $4;
  1463. EXECDEBUGF_CREATELIBRARY = $10;
  1464. EXECDEBUGF_SETFUNCTION = $20;
  1465. EXECDEBUGF_NEWSETFUNCTION = $40;
  1466. EXECDEBUGF_CHIPRAM = $80;
  1467. EXECDEBUGF_ADDTASK = $100;
  1468. EXECDEBUGF_REMTASK = $200;
  1469. EXECDEBUGF_GETTASKATTR = $400;
  1470. EXECDEBUGF_SETTASKATTR = $800;
  1471. EXECDEBUGF_EXCEPTHANDLER = $1000;
  1472. EXECDEBUGF_ADDDOSNODE = $2000;
  1473. EXECDEBUGF_PCI = $4000;
  1474. EXECDEBUGF_RAMLIB = $8000;
  1475. EXECDEBUGF_NOLOGSERVER = $10000;
  1476. EXECDEBUGF_NOLOGWINDOW = $20000;
  1477. { *
  1478. * "env:MorphOS/LogPath" contains the logfile path,
  1479. * If not specified it`s using "ram:.morphoslog"
  1480. * }
  1481. EXECDEBUGF_LOGFILE = $40000;
  1482. EXECDEBUGF_LOGKPRINTF = $80000;
  1483. { * Memory Tracking Flags
  1484. * }
  1485. EXECDEBUGF_PERMMEMTRACK = $100000;
  1486. EXECDEBUGF_MEMTRACK = $200000;
  1487. { * CyberGuardPPC Flags
  1488. * }
  1489. EXECDEBUGF_CYBERGUARDDEADLY = $400000;
  1490. { * PPCLib Flags
  1491. * }
  1492. EXECDEBUGF_LOADSEG = $01000000;
  1493. EXECDEBUGF_UNLOADSEG = $02000000;
  1494. EXECDEBUGF_PPCSTART = $04000000;
  1495. { * UserFlags
  1496. * }
  1497. { *
  1498. * Enables debug output for cybergraphx
  1499. * }
  1500. const
  1501. EXECDEBUGF_CGXDEBUG = $08000000;
  1502. { *
  1503. * Should be used to control user LibInit/DevInit Debug output
  1504. * }
  1505. EXECDEBUGF_INIT = $40000000;
  1506. { *
  1507. * Should be used to control logging
  1508. * }
  1509. EXECDEBUGF_LOG = $80000000;
  1510. { *
  1511. * Execbase list IDs
  1512. * }
  1513. EXECLIST_DEVICE = 0;
  1514. EXECLIST_INTERRUPT = 1;
  1515. EXECLIST_LIBRARY = 2;
  1516. EXECLIST_MEMHANDLER = 3;
  1517. EXECLIST_MEMHEADER = 4;
  1518. EXECLIST_PORT = 5;
  1519. EXECLIST_RESOURCE = 6;
  1520. EXECLIST_SEMAPHORE = 7;
  1521. EXECLIST_TASK = 8;
  1522. { *
  1523. * Execnotify hook message
  1524. * }
  1525. type
  1526. PExecNotifyMessage = ^TExecNotifyMessage;
  1527. TExecNotifyMessage = packed record
  1528. MType : DWord;
  1529. Flags : DWord;
  1530. Extra : DWord;
  1531. Extension: Pointer;
  1532. end;
  1533. const
  1534. EXECNOTIFYF_REMOVE = (1 Shl 0); { * if clear, is ADD * }
  1535. EXECNOTIFYF_POST = (1 Shl 1); { * if clear, is PRE * }
  1536. { *
  1537. * AddExecNodeTagList tags
  1538. * }
  1539. const
  1540. SAL_Dummy = (TAG_USER + 1000);
  1541. SAL_Type = (SAL_Dummy + 1);
  1542. SAL_Priority = (SAL_Dummy + 2);
  1543. SAL_Name = (SAL_Dummy + 3);
  1544. function Supervisor(userFunction: Pointer location 'a5'): Cardinal;
  1545. SysCall MOS_ExecBase 030;
  1546. procedure InitCode(startClass: Cardinal location 'd0';
  1547. version : Cardinal location 'd1');
  1548. SysCall MOS_ExecBase 072;
  1549. procedure InitStruct(initTable: Pointer location 'a1';
  1550. memory : Pointer location 'a2';
  1551. size : Cardinal location 'd0');
  1552. SysCall MOS_ExecBase 078;
  1553. function MakeLibrary(funcInit : Pointer location 'a0';
  1554. structInit: Pointer location 'a1';
  1555. libInit : Pointer location 'a2';
  1556. dataSize : Cardinal location 'd0';
  1557. segList : Cardinal location 'd1'): PLibrary;
  1558. SysCall MOS_ExecBase 084;
  1559. procedure MakeFunctions(target : Pointer location 'a0';
  1560. functionArray: Pointer location 'a1';
  1561. funcDispBase : Pointer location 'a2');
  1562. SysCall MOS_ExecBase 090;
  1563. function FindResident(name: PChar location 'a1'): PResident;
  1564. SysCall MOS_ExecBase 096;
  1565. function InitResident(resident: PResident location 'a1';
  1566. segList : Cardinal location 'd1'): Pointer;
  1567. SysCall MOS_ExecBase 102;
  1568. procedure Alert(alertNum: Cardinal location 'd7');
  1569. SysCall MOS_ExecBase 108;
  1570. procedure Debug(flags: Cardinal location 'd0');
  1571. SysCall MOS_ExecBase 114;
  1572. procedure Disable;
  1573. SysCall MOS_ExecBase 120;
  1574. procedure Enable;
  1575. SysCall MOS_ExecBase 126;
  1576. procedure Forbid;
  1577. SysCall MOS_ExecBase 132;
  1578. procedure Permit;
  1579. SysCall MOS_ExecBase 138;
  1580. function SetSR(newSR: Cardinal location 'd0';
  1581. mask : Cardinal location 'd1'): Cardinal;
  1582. SysCall MOS_ExecBase 144;
  1583. function SuperState : Pointer;
  1584. SysCall MOS_ExecBase 150;
  1585. procedure UserState(sysStack: Pointer location 'd0');
  1586. SysCall MOS_ExecBase 156;
  1587. function SetIntVector(intNumber: LongInt location 'd0';
  1588. interrupt: PInterrupt location 'a1'): PInterrupt;
  1589. SysCall MOS_ExecBase 162;
  1590. procedure AddIntServer(intNumber: LongInt location 'd0';
  1591. interrupt: PInterrupt location 'a1');
  1592. SysCall MOS_ExecBase 168;
  1593. procedure RemIntServer(intNumber: LongInt location 'd0';
  1594. interrupt: PInterrupt location 'a1');
  1595. SysCall MOS_ExecBase 174;
  1596. procedure Cause(interrupt: PInterrupt location 'a1');
  1597. SysCall MOS_ExecBase 180;
  1598. function Allocate(freeList: PMemHeader location 'a0';
  1599. byteSize: Cardinal location 'd0'): Pointer;
  1600. SysCall MOS_ExecBase 186;
  1601. procedure Deallocate(freeList : PMemHeader location 'a0';
  1602. memoryBlock: Pointer location 'a1';
  1603. byteSize : Cardinal location 'd0');
  1604. SysCall MOS_ExecBase 192;
  1605. { * Name changed to avoid conflict with heap manager... * }
  1606. function execAllocMem(byteSize : Cardinal location 'd0';
  1607. requirements: Cardinal location 'd1'): Pointer;
  1608. SysCall MOS_ExecBase 198;
  1609. function AllocAbs(byteSize: Cardinal location 'd0';
  1610. location: Pointer location 'a1'): Pointer;
  1611. SysCall MOS_ExecBase 204;
  1612. { * Name changed to avoid conflict with heap manager... * }
  1613. procedure execFreeMem(memoryBlock: Pointer location 'a1';
  1614. byteSize : Cardinal location 'd0');
  1615. SysCall MOS_ExecBase 210;
  1616. function AvailMem(requirements: Cardinal location 'd1'): Cardinal;
  1617. SysCall MOS_ExecBase 216;
  1618. function AllocEntry(entry: PMemList location 'a0'): PMemList;
  1619. SysCall MOS_ExecBase 222;
  1620. procedure FreeEntry(entry: PMemList location 'a0');
  1621. SysCall MOS_ExecBase 228;
  1622. { * Name changed to avoid conflict with other System unit call... * }
  1623. procedure execInsert(list: PList location 'a0';
  1624. node: PNode location 'a1';
  1625. pred: PNode location 'a2');
  1626. SysCall MOS_ExecBase 234;
  1627. procedure AddHead(list: PList location 'a0';
  1628. node: PNode location 'a1');
  1629. SysCall MOS_ExecBase 240;
  1630. procedure AddTail(list: PList location 'a0';
  1631. node: PNode location 'a1');
  1632. SysCall MOS_ExecBase 246;
  1633. procedure Remove(node: PNode location 'a1');
  1634. SysCall MOS_ExecBase 252;
  1635. function RemHead(list: PList location 'a0'): PNode;
  1636. SysCall MOS_ExecBase 258;
  1637. function RemTail(list: PList location 'a0'): PNode;
  1638. SysCall MOS_ExecBase 264;
  1639. procedure Enqueue(list: PList location 'a0';
  1640. node: PNode location 'a1');
  1641. SysCall MOS_ExecBase 270;
  1642. function FindName(list: PList location 'a0';
  1643. name: PChar location 'a1'): PNode;
  1644. SysCall MOS_ExecBase 276;
  1645. function AddTask(task : PTask location 'a1';
  1646. initPC : Pointer location 'a2';
  1647. finalPC: Pointer location 'a3'): Pointer;
  1648. SysCall MOS_ExecBase 282;
  1649. procedure RemTask(task: PTask location 'a1');
  1650. SysCall MOS_ExecBase 288;
  1651. function FindTask(name: PChar location 'a1'): PTask;
  1652. SysCall MOS_ExecBase 294;
  1653. function SetTaskPri(task : PTask location 'a1';
  1654. priority: LongInt location 'd0'): ShortInt;
  1655. SysCall MOS_ExecBase 300;
  1656. function SetSignal(newSignals: Cardinal location 'd0';
  1657. signalSet : Cardinal location 'd1'): Cardinal;
  1658. SysCall MOS_ExecBase 306;
  1659. function SetExcept(newSignals: Cardinal location 'd0';
  1660. signalSet : Cardinal location 'd1'): Cardinal;
  1661. SysCall MOS_ExecBase 312;
  1662. function Wait(signalSet: Cardinal location 'd0'): Cardinal;
  1663. SysCall MOS_ExecBase 318;
  1664. procedure Signal(task : PTask location 'a1';
  1665. signalSet: Cardinal location 'd0');
  1666. SysCall MOS_ExecBase 324;
  1667. function AllocSignal(signalNum: LongInt location 'd0'): ShortInt;
  1668. SysCall MOS_ExecBase 330;
  1669. procedure FreeSignal(signalNum: LongInt location 'd0');
  1670. SysCall MOS_ExecBase 336;
  1671. function AllocTrap(trapNum: LongInt location 'd0'): LongInt;
  1672. SysCall MOS_ExecBase 342;
  1673. procedure FreeTrap(trapNum: LongInt location 'd0');
  1674. SysCall MOS_ExecBase 348;
  1675. procedure AddPort(port: PMsgPort location 'a1');
  1676. SysCall MOS_ExecBase 354;
  1677. procedure RemPort(port: PMsgPort location 'a1');
  1678. SysCall MOS_ExecBase 360;
  1679. procedure PutMsg(port : PMsgPort location 'a0';
  1680. message: PMessage location 'a1');
  1681. SysCall MOS_ExecBase 366;
  1682. function GetMsg(port: PMsgPort location 'a0'): PMessage;
  1683. SysCall MOS_ExecBase 372;
  1684. procedure ReplyMsg(message : PMessage location 'a1');
  1685. SysCall MOS_ExecBase 378;
  1686. function WaitPort(port: PMsgPort location 'a0'): PMessage;
  1687. SysCall MOS_ExecBase 384;
  1688. function FindPort(name: PChar location 'a1'): PMsgPort;
  1689. SysCall MOS_ExecBase 390;
  1690. procedure AddLibrary(libHandle: PLibrary location 'a1');
  1691. SysCall MOS_ExecBase 396;
  1692. procedure RemLibrary(libHandle: PLibrary location 'a1');
  1693. SysCall MOS_ExecBase 402;
  1694. function OldOpenLibrary(libName: PChar location 'a1'): PLibrary;
  1695. SysCall MOS_ExecBase 408;
  1696. procedure CloseLibrary(libHandle: PLibrary location 'a1');
  1697. SysCall MOS_ExecBase 414;
  1698. function SetFunction(libHandle : PLibrary location 'a1';
  1699. funcOffset : LongInt location 'a0';
  1700. newFunction: Pointer location 'd0'): Pointer;
  1701. SysCall MOS_ExecBase 420;
  1702. procedure SumLibrary(libHandle: PLibrary location 'a1');
  1703. SysCall MOS_ExecBase 426;
  1704. procedure AddDevice(device: PDevice location 'a1');
  1705. SysCall MOS_ExecBase 432;
  1706. procedure RemDevice(device: PDevice location 'a1');
  1707. SysCall MOS_ExecBase 438;
  1708. function OpenDevice(devName : PChar location 'a0';
  1709. numunit : Cardinal location 'd0';
  1710. ioRequest: pIORequest location 'a1';
  1711. flags : Cardinal location 'd1'): ShortInt;
  1712. SysCall MOS_ExecBase 444;
  1713. procedure CloseDevice(ioRequest: PIORequest location 'a1');
  1714. SysCall MOS_ExecBase 450;
  1715. function DoIO(ioRequest: PIORequest location 'a1'): ShortInt;
  1716. SysCall MOS_ExecBase 456;
  1717. procedure SendIO(ioRequest: PIORequest location 'a1');
  1718. SysCall MOS_ExecBase 462;
  1719. function CheckIO(ioRequest: PIORequest location 'a1'): PIORequest;
  1720. SysCall MOS_ExecBase 468;
  1721. function WaitIO(ioRequest: PIORequest location 'a1'): ShortInt;
  1722. SysCall MOS_ExecBase 474;
  1723. procedure AbortIO(ioRequest: PIORequest location 'a1');
  1724. SysCall MOS_ExecBase 480;
  1725. procedure AddResource(resource: Pointer location 'a1');
  1726. SysCall MOS_ExecBase 486;
  1727. procedure RemResource(resource: Pointer location 'a1');
  1728. SysCall MOS_ExecBase 492;
  1729. function OpenResource(resName: PChar location 'a1'): Pointer;
  1730. SysCall MOS_ExecBase 498;
  1731. procedure RawIOInit;
  1732. SysCall MOS_ExecBase 504;
  1733. function RawMayGetChar: Char;
  1734. SysCall MOS_ExecBase 510;
  1735. procedure RawPutChar(d0arg: Char location 'd0');
  1736. SysCall MOS_ExecBase 516;
  1737. function RawDoFmt(formatString: PChar location 'a0';
  1738. dataStream : Pointer location 'a1';
  1739. putChProc : Pointer location 'a2';
  1740. putChData : Pointer location 'a3'): Pointer;
  1741. SysCall MOS_ExecBase 522;
  1742. function GetCC: Cardinal;
  1743. SysCall MOS_ExecBase 528;
  1744. function TypeOfMem(address: Pointer location 'a1'): Cardinal;
  1745. SysCall MOS_ExecBase 534;
  1746. function Procure(sigSem: PSignalSemaphore location 'a0';
  1747. bidMsg: PSemaphoreMessage location 'a1'): Cardinal;
  1748. SysCall MOS_ExecBase 540;
  1749. procedure Vacate(sigSem: PSignalSemaphore location 'a0';
  1750. bidMsg: PSemaphoreMessage location 'a1');
  1751. SysCall MOS_ExecBase 546;
  1752. function OpenLibrary(libname: PChar location 'a1';
  1753. libver : Cardinal location 'd0'): Pointer;
  1754. SysCall MOS_ExecBase 552;
  1755. procedure InitSemaphore(sigSem: PSignalSemaphore location 'a0');
  1756. SysCall MOS_ExecBase 558;
  1757. procedure ObtainSemaphore(sigSem: PSignalSemaphore location 'a0');
  1758. SysCall MOS_ExecBase 564;
  1759. procedure ReleaseSemaphore(sigSem: PSignalSemaphore location 'a0');
  1760. SysCall MOS_ExecBase 570;
  1761. function AttemptSemaphore(sigSem: PSignalSemaphore location 'a0'): Cardinal;
  1762. SysCall MOS_ExecBase 576;
  1763. procedure ObtainSemaphoreList(sigSem: PList location 'a0');
  1764. SysCall MOS_ExecBase 582;
  1765. procedure ReleaseSemaphoreList(sigSem: PList location 'a0');
  1766. SysCall MOS_ExecBase 588;
  1767. function FindSemaphore(sigSem: PChar location 'a1'): PSignalSemaphore;
  1768. SysCall MOS_ExecBase 594;
  1769. procedure AddSemaphore(sigSem: PSignalSemaphore location 'a1');
  1770. SysCall MOS_ExecBase 600;
  1771. procedure RemSemaphore(sigSem: PSignalSemaphore location 'a1');
  1772. SysCall MOS_ExecBase 606;
  1773. function SumKickData: Cardinal;
  1774. SysCall MOS_ExecBase 612;
  1775. procedure AddMemList(size : Cardinal location 'd0';
  1776. attributes: Cardinal location 'd1';
  1777. pri : LongInt location 'd2';
  1778. base : Pointer location 'a0';
  1779. name : PChar location 'a1');
  1780. SysCall MOS_ExecBase 618;
  1781. procedure CopyMem(source: Pointer location 'a0';
  1782. dest : Pointer location 'a1';
  1783. size : Cardinal location 'd0');
  1784. SysCall MOS_ExecBase 624;
  1785. procedure CopyMemQuick(source: Pointer location 'a0';
  1786. dest : Pointer location 'a1';
  1787. size : Cardinal location 'd0');
  1788. SysCall MOS_ExecBase 630;
  1789. procedure CacheClearU;
  1790. SysCall MOS_ExecBase 636;
  1791. procedure CacheClearE(address: Pointer location 'a0';
  1792. length : Cardinal location 'd0';
  1793. caches : Cardinal location 'd1');
  1794. SysCall MOS_ExecBase 642;
  1795. function CacheControl(cacheBits: Cardinal location 'd0';
  1796. cacheMask: Cardinal location 'd1'): Cardinal;
  1797. SysCall MOS_ExecBase 648;
  1798. function CreateIORequest(port: PMsgPort location 'a0';
  1799. size: Cardinal location 'd0'): Pointer;
  1800. SysCall MOS_ExecBase 654;
  1801. procedure DeleteIORequest(iorequest: Pointer location 'a0');
  1802. SysCall MOS_ExecBase 660;
  1803. function CreateMsgPort: PMsgPort;
  1804. SysCall MOS_ExecBase 666;
  1805. procedure DeleteMsgPort(port: PMsgPort location 'a0');
  1806. SysCall MOS_ExecBase 672;
  1807. procedure ObtainSemaphoreShared(sigSem: PSignalSemaphore location 'a0');
  1808. SysCall MOS_ExecBase 678;
  1809. function AllocVec(byteSize : Cardinal location 'd0';
  1810. requirements: Cardinal location 'd1'): Pointer;
  1811. SysCall MOS_ExecBase 684;
  1812. procedure FreeVec(memoryBlock: Pointer location 'a1');
  1813. SysCall MOS_ExecBase 690;
  1814. function CreatePool(requirements: Cardinal location 'd0';
  1815. puddleSize : Cardinal location 'd1';
  1816. threshSize : Cardinal location 'd2'): Pointer;
  1817. SysCall MOS_ExecBase 696;
  1818. procedure DeletePool(poolHeader: Pointer location 'a0');
  1819. SysCall MOS_ExecBase 702;
  1820. function AllocPooled(poolHeader: Pointer location 'a0';
  1821. memSize : Cardinal location 'd0'): Pointer;
  1822. SysCall MOS_ExecBase 708;
  1823. function FreePooled(poolHeader: Pointer location 'a0';
  1824. memory : Pointer location 'a1';
  1825. memSize : Cardinal location 'd0'): Pointer;
  1826. SysCall MOS_ExecBase 714;
  1827. function AttemptSemaphoreShared(sigSem: pSignalSemaphore location 'a0'): Cardinal;
  1828. SysCall MOS_ExecBase 720;
  1829. procedure ColdReboot;
  1830. SysCall MOS_ExecBase 726;
  1831. procedure StackSwap(newStack: PStackSwapStruct location 'a0');
  1832. SysCall MOS_ExecBase 732;
  1833. function NewGetTaskAttrsA(Task : PTask location 'a0';
  1834. Data : Pointer location 'a1';
  1835. DataSize: Cardinal location 'd0';
  1836. TType : Cardinal location 'd1';
  1837. Tags : PTagItem location 'a2'): Cardinal;
  1838. SysCall MOS_ExecBase 738;
  1839. function NewSetTaskAttrsA(Task : PTask location 'a0';
  1840. Data : Pointer location 'a1';
  1841. DataSize: Cardinal location 'd0';
  1842. TType : Cardinal location 'd1';
  1843. Tags : PTagItem location 'a2'): Cardinal;
  1844. SysCall MOS_ExecBase 744;
  1845. function CachePreDMA(address : Pointer location 'a0';
  1846. var length: Cardinal location 'a1';
  1847. flags : Cardinal location 'd0'): Pointer;
  1848. SysCall MOS_ExecBase 762;
  1849. procedure CachePostDMA(address : Pointer location 'a0';
  1850. var length: Cardinal location 'a1';
  1851. flags : Cardinal location 'd0');
  1852. SysCall MOS_ExecBase 768;
  1853. procedure AddMemHandler(memhand: PInterrupt location 'a1');
  1854. SysCall MOS_ExecBase 774;
  1855. procedure RemMemHandler(memhand: PInterrupt location 'a1');
  1856. SysCall MOS_ExecBase 780;
  1857. function ObtainQuickVector(interruptCode: Pointer location 'a0'): Cardinal;
  1858. SysCall MOS_ExecBase 786;
  1859. function NewSetFunction(libHandle : PLibrary location 'a0';
  1860. newfunction: Pointer location 'a1';
  1861. offset : LongInt location 'd0';
  1862. tags : PTagItem location 'a2'): Pointer;
  1863. SysCall MOS_ExecBase 792;
  1864. function NewCreateLibrary(tags: PTagItem location 'a0'): PLibrary;
  1865. SysCall MOS_ExecBase 798;
  1866. function NewPPCStackSwap(newStack : PStackSwapStruct location 'a0';
  1867. sfunction: Pointer location 'a1';
  1868. args : PPPCStackSwapArgs location 'a2'): Cardinal;
  1869. SysCall MOS_ExecBase 804;
  1870. function TaggedOpenLibrary(d0arg: LongInt location 'd0'): Pointer;
  1871. SysCall MOS_ExecBase 810;
  1872. function ReadGayle: Cardinal;
  1873. SysCall MOS_ExecBase 816;
  1874. function VNewRawDoFmt(FmtString: PChar;
  1875. PutChProc: Pointer;
  1876. PutChData: PChar;
  1877. args : PChar): PChar;
  1878. SysCall BaseSysV MOS_ExecBase 822;
  1879. procedure CacheFlushDataArea(Address: Pointer location 'a0';
  1880. Size : Cardinal location 'd0');
  1881. SysCall MOS_ExecBase 828;
  1882. procedure CacheInvalidInstArea(Address: Pointer location 'a0';
  1883. Size : Cardinal location 'd0');
  1884. SysCall MOS_ExecBase 834;
  1885. procedure CacheInvalidDataArea(Address: Pointer location 'a0';
  1886. Size : Cardinal location 'd0');
  1887. SysCall MOS_ExecBase 840;
  1888. procedure CacheFlushDataInstArea(Address: Pointer location 'a0';
  1889. Size : Cardinal location 'd0');
  1890. SysCall MOS_ExecBase 846;
  1891. procedure CacheTrashCacheArea(Address: Pointer location 'a0';
  1892. Size : Cardinal location 'd0');
  1893. SysCall MOS_ExecBase 852;
  1894. function AllocTaskPooled(Size: Cardinal location 'd0'): Pointer;
  1895. SysCall MOS_ExecBase 858;
  1896. procedure FreeTaskPooled(Address: Pointer location 'a1';
  1897. Size : Cardinal location 'd0');
  1898. SysCall MOS_ExecBase 864;
  1899. function AllocVecTaskPooled(Size: Cardinal location 'd0'): Pointer;
  1900. SysCall MOS_ExecBase 870;
  1901. procedure FreeVecTaskPooled(Address: Pointer location 'a1');
  1902. SysCall MOS_ExecBase 876;
  1903. procedure FlushPool(poolHeader: Pointer location 'a0');
  1904. SysCall MOS_ExecBase 882;
  1905. procedure FlushTaskPool;
  1906. SysCall MOS_ExecBase 888;
  1907. function AllocVecPooled(poolHeader: Pointer location 'a0';
  1908. memSize : Cardinal location 'd0'): Pointer;
  1909. SysCall MOS_ExecBase 894;
  1910. function NewGetSystemAttrsA(Data : Pointer location 'a0';
  1911. DataSize: Cardinal location 'd0';
  1912. TType : Cardinal location 'd1';
  1913. Tags : PTagItem location 'a1'): Cardinal;
  1914. SysCall MOS_ExecBase 906;
  1915. function NewSetSystemAttrsA(Data : Pointer location 'a0';
  1916. DataSize: Cardinal location 'd0';
  1917. TType : Cardinal location 'd1';
  1918. Tags : PTagItem location 'a1'): Cardinal;
  1919. SysCall MOS_ExecBase 912;
  1920. function NewCreateTaskA(Tags: PTagItem location 'a0'): PTask;
  1921. SysCall MOS_ExecBase 918;
  1922. function AllocateAligned(memHeader : pMemHeader;
  1923. byteSize : Cardinal;
  1924. alignSize : Cardinal;
  1925. alignOffset: Cardinal): Pointer;
  1926. SysCall BaseSysV MOS_ExecBase 930;
  1927. function AllocMemAligned(byteSize : Cardinal;
  1928. attributes : Cardinal;
  1929. alignSize : Cardinal;
  1930. alignOffset: Cardinal): Pointer;
  1931. SysCall BaseSysV MOS_ExecBase 936;
  1932. function AllocVecAligned(byteSize : Cardinal;
  1933. attributes : Cardinal;
  1934. alignSize : Cardinal;
  1935. alignOffset: Cardinal): Pointer;
  1936. SysCall BaseSysV MOS_ExecBase 942;
  1937. procedure AddExecNotify(hook: PHook);
  1938. SysCall BaseSysV MOS_ExecBase 948;
  1939. procedure RemExecNotify(hook: PHook);
  1940. SysCall BaseSysV MOS_ExecBase 954;
  1941. function FindExecNode(ttype: Cardinal location 'd0';
  1942. name : PChar location 'a0'): PNode;
  1943. SysCall MOS_ExecBase 960;
  1944. function AddExecNodeA(innode : Pointer location 'a0';
  1945. TagItems: PTagItem location 'a1'): Pointer;
  1946. SysCall MOS_ExecBase 966;
  1947. function AllocVecDMA(byteSize : Cardinal location 'd0';
  1948. requirements: Cardinal location 'd1'): Pointer;
  1949. SysCall MOS_ExecBase 972;
  1950. procedure FreeVecDMA(memoryBlock: Pointer location 'a1');
  1951. SysCall MOS_ExecBase 978;
  1952. function AllocPooledAligned(poolHeader : Pointer;
  1953. byteSize : Cardinal;
  1954. alignSize : Cardinal;
  1955. alignOffset: Cardinal): Pointer;
  1956. SysCall BaseSysV MOS_ExecBase 984;
  1957. function AddResident(resident: pResident location 'd0'): LongInt;
  1958. SysCall BaseSysV MOS_ExecBase 990;
  1959. function FindTaskByPID(processID: Cardinal): PTask;
  1960. SysCall BaseSysV MOS_ExecBase 996;
  1961. function NewGetTaskAttrs(Task : PTask;
  1962. Data : Pointer;
  1963. DataSize: Cardinal;
  1964. TType : Cardinal;
  1965. Tags : array of DWord): Cardinal; Inline;
  1966. implementation
  1967. function NewGetTaskAttrs(Task : PTask;
  1968. Data : Pointer;
  1969. DataSize: Cardinal;
  1970. TType : Cardinal;
  1971. Tags : array of DWord): Cardinal; Inline;
  1972. begin
  1973. NewGetTaskAttrs:=NewGetTaskAttrsA(Task,Data,DataSize,TType,@Tags);
  1974. end;
  1975. function GetEmulHandle: PEmulHandle; assembler; nostackframe;
  1976. asm
  1977. mr r3,r2
  1978. end;
  1979. function REG_D0: DWord; assembler; nostackframe;
  1980. asm
  1981. lwz r3,0(r2)
  1982. end;
  1983. function REG_D1: DWord; assembler; nostackframe;
  1984. asm
  1985. lwz r3,4(r2)
  1986. end;
  1987. function REG_D2: DWord; assembler; nostackframe;
  1988. asm
  1989. lwz r3,8(r2)
  1990. end;
  1991. function REG_D3: DWord; assembler; nostackframe;
  1992. asm
  1993. lwz r3,12(r2)
  1994. end;
  1995. function REG_D4: DWord; assembler; nostackframe;
  1996. asm
  1997. lwz r3,16(r2)
  1998. end;
  1999. function REG_D5: DWord; assembler; nostackframe;
  2000. asm
  2001. lwz r3,20(r2)
  2002. end;
  2003. function REG_D6: DWord; assembler; nostackframe;
  2004. asm
  2005. lwz r3,24(r2)
  2006. end;
  2007. function REG_D7: DWord; assembler; nostackframe;
  2008. asm
  2009. lwz r3,28(r2)
  2010. end;
  2011. function REG_A0: Pointer; assembler; nostackframe;
  2012. asm
  2013. lwz r3,32(r2)
  2014. end;
  2015. function REG_A1: Pointer; assembler; nostackframe;
  2016. asm
  2017. lwz r3,36(r2)
  2018. end;
  2019. function REG_A2: Pointer; assembler; nostackframe;
  2020. asm
  2021. lwz r3,40(r2)
  2022. end;
  2023. function REG_A3: Pointer; assembler; nostackframe;
  2024. asm
  2025. lwz r3,44(r2)
  2026. end;
  2027. function REG_A4: Pointer; assembler; nostackframe;
  2028. asm
  2029. lwz r3,48(r2)
  2030. end;
  2031. function REG_A5: Pointer; assembler; nostackframe;
  2032. asm
  2033. lwz r3,52(r2)
  2034. end;
  2035. function REG_A6: Pointer; assembler; nostackframe;
  2036. asm
  2037. lwz r3,56(r2)
  2038. end;
  2039. function REG_A7: Pointer; assembler; nostackframe;
  2040. asm
  2041. lwz r3,60(r2)
  2042. end;
  2043. function REG_PC: Pointer; assembler; nostackframe;
  2044. asm
  2045. lwz r3,64(r2)
  2046. end;
  2047. function REG_SR: DWord; assembler; nostackframe;
  2048. asm
  2049. lwz r3,68(r2)
  2050. end;
  2051. begin
  2052. ExecBase:=MOS_ExecBase;
  2053. end.