|##########| |#MAGIC #|CLABLILL |#PROJECT #|"IMPORTMath" |#PATHS #|"StdProject" |#FLAGS #|xx-x-x-xx-x-x-x----------------- |#USERSW #|-------------------------------- |#USERMASK#|x------------------------------- |#SWITCHES#|xx----xxxx-xx--- |##########| DEFINITION MODULE Exec; | WARNING | | autodocs and fdfiles sometimes differ. search for "WARNING" | |========================================================================= | | Produkt : Cluster | Projekt : Version 2.0 | Paket : Amiga Bibliotheken V2.04 | Komponente : Exec | Baustein : Definitionsmodul | | Datum Version Autor Kommentar | ------------ ------- ----- ------------------------------------------------ | 7 Jul 1992 01:13 WB rem Resources.def from Exec for the hierarchy | 1 Jul 1992 01:12 WB cleaning up etc. 11:07:59 AM | 18 Feb 1992 01:11 WB added new functions Cache(Pre|Post)DMA | 27 Jan 1992 01:10 WB start to change interface to pointers for OO | compatibility. added StackSwap*, changed | variablenames to lowercase. | 17 Nov 1991 01:09 added ConstGrp | 16 Nov 1991 01:08 WB completed *Res Handles, FuncGrp, | PtrGrp and RecordGrp for T_Exec | 11 Nov 1991 01:07 WB added IntFunc support | 8 Nov 1991 01:06 WB added support for Resource tracking | 1 Oct 1991 01:05 WB problem with NodeType fixed. | 19 Sep 1991 01:04 WB last check | 30 Aug 1991 01:00 WB filecreation |========================================================================= | $Header: O:usr/Cluster/Modules/Port2.0/txt/RCS/Exec.def,v 1.4 91/09/20 | 20:25:52 baron Exp Locker: baron $ | Groups in this module ( in this order ): | | Const, Node, List, Int, Mem, Task, | MsgPort, oldMsgPort, Lib, DeviceIO, Semaphore, Resident, | ExecBase, Special, Signal, Trap, Resource, Kick, | Private, Cache, Child, Func, Ptr, Record | | No structures are based on ResHandles due to multiple inheritance. Look | in T_Exec for ResHandles. | | MinNode, MinList, List, IntVector, MemChunk, MemEntry, Resident | (* $A- *) FROM System IMPORT (* T *) BITSET, BPTR, LONGSET, PROC, Regs, SysStringPtr; FROM Hardware IMPORT (* T *) CustomPtr, IntFlags, IntFlagSet (*,LIntFlags *); | | sometimes you need ... | TYPE LONGPTR = POINTER TO LONGINT; | | ExecBase forward for Library calls ( found in ExecBaseGrp ) | TYPE ExecBasePtr = POINTER TO ExecBaseType; VAR ExecBase : ExecBasePtr; |------------------------------------------------------------------------- | types |------------------------------------------------------------------------- | most of CBM types are superfluous, as Cluster has its own definitions | This group is not included in All, as the members are not very important. CONST includeVersion = 36; | version of the includes used. byteMask = 255; | For the fumblers. libraryMinimum = 33; | Lowest version supported by Commodore-Amiga. GROUP ConstGrp = includeVersion, byteMask, libraryMinimum; |------------------------------------------------------------------------- | nodes |------------------------------------------------------------------------- TYPE | User node types work down from "user" NodeType = ( unknown, task, interrupt, device, msgPort, message, freeMsg, replyMsg, resoucre, library, memory, softInt, font, process, semaphore, signalSem, bootNode, (* v36 *) kickMem, graphics, deathMessage, user = 254, extended ); NodePri = [-128..127]; | SHORTINT; MinNodePtr = POINTER TO MinNode; MinNode = RECORD | 8 Bytes succ, pred : SAMEPTR; END; NodePtr = POINTER TO Node; Node = RECORD OF MinNode | 14 Bytes type : NodeType; pri : NodePri; name : SysStringPtr; END; GROUP NodeGrp = (* I *) SysStringPtr, (* T *) MinNode, MinNodePtr, Node, NodePtr, NodeType; |------------------------------------------------------------------------- | lists |------------------------------------------------------------------------- TYPE MinListPtr = POINTER TO MinList; MinList = RECORD | 12 Bytes head, tail, tailPred : MinNodePtr END; ListPtr = POINTER TO List; List = RECORD | 14 Bytes head, tail, tailPred : NodePtr; type : NodeType; pad : SHORTCARD END; | | As List cannot be made a successor of MinList, we have to define seperate | functions for listfunctions, which can be used both for Nodes/Lists and | MinNodes/MinLists. The Min* variant will have an 'M' before the object. | LIBRARY ExecBase BY -240 PROCEDURE AddHead( list IN A0 : ListPtr; node IN A1 : NodePtr ); LIBRARY ExecBase BY -240 PROCEDURE AddMHead( minList IN A0 : MinListPtr; minNode IN A1 : MinNodePtr ); LIBRARY ExecBase BY -246 PROCEDURE AddTail( list IN A0 : ListPtr; node IN A1 : NodePtr ); LIBRARY ExecBase BY -246 PROCEDURE AddMTail( minList IN A0 : MinListPtr; minNode IN A1 : MinNodePtr ); | initialize a piece of memory pointed to by "list" to be an empty list. PROCEDURE NewList( VAR list : List; type : NodeType ); PROCEDURE NewMList( VAR minList : MinList ); | no MinNodes allowed. LIBRARY ExecBase BY -270 PROCEDURE Enqueue( list IN A0 : ListPtr; node IN A1 : NodePtr ); LIBRARY ExecBase BY -276 PROCEDURE FindName( list IN A0 : ListPtr; name IN A1 : SysStringPtr ): NodePtr; LIBRARY ExecBase BY -234 PROCEDURE Insert( list IN A0 : ListPtr; node IN A1, listNode IN A2 : NodePtr ); LIBRARY ExecBase BY -234 PROCEDURE MInsert( minList IN A0 : MinListPtr; minNode IN A1, minListNode IN A2 : MinNodePtr ); LIBRARY ExecBase BY -258 PROCEDURE RemHead( list IN A0 : ListPtr ): NodePtr; LIBRARY ExecBase BY -258 PROCEDURE RemMHead( minList IN A0 : MinListPtr ): MinNodePtr; | works for Nodes just as well LIBRARY ExecBase BY -252 PROCEDURE Remove( minNode IN A1 : MinNodePtr ); LIBRARY ExecBase BY -264 PROCEDURE RemTail( list IN A0 : ListPtr ): NodePtr; LIBRARY ExecBase BY -264 PROCEDURE RemMTail( minList IN A0 : MinListPtr ): MinNodePtr; GROUP ListGrp = (* I *) NodeGrp, (* T *) List, ListPtr, MinList, MinListPtr, (* P *) AddHead, AddTail, NewList, Enqueue, FindName, Insert, RemHead, Remove, RemTail; |------------------------------------------------------------------------- | interrupts |------------------------------------------------------------------------- TYPE InterruptPtr = POINTER TO Interrupt; | Functions which can be used as interupt code. IntFuncPtr = POINTER TO IntFunc; IntFunc = PROCEDURE( data IN A1 : ANYPTR; | Interrupt.data custom IN A0 : CustomPtr; int IN D1 : IntFlagSet; | intenar AND | intreqr mycode IN A5 : IntFuncPtr; exec IN A6 : ExecBasePtr ) : LONGINT; Interrupt = RECORD OF Node | 22 Bytes data : ANYPTR; code : PROC; | IntFunc END; | For ExecBase use only IntVectorPtr = POINTER TO IntVector; IntVector = RECORD | 12 Bytes data : ANYPTR; code : PROC; node : NodePtr END; | For ExecBase use only SoftIntListPtr = POINTER TO SoftIntList; SoftIntList = RECORD OF List | 16 Bytes pad : CARDINAL | keep longword alignment END; PROCEDURE AddIntServer( intNumber : IntFlags; | Autodocs are wrong interrupt : InterruptPtr ); |LIBRARY ExecBase BY -168 |PROCEDURE AddIntServer( intNumber IN D0 : IntFlags; | Autodocs are wrong | interrupt IN A1 : InterruptPtr ); LIBRARY ExecBase BY -180 PROCEDURE Cause( (* REF *) Interrupt IN A1 : InterruptPtr ); LIBRARY ExecBase BY -120 PROCEDURE Disable; LIBRARY ExecBase BY -126 PROCEDURE Enable; LIBRARY ExecBase BY -132 PROCEDURE Forbid; LIBRARY ExecBase BY -138 PROCEDURE Permit; PROCEDURE RemIntServer( intNumber : IntFlags; | Autodocs are wrong interrupt : InterruptPtr ); |LIBRARY ExecBase BY -174 |PROCEDURE RemIntServer( intNumber IN D0 : IntFlags; | Autodocs are wrong | interrupt IN A1 : InterruptPtr ); PROCEDURE SetIntVector( intNumber : IntFlags; | Autodocs are wrong interrupt : InterruptPtr ): InterruptPtr; |LIBRARY ExecBase BY -162 |PROCEDURE SetIntVector( intNumber IN D0 : IntFlags; | Autodocs are wrong | interrupt IN A1 : InterruptPtr ): InterruptPtr; LIBRARY ExecBase BY -144 PROCEDURE SetSR( newSR IN D0 : BITSET; mask IN D1 : BITSET ): BITSET; LIBRARY ExecBase BY -150 PROCEDURE SuperState(): ANYPTR; LIBRARY ExecBase BY -30 PROCEDURE Supervisor( userFunction IN A5: PROC ); LIBRARY ExecBase BY -156 PROCEDURE UserState( sysStack IN D0 : ANYPTR ); GROUP IntGrp = (* I *) IntFlags, (*LIntFlags,*) ListGrp, PROC, (* T *) Interrupt, InterruptPtr, IntFunc, IntFuncPtr, IntVector, IntVectorPtr, SoftIntList, SoftIntListPtr, (* P *) AddIntServer, Cause, Disable, Enable, Forbid, Permit, RemIntServer, SetIntVector, SetSR, SuperState, Supervisor, UserState; |------------------------------------------------------------------------- | memory |------------------------------------------------------------------------- TYPE | local, dma24, reverse and total are new for V36. | dma24 is memory within the 24 bit address space. MemReqs = ( public, chip, fast, mr3, mr4, mr5, mr6, mr7, local, dma24, mr10, mr11, mr12, mr13, mr14, mr15, clear, largest, reverse, total ); | clear used to be memClear when the compiler did not like it MemReqSet = SET OF MemReqs; MemTypeSet = SET OF [public..mr15]; MemChunkPtr = POINTER TO MemChunk; MemChunk = RECORD | 8 Bytes next : MemChunkPtr; bytes : LONGCARD END; MemHeaderPtr = POINTER TO MemHeader; MemHeader = RECORD OF Node | 32 Bytes attributes : MemTypeSet; first : MemChunkPtr; lower : ANYPTR; upper : ANYPTR; free : LONGCARD END; MemEntryPtr = POINTER TO MemEntry; MemEntry = RECORD | 8 Bytes IF KEY :INTEGER OF 1 THEN reqs : MemReqSet OF 2 THEN addr : ANYPTR END; length : LONGCARD; END; MemListPtr = POINTER TO MemList; MemList = RECORD OF Node | 16+me'RANGE*8 Bytes numEntries : CARDINAL; me : ARRAY [1000] OF MemEntry; END; LIBRARY ExecBase BY -204 PROCEDURE AllocAbs( byteSize IN D0 : LONGINT; location IN A1 : ANYPTR ): ANYPTR; LIBRARY ExecBase BY -186 PROCEDURE Allocate( freeList IN A0 : MemHeaderPtr; byteSize IN D0 : LONGCARD ): ANYPTR; LIBRARY ExecBase BY -222 PROCEDURE AllocEntry( memList IN A0 : MemListPtr ): MemListPtr; LIBRARY ExecBase BY -198 PROCEDURE AllocMem( byteSize IN D0 : LONGCARD; | WARNING: used to be | LONGINT requirements IN D1 : MemReqSet ): ANYPTR; | no doc available, prototype from fd file and thin air (V37). LIBRARY ExecBase BY -708 PROCEDURE AllocPooled( memSize IN D0 : LONGCARD; poolHeader IN A0 : ANYPTR ): ANYPTR; | allocate memory and keep track of the size (V36) | like AllocMem, but remembers the size. FREE WITH FreeVec !!! LIBRARY ExecBase BY -684 PROCEDURE AllocVec( byteSize IN D0 : LONGCARD; requirements IN D1 : MemReqSet ): ANYPTR; LIBRARY ExecBase BY -216 PROCEDURE AvailMem( requirements IN D1 : MemReqSet ): LONGCARD; | no doc available, prototype from fd file and thin air (V37). LIBRARY ExecBase BY -696 PROCEDURE CreatePrivatePool( requirements IN D0 : MemReqSet; | this is | a guess puddleSize IN D1, puddleThresh IN D2 : LONGCARD ): ANYPTR; LIBRARY ExecBase BY -192 PROCEDURE Deallocate( freeList IN A0 : MemHeaderPtr; memoryBlock IN A1 : ANYPTR; byteSize IN D0 : LONGCARD ); | no doc available, prototype from fd file and thin air (V37). LIBRARY ExecBase BY -702 PROCEDURE DeletePrivatePool( poolHeader IN A0 : ANYPTR ); LIBRARY ExecBase BY -228 PROCEDURE FreeEntry( memList IN A0 : MemListPtr ); LIBRARY ExecBase BY -210 PROCEDURE FreeMem( memoryBlock IN A1 : ANYPTR; byteSize IN D0 : LONGCARD ); | no doc available, prototype from fd file and thin air (V37). LIBRARY ExecBase BY -714 PROCEDURE FreePooled( memory IN A1, poolHeader IN A0 : ANYPTR ) : ANYPTR; | return AllocVec() memory to the system (V36) LIBRARY ExecBase BY -690 PROCEDURE FreeVec( memoryBlock IN A1: ANYPTR ); LIBRARY ExecBase BY -534 PROCEDURE TypeOfMem( address IN A0 : ANYPTR ): MemReqSet; GROUP | New for V36 are AllocPooled, AllocVec, CreatePrivatePool, | DeletePrivatePool, FreePooled, FreeVec. MemGrp = (* I *) NodeGrp, (* T *) MemChunk, MemChunkPtr, MemEntry, MemEntryPtr, MemHeader, MemHeaderPtr, MemList, MemListPtr, MemReqs, MemReqSet, MemTypeSet, (* P *) AllocAbs, Allocate, AllocEntry, AllocMem, AllocPooled, AllocVec, AvailMem, CreatePrivatePool, Deallocate, DeletePrivatePool, FreeEntry, FreeMem, FreePooled, FreeVec, TypeOfMem; |------------------------------------------------------------------------- | tasks |------------------------------------------------------------------------- TYPE | etask is new for V36 TaskFlags = ( procTime, tf1, tf2, etask, stackChk, exception, switch, launch ); TaskFlagSet = SET OF TaskFlags; TaskState = ( inval, added, run, ready, wait, except, removed ); | Signals 0-15 are preallocated, but only some have official names. The | highest 16 signals (upto max) are there for the task's use. Please do | allocate them before using them | TaskSignals = ( noSignal = -1, anySignal = -1, abort, child, ts2, ts3, blit, single=4, intuition, ts6, ts7, dos, ts9, ts10, ts11, ctrlC, ctrlD, ctrlE, ctrlF, user16, user17, user18, user19, user20, user21, user22, user24, user25, user26, user27, user28, user29, user30, user31 ); TaskSigSet = SET OF TaskSignals; | Procedures registered as exceptCode get called like this. 'data' is | the exceptData field from the Task RECORD. 'signals' is the set of | exceptions, that occured. The result value of an ExceptPROC is put | into sigExcept, thus setting the signals which can cause a soft | exception from then on. The Cluster runtimesystem has an | exceptionhandling routine of its own, so be careful to use this | possibilty on your own. | ExceptPROC = PROCEDURE( signals IN D0 : TaskSigSet; data IN A1 : ANYPTR ) : TaskSigSet; TaskPtr = POINTER TO Task; Task = RECORD OF Node | 92 Bytes flags : TaskFlagSet; state : TaskState; idNestCnt, tdNestCnt : SHORTINT; | WARNING: used to be SHORTCARD sigAlloc, sigWait, sigRecvd, sigExcept : TaskSigSet; trapAlloc, trapAble : BITSET; exceptData: ANYPTR; exceptCode: ExceptPROC; trapData : ANYPTR; trapCode : PROC; spReg, spLower, spUpper : ANYPTR; switch, launch : PROC; memEntry : List; userData : ANYPTR; END; CONST | WARNING: Sig* are now real signals, not the Bit numbers. SigAbort = TaskSigSet:{ abort }; SigChild = TaskSigSet:{ child }; SigBlit = TaskSigSet:{ blit }; | same as single SigSingle = TaskSigSet:{ single }; | same as blit SigDos = TaskSigSet:{ dos }; | used for Dos calls SigCtrlC = TaskSigSet:{ ctrlC }; SigCtrlD = TaskSigSet:{ ctrlD }; SigCtrlE = TaskSigSet:{ ctrlE }; SigCtrlF = TaskSigSet:{ ctrlF }; LIBRARY ExecBase BY -282 PROCEDURE AddTask( task IN A1 : TaskPtr; initialPC IN A2 : ANYPTR; finalPC IN A3 : ANYPTR ): TaskPtr; LIBRARY ExecBase BY -288 PROCEDURE RemTask( task IN A1 : TaskPtr ); LIBRARY ExecBase BY -294 PROCEDURE FindTask( name IN A1 : SysStringPtr ): TaskPtr; LIBRARY ExecBase BY -300 PROCEDURE SetTaskPri( task IN A1 : TaskPtr; pri IN D0 : NodePri ): NodePri; | CreateTask and DeleteTask are in T_Exec GROUP TaskGrp = (* I *) ListGrp, PROC, (* T *) ExceptPROC, Task, TaskFlags, TaskFlagSet, TaskPtr, TaskSignals, TaskSigSet, TaskState, (* C *) SigAbort, SigBlit, SigChild, SigDos, SigSingle, SigCtrlC, SigCtrlD, SigCtrlE, SigCtrlF, (* P *) AddTask, FindTask, RemTask, SetTaskPri; |------------------------------------------------------------------------- | ports |------------------------------------------------------------------------- TYPE MsgPortAction = ( signal, softInt, ignore ); MsgPortPtr = POINTER TO MsgPort; MsgPort = RECORD OF Node IF KEY flags : MsgPortAction OF signal THEN sigBit : TaskSignals; sigTask : TaskPtr OF softInt THEN softInt : InterruptPtr END; msgList : List; END; MessagePtr = POINTER TO Message; Message = RECORD OF Node replyPort : MsgPortPtr; msgSize : CARDINAL; | include Message'SIZE !!! END; LIBRARY ExecBase BY -354 PROCEDURE AddPort( port IN A1 : MsgPortPtr ); | Allocate and initialize a new message port (V36) | Alloc a signal, clear msgList and set port to signal the calling task. | To make public, set name and pri, AddPort, use, RemPort and DeleteMsgPort. | YOU *MUST* USE DeleteMsgPort TO DELETE PORTS CREATED WITH CreateMsgPort! LIBRARY ExecBase BY -666 PROCEDURE CreateMsgPort(): MsgPortPtr; | Free a message port created by CreateMsgPort (V36) | port may be NIL. msgList MUST already be empty. LIBRARY ExecBase BY -672 PROCEDURE DeleteMsgPort( port IN A0 : MsgPortPtr ); LIBRARY ExecBase BY -390 PROCEDURE FindPort( REF name IN A1 : STRING ): MsgPortPtr; LIBRARY ExecBase BY -372 PROCEDURE GetMsg( port IN A0 : MsgPortPtr ): MessagePtr; LIBRARY ExecBase BY -366 PROCEDURE PutMsg( port IN A0 : MsgPortPtr; msg IN A1 : MessagePtr ); LIBRARY ExecBase BY -360 PROCEDURE RemPort( port IN A1 : MsgPortPtr ); LIBRARY ExecBase BY -378 PROCEDURE ReplyMsg( msg IN A1 : MessagePtr ); LIBRARY ExecBase BY -384 PROCEDURE WaitPort( port IN A0 : MsgPortPtr ): MessagePtr; GROUP MsgPortGrp = (* I *) TaskGrp, (* T *) Message, MessagePtr, MsgPort, MsgPortAction, MsgPortPtr, (* P *) AddPort, CreateMsgPort, DeleteMsgPort, FindPort, GetMsg, PutMsg, RemPort, ReplyMsg, WaitPort; |------------------------------------------------------------------------- | libraries |------------------------------------------------------------------------- CONST vectSize = 6; reserved = 4; base = -vectSize; userDef = base-reserved*vectSize; nonStd = userDef; extFunc = -24; | user functions begin here expunge = -18; close = -12; open = -6; TYPE LibFlags = ( summing, | currently being checksummed changed, | has just been changed sumUsed, | should be summed delExp ); | delayed expunge LibFlagSet = SET OF LibFlags; LibraryPtr = POINTER TO Library; Library = RECORD OF Node | 34 Bytes flags : LibFlagSet; libPad : SHORTCARD; | WARNING: was missing here negSize, posSize, version, revision : CARDINAL; idString : SysStringPtr; sum : LONGCARD; openCnt : CARDINAL; END; | Warning: not a longword multiple LibInitProc = PROCEDURE ( lib IN D0 : LibraryPtr; segList IN A0 : BPTR; exec IN A6 : ExecBasePtr ): LibraryPtr; FuncArrayPtr = POINTER TO ARRAY OF PROC; LIBRARY ExecBase BY -396 PROCEDURE AddLibrary( library IN A1 : LibraryPtr ); LIBRARY ExecBase BY -414 PROCEDURE CloseLibrary( library IN A1 : LibraryPtr ); LIBRARY ExecBase BY -90 PROCEDURE MakeFunctions( target IN A0 : ANYPTR; functArray IN A1 : ANYPTR; functDispBase IN A2 : ANYPTR ); LIBRARY ExecBase BY -84 PROCEDURE MakeLibrary( vectors IN A0 : FuncArrayPtr; structure IN A1 : ANYPTR; init IN A2 : LibInitProc; dataSize IN D0 : LONGCARD; segList IN D1 : BPTR ): LibraryPtr; LIBRARY ExecBase BY -408 PROCEDURE OldOpenLibrary( REF name IN A1 : STRING ): LibraryPtr; LIBRARY ExecBase BY -552 PROCEDURE OpenLibrary( REF name IN A1 : STRING; version IN D0 : LONGINT ): LibraryPtr; LIBRARY ExecBase BY -402 PROCEDURE RemLibrary( library IN A1 : LibraryPtr ); LIBRARY ExecBase BY -420 PROCEDURE SetFunction( library IN A1 : LibraryPtr; funcOffset IN A0 : INTEGER; funcEntry IN D0 : ANYPTR ): ANYPTR; | no doc available, prototype from fd file and thin air. LIBRARY ExecBase BY -720 PROCEDURE SetFunction8( funcOffset IN D0 : LONGCARD; newFunction IN D1 : ANYPTR; array IN A0 : ANYPTR; library IN A1 : LibraryPtr ): ANYPTR; LIBRARY ExecBase BY -426 PROCEDURE SumLibrary( library IN A1 : LibraryPtr ); GROUP | New for V36 is SetFunction8. LibGrp = (* I *) BPTR, NodeGrp, (* T *) FuncArrayPtr, LibInitProc, Library, LibraryPtr, (* C *) base, close, expunge, extFunc, nonStd, open, reserved, userDef, vectSize, (* P *) AddLibrary, CloseLibrary, MakeFunctions, MakeLibrary, OldOpenLibrary, OpenLibrary, RemLibrary, SetFunction, SetFunction8, SumLibrary; |------------------------------------------------------------------------- | devices |------------------------------------------------------------------------- TYPE DevicePtr = POINTER TO Device; Device = RECORD OF Library END; UnitFlags = ( active, inTask ); UnitFlagSet = SET OF UnitFlags; UnitPtr = POINTER TO Unit; Unit = RECORD OF MsgPort; flags : UnitFlagSet; unit_Pad : SHORTCARD; | WARNING: added openCnt : CARDINAL END; |------------------------------------------------------------------------- | + io |------------------------------------------------------------------------- TYPE IOFlags = ( IOquick, IO1, IO2, IO3, IO4, IO5, IO6, IO7 ); IOFlagSet = SET OF IOFlags; | CARDINAL values for I/O command IOCommand = ( invalid, reset, read, write, update, clear, stop, start, flush, nonstd, makemecard = $7FFF ); | SHORTCARD return values for device IO functions and the error field IOReturn = ( badLength = $FC, noCmd = $FD, aborted = $FE, openFail = $FF, ioOk = 0); CONST | used more easily to extend IOCommand nonstdVAL = CARDINAL( nonstd ); | offsets into device structures abortIO = -36; beginIO = -30; quick = IOFlagSet:{ IOquick }; TYPE IORequestPtr = POINTER TO IORequest; IORequest = RECORD OF Message device : DevicePtr; unit : UnitPtr; command : IOCommand; | CARDINAL flags : IOFlagSet; error : IOReturn; | SHORTCARD END; IOStdReqPtr = POINTER TO IOStdReq; IOStdReq = RECORD OF IORequest actual, length : LONGCARD; data : ANYPTR; offset : LONGCARD; END; | devices LIBRARY ExecBase BY -432 PROCEDURE AddDevice( device IN A1 : DevicePtr ); LIBRARY ExecBase BY -450 PROCEDURE CloseDevice( ioRequest IN A1 : IORequestPtr ); | create an IORequest structure (V36) | Allocates memory for and initializes a new IO request block. | size must be at least Message'SIZE | port may be the non-NIL return value of CreateMsgPort. | returns a pointer to the new IORequest block, or NIL. LIBRARY ExecBase BY -654 PROCEDURE CreateIORequest( port IN A0 : MsgPortPtr; size IN D0 : LONGCARD ): IORequestPtr; | DeleteIORequest() - Free a request made by CreateIORequest() (V36) LIBRARY ExecBase BY -660 PROCEDURE DeleteIORequest( iorequest IN A0 : IORequestPtr ); | OpenDevice | | returns a sign extended copy of ioRequest.error. LIBRARY ExecBase BY -444 PROCEDURE OpenDevice( REF devName IN A0 : STRING; unit IN D0 : LONGCARD; ioRequest IN A1 : IORequestPtr; flags IN D1 : LONGSET ): IOReturn; LIBRARY ExecBase BY -438 PROCEDURE RemDevice( device IN A1 : DevicePtr ); | | I/O Functions | | !! NOTE !! LONGINT return values are the sign extended version of | ioRequest.error ! | LIBRARY ExecBase BY -480 PROCEDURE AbortIO( ioRequest IN A1 : IORequestPtr ); LIBRARY ExecBase BY -468 PROCEDURE CheckIO( ioRequest IN A1 : IORequestPtr ): IORequestPtr; LIBRARY ExecBase BY -456 PROCEDURE DoIO( ioRequest IN A1 : IORequestPtr ): IOReturn; LIBRARY ExecBase BY -462 PROCEDURE SendIO( ioRequest IN A1 : IORequestPtr ); LIBRARY ExecBase BY -474 PROCEDURE WaitIO( ioRequest IN A1 : IORequestPtr ): IOReturn; GROUP | new for V36 are CreateIORequest and DeleteIORequest. DeviceIOGrp = (* I *) LibGrp, MsgPortGrp, (* T *) Device, DevicePtr, IOFlagSet, IORequest, IORequestPtr, IOStdReq, IOStdReqPtr, Unit, UnitFlags, UnitFlagSet, UnitPtr, (* C *) abortIO, beginIO, nonStd, nonstdVAL, quick, (* P *) AbortIO, AddDevice, CheckIO, CloseDevice, CreateIORequest, DeleteIORequest, DoIO, OpenDevice, RemDevice, SendIO, WaitIO; |------------------------------------------------------------------------- | semaphores |------------------------------------------------------------------------- TYPE SemaphoreRequestPtr = POINTER TO SemaphoreRequest; SemaphoreRequest = RECORD OF MinNode waiter : TaskPtr; END; SignalSemaphorePtr = POINTER TO SignalSemaphore; SignalSemaphore = RECORD OF Node nestCount : INTEGER; waitQueue : MinList; multipleLink : SemaphoreRequest; owner : TaskPtr; queueCount : INTEGER; END; SemaphorePtr = POINTER TO Semaphore; Semaphore = RECORD OF MsgPort bids : INTEGER END; LIBRARY ExecBase BY -600 PROCEDURE AddSemaphore( sigSema IN A1 : SignalSemaphorePtr ); LIBRARY ExecBase BY -576 PROCEDURE AttemptSemaphore(sigSema IN A0 : SignalSemaphorePtr):BOOLEAN; LIBRARY ExecBase BY -594 PROCEDURE FindSemaphore( name IN A1 : SysStringPtr ): SignalSemaphore; LIBRARY ExecBase BY -558 PROCEDURE InitSemaphore( sigSema IN A0 : SignalSemaphorePtr ); LIBRARY ExecBase BY -564 PROCEDURE ObtainSemaphore( sigSema IN A0 : SignalSemaphorePtr ); LIBRARY ExecBase BY -582 PROCEDURE ObtainSemaphoreList( list IN A0 : ListPtr ); | gain shared access to a semaphore (V36) | works like you would expect even on older SignalSemaphores LIBRARY ExecBase BY -678 PROCEDURE ObtainSemaphoreShared( sigSema IN A0 : SignalSemaphorePtr ); LIBRARY ExecBase BY -540 PROCEDURE Procure( sema IN A0 : SemaphorePtr; bidMsg IN A1 : MessagePtr ): BOOLEAN; LIBRARY ExecBase BY -570 PROCEDURE ReleaseSemaphore( sigSema IN A0 : SignalSemaphorePtr ); LIBRARY ExecBase BY -588 PROCEDURE ReleaseSemaphoreList( list IN A0 : ListPtr ); LIBRARY ExecBase BY -606 PROCEDURE RemSemaphore( sigSema IN A1 : SignalSemaphorePtr ); LIBRARY ExecBase BY -546 PROCEDURE Vacate( sema IN A0 : SemaphorePtr ); GROUP | New for V36 is ObtainSemaphoreShared. SemaphoreGrp = (* I *) MsgPortGrp, (* T *) Semaphore, SemaphorePtr, SemaphoreRequest, SemaphoreRequestPtr, SignalSemaphore, SignalSemaphorePtr, (* P *) AddSemaphore, AttemptSemaphore, FindSemaphore, InitSemaphore, ObtainSemaphore, ObtainSemaphoreList, ObtainSemaphoreShared, Procure, ReleaseSemaphore, ReleaseSemaphoreList, RemSemaphore, Vacate; |------------------------------------------------------------------------- | resident |------------------------------------------------------------------------- TYPE | singleTask and afterDos are new for V36 ResidentFlags = ( coldStart, singleTask, afterDos, rf3, rf4, rf5, rf6, autoinit ); ResidentFlagSet = SET OF ResidentFlags; ResidentPri = NodePri; ResidentPtr = POINTER TO Resident; Resident = RECORD | 26 Bytes matchWord : CARDINAL; matchTag : ResidentPtr; endSkip : ANYPTR; flags : ResidentFlagSet; version : SHORTCARD; type : NodeType; priority : ResidentPri; name : SysStringPtr; idString : SysStringPtr; init : ANYPTR END; CONST matchWord = $4AFC; | = the 68000 "ILLEGAL" instruction LIBRARY ExecBase BY -96 PROCEDURE FindResident( name IN A1 : SysStringPtr ): ResidentPtr; LIBRARY ExecBase BY -72 PROCEDURE InitCode( startClass IN D0 : ResidentFlagSet; version IN D1 : LONGINT ); LIBRARY ExecBase BY -102 PROCEDURE InitResident( resident IN A1 : ResidentPtr; segList IN D1 : BPTR ); GROUP ResidentGrp = (* I *) BPTR, NodeGrp, (* T *) Resident, ResidentFlags, ResidentFlagSet, ResidentPtr, (* C *) matchWord, (* P *) FindResident, InitCode, InitResident; |------------------------------------------------------------------------- | execbase |------------------------------------------------------------------------- TYPE AttnFlags = ( m68010, m68020, m68030, m68040, m68881, m68882, af6, af7, af8, af9 ); AttnFlagSet = SET OF AttnFlags; | 2 Bytes TYPE ExecBaseType = RECORD OF Library softVer : CARDINAL; lowMemChkSum : INTEGER; chkBase : LONGCARD; | A nice hidingplace for the classic virussians. coldCapture, coolCapture, warmCapture : PROC; sysStkUpper, sysStkLower : ANYPTR; maxLocMem : LONGCARD; | Debug() address. debugEntry : PROC; debugData, alertData : ANYPTR; maxExtMem : ANYPTR; chkSum : CARDINAL; | Interface to these with the AddIntServer Function intVects : ARRAY IntFlags OF IntVector; | "There can be only one" on single CPU machines ... thisTask : TaskPtr; | All the statistics you get from Exec. idleCount, dispCount : LONGCARD; quantum, elapsed : CARDINAL; sysFlags : CARDINAL; | Interrupt disable nest count idNestCnt, | Task disable nest count tdNestCnt : SHORTCARD; | Attention flags attnFlags : AttnFlagSet; | Rescheduling attention attnResched : CARDINAL; | resident module array pointer resModules : ANYPTR; | task administration taskTrapCode, taskExceptCode, taskExitCode : PROC; taskSigAlloc : LONGSET; taskTrapAlloc : BITSET; | The most often read systemlists (read only in | Disable()ed code. memList, resourceList, deviceList, intrList, libList, portList, taskReady, taskWait : List; | the list of pending software interrupts. They have | the priorities of -32, -16, 0, 16 and 32. softInts : ARRAY [0..4] OF SoftIntList; lastAlert : ARRAY [0..3] OF LONGINT; | the next two should usualy contain 50 or 60 vBlankFrequency : SHORTCARD; powerSupplyFrequency : SHORTCARD; semaphoreList : List; kickMemPtr, kickTagPtr : ANYPTR; kickCheckSum : LONGCARD; | >= V36 exPad0 : CARDINAL; exReserved0 : LONGCARD; RamLibPrivate : ANYPTR; eClockFrequency, | readable cacheControl, | private taskID, puddleSize, poolThreshold : LONGCARD; publicPool : MinList; mmuLock : ANYPTR; exReserved1 : ARRAY[ 0..11 ] OF SHORTCARD; |