home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / m2 / CycloneModules.lha / modules / txt / ExecD.def < prev    next >
Text File  |  1996-11-19  |  30KB  |  903 lines

  1. (*
  2. **    Cyclone Modula-2 Interface module:
  3. **    $VER: exec.h 39.0 (15.10.91)
  4. **    Includes Release 40.15
  5. **
  6. **    Include all other Exec include files in a non-overlapping order.
  7. **
  8. **    (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  9. **        All Rights Reserved
  10. **
  11. **      Interface module by Marcel Timmermans
  12. **      (C) Copyright 1995-1996 Marcel Timmermans
  13. **          All Rights Reserved
  14. *)
  15.  
  16. DEFINITION MODULE ExecD;
  17. (*$ Implementation- *)
  18.  
  19. FROM SYSTEM IMPORT BYTE, WORD, ADDRESS, BITSET, SHORTSET, LONGSET,CAST;
  20.  
  21. TYPE
  22.   BPTR=BPOINTER TO LONGINT;
  23.   IOFlagSet=SHORTSET;
  24.   DevicePtr=POINTER TO Device;
  25.   ExecBasePtr=POINTER TO ExecBase;
  26.   InterruptPtr=POINTER TO Interrupt;
  27.   IORequestPtr=POINTER TO IORequest;
  28.   IOStdReqPtr=POINTER TO IOStdReq;
  29.   LibraryPtr=POINTER TO Library;
  30.   ListPtr=POINTER TO List;
  31.   MemChunkPtr=POINTER TO MemChunk;
  32.   MemHeaderPtr=POINTER TO MemHeader;
  33.   MemListPtr=POINTER TO MemList;
  34.   MessagePtr=POINTER TO Message;
  35.   MinListPtr=POINTER TO MinList;
  36.   MinNodePtr=POINTER TO MinNode;
  37.   MsgPortPtr=POINTER TO MsgPort;
  38.   NodePtr=POINTER TO Node;
  39.   ResidentPtr=POINTER TO Resident;
  40.   SemaphoreMessagePtr=POINTER TO SemaphoreMessage;
  41.   SemaphorePtr=POINTER TO Semaphore;
  42.   SignalSemaphorePtr=POINTER TO SignalSemaphore;
  43.   TaskPtr=POINTER TO Task;
  44.   UnitPtr=POINTER TO Unit;
  45.  
  46. CONST
  47.  LTRUE=CAST(BOOLEAN,1);  (* Needed for Libraries *)
  48.  LFALSE=CAST(BOOLEAN,0); (* Needed for Libraries *)
  49.   
  50.  
  51. (*********************************************************************
  52. *
  53. *  Format of the alert error number:
  54. *
  55. *    +-+-------------+----------------+--------------------------------+
  56. *    |D|  SubSysId   |    General Error |    SubSystem Specific Error    |
  57. *    +-+-------------+----------------+--------------------------------+
  58. *     1    7 bits       8 bits           16 bits
  59. *
  60. *             D:  DeadEnd alert
  61. *          SubSysId:  indicates ROM subsystem number.
  62. *     General Error:  roughly indicates what the error was
  63. *    Specific Error:  indicates more detail
  64. **********************************************************************)
  65.  
  66. (*********************************************************************
  67. *
  68. *  General Alerts
  69. *
  70. *  For example: timer.device cannot open math.library would be 0x05038015
  71. *
  72. *    Alert(AN_TimerDev|AG_OpenLib|AO_MathLib);
  73. *
  74. *********************************************************************)
  75.  
  76. CONST
  77.  
  78. (**********************************************************************
  79. *
  80. *  Hardware/CPU specific alerts:  They may show without the 8 at the
  81. *  front of the number.  These are CPU/68000 specific.    See 680x0
  82. *  programmer's manuals for more details.
  83. *
  84. **********************************************************************)
  85.  
  86.   acpuBusErr    = 080000002H;    (* Hardware bus fault/access error *)
  87.   acpuAddressErr= 080000003H;    (* Illegal address access (ie: odd) *)
  88.   acpuInstErr   = 080000004H;    (* Illegal instruction *)
  89.   acpuDivZero   = 080000005H;    (* Divide by zero *)
  90.   acpuCHK       = 080000006H;    (* Check instruction error *)
  91.   acpuTRAPV     = 080000007H;    (* TrapV instruction error *)
  92.   acpuPrivErr   = 080000008H;    (* Privilege violation error *)
  93.   acpuTrace     = 080000009H;    (* Trace error *)
  94.   acpuLineA     = 08000000AH;    (* Line 1010 Emulator error *)
  95.   acpuLineF     = 08000000BH;    (* Line 1111 Emulator error *)
  96.   acpuFormat    = 08000000EH;    (* Stack frame format error *)
  97.   acpuSpurious  = 080000018H;    (* Spurious interrupt error *)
  98.   acpuAutoVec1  = 080000019H;    (* AutoVector Level 1 interrupt error *)
  99.   acpuAutoVec2  = 08000001AH;    (* AutoVector Level 2 interrupt error *)
  100.   acpuAutoVec3  = 08000001BH;    (* AutoVector Level 3 interrupt error *)
  101.   acpuAutoVec4  = 08000001CH;    (* AutoVector Level 4 interrupt error *)
  102.   acpuAutoVec5  = 08000001DH;    (* AutoVector Level 5 interrupt error *)
  103.   acpuAutoVec6  = 08000001EH;    (* AutoVector Level 6 interrupt error *)
  104.   acpuAutoVec7  = 08000001FH;    (* AutoVector Level 7 interrupt error *)
  105.  
  106. (*********************************************************************
  107. *
  108. *  General Alerts
  109. *
  110. *  For example: timer.device cannot open math.library would be 0x05038015
  111. *
  112. *    Alert(AN_TimerDev|AG_OpenLib|AO_MathLib);
  113. *
  114. *********************************************************************)
  115.  
  116.  
  117.  
  118. (*------ alert types *)
  119.   deadEnd    = 080000000H;
  120.   recovery    = 000000000H;
  121.  
  122. (*------ general purpose alert codes *)
  123.   noMemory    = 000010000H;
  124.   makeLib    = 000020000H;
  125.   openLib    = 000030000H;
  126.   openDev    = 000040000H;
  127.   openRes    = 000050000H;
  128.   iOError    = 000060000H;
  129.   noSignal    = 000070000H;
  130.   badParm    = 000080000H;
  131.   closeLib    = 000090000H;    (* usually too many closes *)
  132.   closeDev    = 0000A0000H;    (* or a mismatched close *)
  133.   procCreate= 0000B0000H;    (* Process creation failed *)
  134.  
  135.  
  136. (*------ alert objects: *)
  137.   aoexecLib    = 000008001H;
  138.   aographicsLib= 000008002H;
  139.   aolayersLib    = 000008003H;
  140.   aointuition    = 000008004H;
  141.   aomathLib    = 000008005H;
  142.   aodOSLib    = 000008007H;
  143.   aorAMLib    = 000008008H;
  144.   aoiconLib    = 000008009H;
  145.   aoexpansionLib = 00000800AH;
  146.   aodiskfontLib  = 00000800BH;
  147.   aoutilityLib   = 00000800CH;
  148.  
  149.   aoaudioDev      = 000008010H;
  150.   aoconsoleDev  = 000008011H;
  151.   aogamePortDev = 000008012H;
  152.   aokeyboardDev = 000008013H;
  153.   aotrackDiskDev= 000008014H;
  154.   aotimerDev      = 000008015H;
  155.  
  156.   aocIARsrc    = 000008020H;
  157.   aodiskRsrc    = 000008021H;
  158.   aomiscRsrc    = 000008022H;
  159.  
  160.   aobootStrap    = 000008030H;
  161.   aoworkbench    = 000008031H;
  162.   aodiskCopy    = 000008032H;
  163.   aogadTools    = 000008033H;
  164.   aounknown    = 000008035H;
  165.  
  166.  
  167.  
  168. (*********************************************************************
  169. *
  170. *   Specific Alerts:
  171. *
  172. *********************************************************************)
  173.  
  174. (*------ exec.library *)
  175.   anexecLib    = 001000000H;
  176.   anexcptVect    = 001000001H; (* 68000 exception vector checksum (obs.) *)
  177.   anbaseChkSum= 001000002H; (* Execbase checksum (obs.) *)
  178.   anlibChkSum    = 001000003H; (* Library checksum failure *)
  179.  
  180.   anmemCorrupt= 081000005H; (* Corrupt memory list detected in FreeMem *)
  181.   anintrMem    = 081000006H; (* No memory for interrupt servers *)
  182.   aninitAPtr    = 001000007H; (* InitStruct() of an APTR source (obs.) *)
  183.   ansemCorrupt= 001000008H; (* A semaphore is in an illegal stateH;
  184.                              at ReleaseSempahore() *)
  185.   anfreeTwice    = 001000009H; (* Freeing memory already freed *)
  186.   anbogusExcpt= 08100000AH; (* illegal 68k exception taken (obs.) *)
  187.   anioUsedTwice=00100000BH; (* Attempt to reuse active IORequest *)
  188.   anmemoryInsane=00100000CH; (* Sanity check on memory list failed
  189.                                 during AvailMem(MEMF_LARGEST) *)
  190.   anioAfterClose= 00100000DH; (* IO attempted on closed IORequest *)
  191.   anstackProbe  = 00100000EH; (* Stack appears to extend out of range *)
  192.   anbadFreeAddr = 00100000FH; (* Memory header not located. [ Usually an
  193.                                 invalid address passed to FreeMem() ] *)
  194.   anbadSemaphore= 001000010H; (* An attempt was made to use the old
  195.                                 message semaphores. *)
  196.  
  197. (*------ graphics.library *)
  198.   angraphicsLib   = 002000000H;
  199.   angfxNoMem      = 082010000H;    (* graphics out of memory *)
  200.   angfxNoMemMspc  = 082010001H;    (* MonitorSpec alloc, no memory *)
  201.   anlongFrame     = 082010006H;    (* long frame, no memory *)
  202.   anshortFrame    = 082010007H;    (* short frame, no memory *)
  203.   antextTmpRas    = 002010009H;    (* text, no memory for TmpRas *)
  204.   anbltBitMap     = 08201000AH;    (* BltBitMap, no memory *)
  205.   anregionMemory  = 08201000BH;    (* regions, memory not available *)
  206.   anmakeVPort     = 082010030H;    (* MakeVPort, no memory *)
  207.   angfxNewError   = 00200000CH;
  208.   angfxFreeError  = 00200000DH;
  209.  
  210.   angfxNoLCM      = 082011234H;    (* emergency memory not available *)
  211.  
  212.   anobsoleteFont  = 002000401H;    (* unsupported font description used *)
  213.  
  214. (*------ layers.library *)
  215.   anlayersLib     = 003000000H;
  216.   anlayersNoMem   = 083010000H;    (* layers out of memory *)
  217.  
  218. (*------ intuition.library *)
  219.   anintuition     = 004000000H;
  220.   angadgetType    = 084000001H;    (* unknown gadget type *)
  221.   anbadGadget     = 004000001H;    (* Recovery form of AN_GadgetType *)
  222.   ancreatePort    = 084010002H;    (* create port, no memory *)
  223.   anitemAlloc     = 004010003H;    (* item plane alloc, no memory *)
  224.   ansubAlloc      = 004010004H;    (* sub alloc, no memory *)
  225.   anplaneAlloc    = 084010005H;    (* plane alloc, no memory *)
  226.   anitemBoxTop    = 084000006H;    (* item box top < RelZero *)
  227.   anopenScreen    = 084010007H;    (* open screen, no memory *)
  228.   anopenScrnRast  = 084010008H;    (* open screen, raster alloc, no memory *)
  229.   ansysScrnType   = 084000009H;    (* open sys screen, unknown type *)
  230.   anaddSWGadget   = 08401000AH;    (* add SW gadgets, no memory *)
  231.   anopenWindow    = 08401000BH;    (* open window, no memory *)
  232.   anbadState      = 08400000CH;    (* Bad State Return entering Intuition *)
  233.   anbadMessage    = 08400000DH;    (* Bad Message received by IDCMP *)
  234.   anweirdEcho     = 08400000EH;    (* Weird echo causing incomprehension *)
  235.   annoConsole     = 08400000FH;    (* couldn't open the Console Device *)
  236.   annoISem        = 004000010H;    (* Intuition skipped obtaining a sem *)
  237.   anisemOrder     = 004000011H;  (* Intuition obtained a sem in bad order *)
  238.  
  239. (*------ math.library *)
  240.   mathLib   = 005000000H;
  241.  
  242. (*------ dos.library *)
  243.   andOSLib    = 007000000H;
  244.   anstartMem  = 007010001H; (* no memory at startup *)
  245.   anendTask   = 007000002H; (* EndTask didn't *)
  246.   anqPktFail  = 007000003H; (* Qpkt failure *)
  247.   anasyncPkt  = 007000004H; (* Unexpected packet received *)
  248.   anfreeVec   = 007000005H; (* Freevec failed *)
  249.   andiskBlkSeq= 007000006H; (* Disk block sequence error *)
  250.   anbitMap    = 007000007H; (* Bitmap corrupt *)
  251.   ankeyFree   = 007000008H; (* Key already free *)
  252.   anbadChkSum = 007000009H; (* Invalid checksum *)
  253.   andiskError = 00700000AH; (* Disk Error *)
  254.   ankeyRange  = 00700000BH; (* Key out of range *)
  255.   anbadOverlay= 00700000CH; (* Bad overlay *)
  256.   anbadInitFunc= 00700000DH; (* Invalid init packet for cli/shell *)
  257.   anfileReclosed= 00700000EH; (* A filehandle was closed more than once *)
  258.  
  259. (*------ ramlib.library *)
  260.   anramLib    = 008000000H;
  261.   anbadSegList= 008000001H;    (* no overlays in library seglists *)
  262.  
  263. (*------ icon.library *)
  264.   aniconLib   = 009000000H;
  265.  
  266. (*------ expansion.library *)
  267.   anexpansionLib = 00A000000H;
  268.   anbadExpansionFree = 00A000001H; (* freeed free region *)
  269.  
  270. (*------ diskfont.library *)
  271.   andiskfontLib = 00B000000H;
  272.  
  273. (*------ audio.device *)
  274.   anaudioDev = 010000000H;
  275.  
  276. (*------ console.device *)
  277.   anconsoleDev = 011000000H;
  278.   annoWindow = 011000001H;    (* Console can't open initial window *)
  279.  
  280. (*------ gameport.device *)
  281.   angamePortDev = 012000000H;
  282.  
  283. (*------ keyboard.device *)
  284.   ankeyboardDev = 013000000H;
  285.  
  286. (*------ trackdisk.device *)
  287.   antrackDiskDev  = 014000000H;
  288.   antdCalibSeek   = 014000001H;    (* calibrate: seek error *)
  289.   antdDelay       = 014000002H;    (* delay: error on timer wait *)
  290.  
  291. (*------ timer.device *)
  292.   antimerDev      = 015000000H;
  293.   antmBadReq      = 015000001H; (* bad request *)
  294.   antmBadSupply   = 015000002H; (* power supply -- no 50/60Hz ticks *)
  295.  
  296. (*------ cia.resource *)
  297.   anCIARsrc = 020000000H;
  298.  
  299. (*------ disk.resource *)
  300.   andiskRsrc = 021000000H;
  301.   andRHasDisk = 021000001H;    (* get unit: already has disk *)
  302.   andRIntNoAct = 021000002H;    (* interrupt: no active unit *)
  303.  
  304. (*------ misc.resource *)
  305.   anmiscRsrc = 022000000H;
  306.  
  307. (*------ bootstrap *)
  308.   anbootStrap = 030000000H;
  309.   anbootError = 030000001H;    (* boot code returned an error *)
  310.  
  311. (*------ Workbench *)
  312.   anworkbench             = 031000000H;
  313.   annoFonts             = 0B1000001H;
  314.   anwbBadStartupMsg1     = 031000001H;
  315.   anwbBadStartupMsg2     = 031000002H;
  316.   anwbBadIOMsg         = 031000003H;  (* Hacker code? *)
  317.  
  318.   anwbInitPotionAllocDrawer = 0B1010004H;
  319.   anwbCreateWBMenusCreateMenus1 = 0B1010005H;
  320.   anwbCreateWBMenusCreateMenus2 = 0B1010006H;
  321.   anwbLayoutWBMenusLayoutMenus = 0B1010007H;
  322.   anwbAddToolMenuItem     = 0B1010008H;
  323.   anwbReLayoutToolMenu = 0B1010009H;     (* GadTools broke? *)
  324.   anwbinitTimer         = 0B101000AH;
  325.   anwbInitLayerDemon     = 0B101000BH;
  326.   anwbinitWbGels         = 0B101000CH;
  327.   anwbInitScreenAndWindows1 = 0B101000DH;
  328.   anwbInitScreenAndWindows2 = 0B101000EH;
  329.   anwbInitScreenAndWindows3 = 0B101000FH;
  330.   anwbMAlloc         = 0B1010010H;
  331.  
  332. (*------ DiskCopy *)
  333.   andiskCopy = 032000000H;
  334.  
  335. (*------ toolkit for Intuition *)
  336.   angadTools = 033000000H;
  337.  
  338. (*------ System utility library *)
  339.   anutilityLib = 034000000H;
  340.  
  341. (*------ For use by any application that needs it *)
  342.   anunknown = 035000000H;
  343.  
  344. (*
  345.  *  List Node Structure.  Each member in a list starts with a Node
  346.  *)
  347.  
  348. TYPE
  349. (*
  350. ** Note: Newly initialized IORequests, and software interrupt structures
  351. ** used with Cause(), should have type NT_UNKNOWN.  The OS will assign a type
  352. ** when they are first used.
  353. *)
  354. (*----- Node Types for LN_TYPE -----*)
  355.  NodeType=(
  356.   unknown,task,interrupt,device,msgPort,message,freeMsg,
  357.   replyMsg,resource,library,memory,softInt,font,process,
  358.   semaphore,signalSem,bootNode,kickMem,graphics,deathMessage
  359.  );
  360. CONST
  361.  user=CAST(NodeType,SHORTCARD(254)); (* User node types work down from here *)
  362.  extended=CAST(NodeType,SHORTCARD(255));
  363.  
  364. TYPE
  365.  Node=RECORD
  366.    succ:NodePtr;    (* Pointer to next (successor) *)
  367.    pred:NodePtr;    (* Pointer to previous (predecessor) *)
  368.    type:NodeType;
  369.    pri:SHORTINT;    (* Priority, for sorting *)
  370.    name:ADDRESS;    (* ID string, null terminated *)       
  371.  END;
  372.  MinNode=RECORD
  373.    succ:MinNodePtr;
  374.    pred:MinNodePtr;
  375.  END;
  376.  
  377. (*
  378.  *  Full featured list header.*
  379. *)
  380.  
  381.  List=RECORD
  382.    head:NodePtr;
  383.    tail:NodePtr;
  384.    tailPred:NodePtr;
  385.    type:NodeType;
  386.    pad:BYTE;
  387.  END;
  388.  
  389. (*
  390.  * Minimal List Header - no type checking
  391.  *)
  392.  MinList=RECORD
  393.    head:MinNodePtr;
  394.    tail:MinNodePtr;
  395.    tailPred:MinNodePtr;
  396.  END;
  397.  
  398. CONST
  399. (*
  400.  * Standard Device IO Errors (returned in io_Error)
  401.  *)
  402.   openFail=-1;  (* device/unit failed to open *)                
  403.   aborted=-2;   (* request terminated early [after AbortIO()] *)
  404.   noCmd=-3;     (* command not supported by device *)
  405.   badLength=-4; (* not a valid length (usually IO_LENGTH) *)
  406.   badAddress=-5;(* invalid address (misaligned or bad range) *)
  407.   unitBusy=-6;  (* device opens ok, but requested unit is busy *)
  408.   selfTest=-7;  (* hardware failed self-test *)                   
  409.  
  410. TYPE
  411.   ResidentFlags=(
  412.    coldstart,singleTask,afterDos,rf3,rf4,rf5,rf6,autoinit
  413.   );
  414.   ResidentFlagSet=SET OF ResidentFlags;
  415.   Resident=RECORD
  416.     matchWord:CARDINAL;         (* word to match on (ILLEGAL)    *)
  417.     matchTag:ResidentPtr;       (* pointer to the above    *)
  418.     endSkip:ADDRESS;            (* address to continue scan    *)
  419.     flags:ResidentFlagSet;      (* various tag flags        *)
  420.     version:SHORTCARD;          (* release version number    *)
  421.     type:NodeType;              (* type of module (NT_XXXXXX)    *)
  422.     pri:SHORTINT;               (* initialization priority *)
  423.     name:ADDRESS;               (* pointer to node name    *)
  424.     idString:ADDRESS;           (* pointer to identification string *)
  425.     init:ADDRESS;               (* pointer to init code    *)             
  426.   END;
  427.  
  428. CONST
  429.   matchword=04AFCH;     (* The 68000 "ILLEGAL" instruction *)
  430.   never=ResidentFlagSet{};
  431.  
  432.  
  433. TYPE
  434.   MemReqs=(public,chip,fast,mr3,mr4,mr5,mr6,mr7,
  435.            local,       (* Memory that does not go away at RESET *)
  436.            dma24Bit,    (* DMAable memory within 24 bits of address *)
  437.            (*39*)kick,mr11,mr12,mr13,mr14,mr15,
  438.            memClear,    (* AllocMem: NULL out area before return *)
  439.            largest,     (* AvailMem: return the largest chunk size *)
  440.            reverse,     (* AllocMem: allocate from the top down *)
  441.            total,       (* AvailMem: return total size of memory *)
  442.            mr20,mr21,mr22,mr23,mr24,mr25,mr26,mr27,mr28,mr29,mr30,
  443.            (*39*)noExpunge);
  444.  
  445.   MemReqSet=SET OF MemReqs; (* MemReqSet{} = Any type of memory will do *)
  446.   MemTypeSet=SET OF [public..mr15];
  447.  
  448. (****** MemChunk ****************************************************)
  449.  
  450.   MemChunk=RECORD
  451.     next:MemChunkPtr;     (* pointer to next chunk *)
  452.     bytes:LONGCARD;     (* chunk byte size    *)       
  453.   END;
  454.  
  455. (****** MemHeader ***************************************************)
  456.  
  457.   MemHeader=RECORD
  458.     node:Node;
  459.     attributes:MemTypeSet;      (* characteristics of this region *)
  460.     first:MemChunkPtr;          (* first free region        *)
  461.     lower:ADDRESS;              (* lower memory bound        *)
  462.     upper:ADDRESS;              (* upper memory bound+1    *)
  463.     free:LONGCARD;              (* total number of free bytes    *)       
  464.   END;
  465.  
  466. (****** MemEntry ****************************************************)
  467.  
  468.   MemEntry=RECORD
  469.     CASE :INTEGER OF
  470.     | 1: reqs:MemReqSet     (* the AllocMem requirements *)
  471.     | 2: addr:ADDRESS        (* the address of this memory region *)
  472.     END;
  473.     length:LONGCARD;        (* the length of this memory region *)       
  474.   END;
  475.  
  476. (* Note: sizeof(struct MemList) includes the size of the first MemEntry! *)
  477.   MemList=RECORD
  478.     node:Node;
  479.     numEntries:CARDINAL;
  480. (* ml_ME: ARRAY[0..numEntries-1] OF MemEntry *)
  481.   END;
  482.  
  483. (****** MemHandlerData **********************************************)
  484. (* Note:  This structure is *READ ONLY* and only EXEC can create it!*)
  485.  
  486.   MemHandlerData=RECORD         
  487.     requestSize:LONGCARD;       (* Requested allocation size *)
  488.     requestFlags:MemReqSet;     (* Requested allocation flags *)
  489.     flags:LONGSET;              (* Flags (see below) *)           
  490.   END;
  491.  
  492. CONST
  493.    recycle=0;   (* 0==First time, 1==recycle *) 
  494.  
  495. (****** Low Memory handler return values ***************************)
  496.  
  497.   memDidNothing=0;  (* Nothing we could do... *)
  498.   memAllDone=-1;    (* We did all we could do *)
  499.   memTryAgain=1;    (* We did some, try the allocation again *)
  500.  
  501.  
  502.  
  503. TYPE
  504. (*----- Flag Bits ------------------------------------------*)
  505.  
  506.   TaskFlags=(
  507.     procTime,tf1,tf2,eTask,stackChk,exception,switch,launch
  508.   );
  509.   TaskFlagSet=SET OF TaskFlags;
  510.  
  511. (*----- Task States ----------------------------------------*)
  512.   TaskState=(nonvalid,added,run,ready,wait,except,removed);
  513.  
  514. (* Please use Exec functions to modify task structure fields, where available.
  515.  *)
  516.   Task=RECORD
  517.     node:Node;
  518.     flags:TaskFlagSet;
  519.     state:TaskState;
  520.     idNestCnt:SHORTINT;     (* intr disabled nesting*)
  521.     tdNestCnt:SHORTINT;        (* task disabled nesting*)
  522.     sigAlloc:LONGSET;       (* sigs allocated *)
  523.     sigWait:LONGSET;        (* sigs we are waiting for *)
  524.     sigRecvd:LONGSET;       (* sigs we have received *)
  525.     sigExcept:LONGSET;        (* sigs we will take excepts for *)
  526.     trapAlloc:BITSET;        (* traps allocated *)
  527.     trapAble:BITSET;        (* traps enabled *)
  528.     exceptData:ADDRESS;        (* points to except data *)
  529.     exceptCode:PROC;        (* points to except code *)
  530.     trapData:ADDRESS;       (* points to trap data *)
  531.     trapCode:PROC;          (* points to trap code *)
  532.     spReg:ADDRESS;          (* stack pointer        *)
  533.     spLower:ADDRESS;        (* stack lower bound    *)
  534.     spUpper:ADDRESS;        (* stack upper bound + 2*)
  535.     switch:PROC;            (* task losing CPU      *)
  536.     launch:PROC;            (* task getting CPU  *)
  537.     memEntry:List;          (* Allocated memory. Freed by RemTask() *)
  538.     userData:ADDRESS;       (* For use by the task; no restrictions! *)    
  539.   END;
  540.  
  541.   StackSwapStruct=RECORD
  542.     lower:ADDRESS;          (* Lowest byte of stack *)              
  543.     upper:ADDRESS;          (* Upper end of stack (size + Lowest) *)
  544.     pointer:ADDRESS;        (* Stack pointer at switch point *)      
  545.   END;
  546.  
  547. CONST
  548. (*----- Predefined Signals -------------------------------------*)
  549.  
  550.   sigAbort  = 0;
  551.   sigChild  = 1;
  552.   sigBlit   = 4;
  553.   sigSingle = 4;
  554.   sigIntuition = 5;
  555.   sigNet    = 7;
  556.   sigDos    = 8;
  557.  
  558.  
  559. TYPE
  560. (* mp_Flags: Port arrival actions (PutMsg) *)
  561.   MsgPortAction=(signal, softint, ignore);
  562.  
  563.  IntFlags=(
  564.     tbeInt,dskblk,ifSoftint,ports,coper,vertb,blit,aud0i,
  565.     aud1i,aud2i,aud3i,rbfInt,disksync,exter,inten,intSet
  566.   );
  567.   Interrupt=RECORD
  568.     node:Node;
  569.     data:ADDRESS;   (* server data segment  *)
  570.     code:PROC;      (* server code entry    *)
  571.   END;
  572.  
  573. (****** MsgPort *****************************************************)
  574.   MsgPort=RECORD
  575.     node:Node;
  576.     CASE flags:MsgPortAction OF
  577.     | signal:
  578.       sigBit:SHORTCARD;         (* signal bit number    *)
  579.       sigTask:TaskPtr;          (* object to be signalled *)
  580.     | softint:
  581.       pad0:BYTE;
  582.       softInt:InterruptPtr;
  583.     | ignore:
  584.       pad1:BYTE;
  585.       pad2:ADDRESS
  586.     END;
  587.     msgList:List;               (* message linked list    *)
  588.   END;
  589.  
  590.   Message=RECORD
  591.     node:Node;
  592.     replyPort:MsgPortPtr; (* message reply port *)
  593.     length:CARDINAL;      (* total message length, in bytes *)
  594.                           (* (include the size of the Message *)
  595.                           (* structure in the length) *)
  596.   END;
  597.  
  598.   IntVector=RECORD  (* For EXEC use ONLY! *)
  599.     data:ADDRESS;
  600.     code:PROC;
  601.     node:NodePtr;
  602.   END;
  603.   SoftIntList=RECORD  (* For EXEC use ONLY! *)
  604.     list:List;
  605.     pad:WORD;
  606.   END;
  607.  
  608. CONST
  609. (* this is a fake INT definition, used only for AddIntServer and the like *)
  610.  nmi=15;
  611.  
  612. TYPE
  613. (****** SignalSemaphore *********************************************)
  614.  
  615.   SemaphoreRequest=RECORD
  616.     link:MinNode;
  617.     waiter:TaskPtr;
  618.   END;
  619.  
  620. (* Signal Semaphore data structure *)
  621.   SignalSemaphore=RECORD
  622.     link:Node;
  623.     nestCount:INTEGER;
  624.     waitQueue:MinList;
  625.     multipleLink:SemaphoreRequest;
  626.     owner:TaskPtr;
  627.     queueCount:INTEGER;
  628.   END;
  629.  
  630. (****** Semaphore procure message (for use in V39 Procure/Vacate ****)
  631.   SemaphoreMessage=RECORD
  632.     message:Message;
  633.     semaphore:SignalSemaphorePtr;
  634.   END;
  635.  
  636. CONST
  637.   shared=1;
  638.   exclusive=0;
  639.  
  640. (****** Semaphore (Old Procure/Vacate type, not reliable) ***********)
  641. TYPE
  642.   Semaphore=RECORD
  643.     msgPort:MsgPort;
  644.     bids:INTEGER;
  645.   END;
  646.  
  647. (* Libraries *)
  648. (*------ Special Constants ---------------------------------------*)
  649.  
  650. CONST
  651.   vectSize=6;       (* Each library entry takes 6 bytes *)
  652.   reserved=4;       (* Exec reserves the first 4 vectors *) 
  653.   base=-vectSize;
  654.   userDef=base-reserved*vectSize;
  655.   nonStd=userDef;
  656.  
  657. (*------ Standard Functions --------------------------------------*)
  658.   open=-6;
  659.   close=-12;
  660.   expunge=-18;
  661.   extFunc=-24;
  662.  
  663. TYPE
  664.  (* lib_Flags bit definitions (all others are system reserved) *)
  665.   LibFlags=(summing,changed,sumUsed,delExp);
  666.   LibFlagSet=SET OF LibFlags;
  667.  
  668. (*------ Library Base Structure ----------------------------------*)
  669. (* Also used for Devices and some Resources *)
  670.  
  671.   Library=RECORD
  672.     node:Node;
  673.     flags:LibFlagSet;
  674.     pad:BYTE;
  675.     negSize:CARDINAL;   (* number of bytes before library *)
  676.     posSize:CARDINAL;   (* number of bytes after library *)
  677.     version:CARDINAL;   (* major *)
  678.     revision:CARDINAL;  (* minor *)
  679.     idString:ADDRESS;   (* ASCII identification *)
  680.     sum:LONGCARD;       (* the checksum itself *)
  681.     openCnt:CARDINAL;   (* number of current opens *)                
  682.   END; (* Warning: size is not a longword multiple! *)
  683.  
  684. (****** Device ******************************************************)
  685. TYPE
  686.   Device=RECORD
  687.     library:Library;
  688.   END;
  689.  
  690. (****** Unit ********************************************************)
  691.   UnitFlags=(active,inTask,uf2,uf3,uf4,uf5,uf6,uf7);
  692.   UnitFlagSet=SET OF UnitFlags;
  693.  
  694.   Unit=RECORD
  695.     msgPort:MsgPort; (* queue for unprocessed messages *)
  696.                      (* instance of msgport is recommended *)
  697.     flags:UnitFlagSet;
  698.     pad:BYTE;
  699.     openCnt:CARDINAL; (* number of active opens *)
  700.   END;
  701.  
  702. (** IO ***)
  703.   IORequest=RECORD
  704.     message:Message;
  705.     device:DevicePtr;
  706.     unit:UnitPtr;
  707.     command:CARDINAL;
  708.     flags:SHORTSET;
  709.     error:SHORTINT;
  710.   END;
  711.   IOStdReq=RECORD
  712.     message:Message;
  713.     device:DevicePtr;
  714.     unit:UnitPtr;
  715.     command:CARDINAL;
  716.     flags:SHORTSET;
  717.     error:SHORTINT;
  718.     actual:LONGCARD;
  719.     length:LONGINT;
  720.     data:ADDRESS;
  721.     offset:LONGCARD;
  722.   END;
  723.  
  724. CONST
  725. (* library vector offsets for device reserved vectors *)
  726.  
  727.   beginIO=-30;
  728.   abortIO=-36;
  729.  
  730. (* io_Flags defined bits *)
  731.   quick=SHORTSET{};
  732.  
  733.   invalid=0;
  734.   reset=1;
  735.   read=2;
  736.   write=3;
  737.   update=4;
  738.   clear=5;
  739.   stop=6;
  740.   start=7;
  741.   flush=8;
  742.  
  743.   nonstd=9;
  744.  
  745. (* Definition of the Exec library base structure (pointed to by location 4).
  746. ** Most fields are not to be viewed or modified by user programs.  Use
  747. ** extreme caution.
  748. *)
  749.  
  750. TYPE
  751. (****** Bit defines for AttnFlags ******************************)
  752.  
  753.   AttnFlags=(
  754.     m68010,m68020,m68030,m68040,m68881,m68882,fpu40,
  755.     m68060,reserved8,reserved9,af10,af11,af12,af13,af14,private
  756.   );
  757.   (*
  758.    * The AFB_FPU40 bit is set when a working 68040 FPU
  759.    * is in the system.  If this bit is set and both the
  760.    * AFB_68881 and AFB_68882 bits are not set, then the 68040
  761.    * math emulation code has not been loaded and only 68040
  762.    * FPU instructions are available.  This bit is valid *ONLY*
  763.    * if the AFB_68040 bit is set.
  764.    *)
  765.   AttnFlagSet=SET OF AttnFlags;
  766.  
  767. (****** Selected flag definitions for Cache manipulation calls **********)
  768.  
  769.   CacheFlags=(
  770.     enableI,            (* Enable instruction cache *)
  771.     freezeI,            (* Freeze instruction cache *)
  772.     cf2,
  773.     clearI,             (* Clear instruction cache  *)
  774.     ibe,                (* Instruction burst enable *)
  775.     cf5,cf6,cf7,
  776.     enableD,            (* 68030 Enable data cache  *)
  777.     freezeD,            (* 68030 Freeze data cache  *)
  778.     cf10,
  779.     clearD,             (* 68030 Clear data cache     *)
  780.     dbe,                (* 68030 Data burst enable *)
  781.     writeAllocate,      (* 68030 Write-Allocate mode
  782.                            (must always be set!)     *)
  783.     cf14,cf15,cf16,cf17,cf18,cf19,cf20,cf21,cf22,cf23,cf24,cf25,cf26,
  784.     cf27,cf28,cf29,
  785.     enableE,         (* Master enable for external caches *)
  786.                      (* External caches should track the *)
  787.                      (* state of the internal caches *)
  788.                      (* such that they do not cache anything *)
  789.                      (* that the internal cache turned off *)
  790.                      (* for. *)
  791.     copyBack         (* Master enable for copyback caches *)
  792.   );
  793.   CacheFlagSet=SET OF CacheFlags;
  794.  
  795.  
  796.   ExecBase=RECORD
  797.     libNode:Library;        (* Standard library node *)
  798.     softVer:CARDINAL;       (* kickstart release number (obs.) *)
  799.     lowMemChkSum:INTEGER;   (* checksum of 68000 trap vectors *)
  800.     chkBase:LONGCARD;       (* system base pointer complement *)
  801.     coldCapture:ADDRESS;    (* coldstart soft capture vector *)
  802.     coolCapture:ADDRESS;    (* coolstart soft capture vector *)
  803.     warmCapture:ADDRESS;    (* warmstart soft capture vector *)
  804.     sysStkUpper:ADDRESS;    (* system stack base   (upper bound) *)
  805.     sysStkLower:ADDRESS;    (* top of system stack (lower bound) *)
  806.     maxLocMem:LONGCARD;     (* top of chip memory *)
  807.     debugEntry:ADDRESS;     (* global debugger entry point *)
  808.     debugData:ADDRESS;      (* global debugger data segment *)
  809.     alertData:ADDRESS;      (* alert data segment *)
  810.     maxExtMem:ADDRESS;      (* top of extended mem, or null if none *)
  811.     chkSum:CARDINAL;        (* for all of the above (minus 2) *)
  812.     intVects:ARRAY IntFlags OF IntVector;
  813.     thisTask:TaskPtr;       (* pointer to current task (readable) *)
  814.     idleCount:LONGCARD;     (* idle counter *)
  815.     dispCount:LONGCARD;     (* dispatch counter *)
  816.     quantum:CARDINAL;       (* time slice quantum *)
  817.     elapsed:CARDINAL;       (* current quantum ticks *)
  818.     sysFlags:CARDINAL;      (* misc internal system flags *)
  819.     idNestCnt:SHORTINT;     (* interrupt disable nesting count *)
  820.     tdNestCnt:SHORTINT;     (* task disable nesting count *)          
  821.     attnFlags:AttnFlagSet;  (* special attention flags (readable) *)
  822.     attnResched:CARDINAL;   (* rescheduling attention *)
  823.     resModules:ADDRESS;     (* resident module array pointer *)
  824.     taskTrapCode:PROC;
  825.     taskExceptCode:PROC;
  826.     taskExitCode:PROC;
  827.     taskSigAlloc:LONGSET;
  828.     taskTrapAlloc:BITSET;
  829.     (* private *)
  830.     memList:List;
  831.     resourceList:List;
  832.     deviceList:List;
  833.     intrList:List;
  834.     libList:List;
  835.     portList:List;
  836.     taskReady:List;
  837.     taskWait:List;
  838.     softInts:ARRAY [0..4] OF SoftIntList;
  839.     lastAlert:ARRAY [0..3] OF LONGINT;
  840.  
  841.     (* these next two variables are provided to allow
  842.     ** system developers to have a rough idea of the
  843.     ** period of two externally controlled signals --
  844.     ** the time between vertical blank interrupts and the
  845.     ** external line rate (which is counted by CIA A's
  846.     ** "time of day" clock).  In general these values
  847.     ** will be 50 or 60, and may or may not track each
  848.     ** other.  These values replace the obsolete AFB_PAL
  849.     ** and AFB_50HZ flags.
  850.     *)
  851.  
  852.     vBlankFrequency:SHORTCARD;   (* (readable) *)
  853.     powerSupplyFrequency:SHORTCARD;  (* (readable) *)
  854.  
  855.     semaphoreList:List;
  856.  
  857.     (* these next two are to be able to kickstart into user ram.
  858.     ** KickMemPtr holds a singly linked list of MemLists which
  859.     ** will be removed from the memory list via AllocAbs.  If
  860.     ** all the AllocAbs's succeeded, then the KickTagPtr will
  861.     ** be added to the rom tag list.
  862.     *)
  863.     kickMemPtr:ADDRESS;     (* ptr to queue of mem lists *)
  864.     kickTagPtr:ADDRESS;     (* ptr to rom tag queue *)
  865.     kickCheckSum:LONGCARD;    (* checksum for mem and tags *)
  866.  
  867. (****** V36 Exec additions start here **************************************)
  868.  
  869.     pad0:CARDINAL;          (* Private internal use *)
  870.     launchPoint:LONGCARD;   (* Private to Launch/Switch *)
  871.     ramLibPrivate:ADDRESS;
  872.     (* The next ULONG contains the system "E" clock frequency,
  873.     ** expressed in Hertz.    The E clock is used as a timebase for
  874.     ** the Amiga's 8520 I/O chips. (E is connected to "02").
  875.     ** Typical values are 715909 for NTSC, or 709379 for PAL.
  876.     *)
  877.     eClockFrequency:LONGCARD;       (* (readable) *)
  878.     cacheControl:CacheFlagSet;      (* Private to CacheControl calls *)
  879.     taskId:LONGCARD;                (* Next available task ID *)            
  880.  
  881.     puddleSize:LONGCARD;
  882.     poolThreshold:LONGCARD;
  883.     publicPool:MinList;
  884.     mmuLock:ADDRESS;                (* private *)
  885.     reserved:ARRAY[0..11] OF BYTE;
  886.  
  887. (****** V39 Exec additions start here **************************************)
  888.     (* The following list and data element are used
  889.      * for V39 exec's low memory handler...
  890.      *)
  891.     memHandlers:MinList;        (* The handler list *)
  892.     memHandler:ADDRESS;         (* Private! handler pointer *)
  893.   END;
  894.  
  895. CONST
  896.     dmaContinue=1;  (* Continuation flag for CachePreDMA *)
  897.     dmaNoModify=2;  (* Set if DMA does not update memory *)
  898.     
  899. VAR
  900.   execBase[4]:ExecBasePtr;
  901.  
  902. END ExecD.
  903.