home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD1.3 / Text_Autodocs / expansion.doc < prev    next >
Encoding:
Text File  |  1992-09-12  |  22.8 KB  |  903 lines

  1. TABLE OF CONTENTS
  2.  
  3. expansion.library/AddDosNode
  4. expansion.library/MakeDosNode
  5. expansion.library/AddConfigDev
  6. expansion.library/AllocBoardMem
  7. expansion.library/AllocConfigDev
  8. expansion.library/AllocExpansionMem
  9. expansion.library/ConfigBoard
  10. expansion.library/ConfigChain
  11. expansion.library/FindConfigDev
  12. expansion.library/FreeBoardMem
  13. expansion.library/FreeConfigDev
  14. expansion.library/FreeExpansionMem
  15. expansion.library/GetCurrentBinding
  16. expansion.library/ObtainConfigBinding
  17. expansion.library/ReadExpansionByte
  18. expansion.library/ReadExpansionRom
  19. expansion.library/ReleaseConfigBinding
  20. expansion.library/RemConfigDev
  21. expansion.library/SetCurrentBinding
  22. expansion.library/WriteExpansionByte
  23.  
  24. expansion.library/AddDosNode                       expansion.library/AddDosNode
  25.  
  26.    NAME
  27.     AddDosNode -- mount a disk to the system
  28.  
  29.    SYNOPSIS
  30.     ok = AddDosNode( bootPri, flags, deviceNode )
  31.     D0               D0       D1     A0
  32.  
  33.    FUNCTION
  34.     This routine makes sure that your disk device (or a device
  35.     that wants to be treated as if it was a disk...) will be
  36.     entered into the system.  If the dos is already up and
  37.     running, then it will be entered immediately.  If the dos
  38.     has not yet been run then the data will be recorded, and the
  39.     dos will get it later.
  40.  
  41.     We hope to eventually try and boot off a disk device.  We will
  42.     try and boot off of each device in turn, based on priority,
  43.     iff there is no boot floppy in the floppy disk drive.  As of
  44.     this writing that facility does not yet exist.
  45.  
  46.     There is only one additional piece of magic done by AddDosNode.
  47.     If there is no executable code specified in the deviceNode
  48.     structure (e.g. dn_SegList, dn_Handler, and dn_Task are all
  49.     null) then the standard dos file handler is used for your
  50.     device.
  51.  
  52.     Documentation note: a "task" as used here is a dos-task, not
  53.     an exec-task.  A dos-task, in the strictest sense, is the
  54.     address of an exec-style message port.  In general, it is
  55.     a pointer to a process's pr_MsgPort field (e.g. a constant
  56.     number of bytes after an exec port).
  57.  
  58.    INPUTS
  59.     bootPri -- a BYTE quantity with the boot priority for this disk.
  60.         This priority is only for which disks should be looked at:
  61.         the actual disk booted from will be the first disk with
  62.         a valid boot block.  If no disk is found then the "bootme"
  63.         hand will come up and the bootstrap code will wait for
  64.         a floppy to be inserted.  Recommend priority assignments are:
  65.  
  66.         +5 -- unit zero for the floppy disk.  The floppy should
  67.             always be highest priority to allow the user to
  68.             abort out of a hard disk boot.
  69.         0 -- the run of the mill hard disk
  70.         -5 -- a "network" disk (local disks should take priority).
  71.         -128 -- don't even bother to boot from this device.
  72.  
  73.     flags -- additional flag bits for the call:
  74.         ADN_STARTPROC (bit 0) -- start a handler process immediately.
  75.             Normally the process is started only when the device node
  76.         is first referenced.  This bit is meaningless if you
  77.         have already specified a handler process (non-null dn_Task).
  78.  
  79.     deviceNode -- a legal DOS device node, properly initialized.
  80.         Typically this will be the result of a MakeDosNode()
  81.         call, but feel free to manufacture your own if you need
  82.         to.  If deviceNode is null then AddDosNode does nothing.
  83.  
  84.  
  85.    RESULTS
  86.     ok - non-zero everything went ok, zero if we ran out of memory
  87.         or some other weirdness happened.
  88.  
  89.    EXAMPLES
  90.  
  91.  
  92.     /* enter a bootable disk into the system.  Start a file handler
  93.     ** process immediately.
  94.     */
  95.     AddDosNode( 0, ADNF_STARTPROC, MakeDosNode( paramPacket ) );
  96.  
  97.    BUGS
  98.     The flexible boot strategy is only that -- strategy.  It still
  99.     needs to be reflected in code somewhere.
  100.  
  101.    SEE ALSO
  102.     MakeDosNode
  103.  
  104.    BUGS
  105.  
  106.  
  107. expansion.library/MakeDosNode                     expansion.library/MakeDosNode
  108.  
  109.    NAME
  110.     MakeDosNode -- construct dos data structures that a disk needs
  111.  
  112.    SYNOPSIS
  113.     deviceNode = MakeDosNode( parameterPkt )
  114.     D0                        A0
  115.  
  116.    FUNCTION
  117.     This routine manufactures the data structures needed to enter
  118.     a dos disk device into the system.  This consists of a DeviceNode,
  119.     a FileSysStartupMsg, a disk environment vector, and up to two
  120.     bcpl strings.  See the libraries/dosextens and libraries/filehandler
  121.     include files for more information.
  122.  
  123.     MakeDosNode will allocate all the memory it needs, and then
  124.     link the various structure together.  It will make sure all
  125.     the structures are long-word aligned (as required by the DOS).
  126.     It then returns the information to the user so he can
  127.     change anything else that needs changing.  Typically he will
  128.     then call AddDosNode() to enter the new device into the dos
  129.     tables.
  130.  
  131.    INPUTS
  132.     parameterPkt - a longword array containing all the information
  133.         needed to initialize the data structures.  Normally I
  134.         would have provided a structure for this, but the variable
  135.         length of the packet caused problems.  The two strings are
  136.         null terminated strings, like all other exec strings.
  137.  
  138.         longword    description
  139.         --------    -----------
  140.         0        string with dos handler name
  141.         1        string with exec device name
  142.         2        unit number (for OpenDevice)
  143.         3        flags (for OpenDevice)
  144.         4        # of longwords in rest of enviroment
  145.         5-n        file handler environment (see libraries/filehandler.h)
  146.  
  147.    RESULTS
  148.     deviceNode - pointer to initialize device node structure, or
  149.         null if there was not enough memory.
  150.  
  151.    EXAMPLES
  152.     /* set up a 3.5" amiga format floppy drive for unit 1 */
  153.  
  154.     char execName[] = "trackdisk.device";
  155.     char dosName[] = "df1";
  156.  
  157.     ULONG parmPkt[] = {
  158.         (ULONG) dosName,
  159.         (ULONG) execName,
  160.         1,            /* unit number */
  161.         0,            /* OpenDevice flags */
  162.  
  163.         /* here is the environment block */
  164.         11,            /* table upper bound */
  165.         512>>2,        /* # longwords in a block */
  166.         0,            /* sector origin -- unused */
  167.         2,            /* number of surfaces */
  168.         1,            /* secs per logical block -- unused */
  169.         11,            /* secs per track */
  170.         2,            /* reserved blocks -- 2 boot blocks */
  171.         0,            /* ?? -- unused */
  172.         0,            /* interleave */
  173.         0,            /* lower cylinder */
  174.         79,            /* upper cylinder */
  175.         5,            /* number of buffers */
  176.     };
  177.  
  178.     struct Device Node *node, *MakeDosNode();
  179.  
  180.     node = MakeDosNode( parmPkt );
  181.  
  182.    BUGS
  183.  
  184.    SEE ALSO
  185.     AddDosNode
  186.  
  187.  
  188. expansion.library/AddConfigDev
  189.  
  190.    NAME
  191.     AddConfigDev - add a new ConfigDev structure to the system
  192.  
  193.    SYNOPSIS
  194.     AddConfigDev( configDev )
  195.                   A0
  196.  
  197.    FUNCTION
  198.     This routine adds the specified ConfigDev structure to the
  199.     list of Configuration Devices in the system.
  200.  
  201.    INPUTS
  202.     configDev - a valid ConfigDev structure.
  203.  
  204.    RESULTS
  205.  
  206.    EXCEPTIONS
  207.  
  208.    SEE ALSO
  209.     RemConfigDev
  210.  
  211.    BUGS
  212.  
  213.  
  214. expansion.library/AllocBoardMem
  215.  
  216.    NAME
  217.     AllocBoardMem - allocate standard device expansion memory
  218.  
  219.    SYNOPSIS
  220.     startSlot = AllocBoardMem( slotSpec )
  221.     D0                         D0
  222.  
  223.    FUNCTION
  224.     This function allocates numslots of expansion space (each slot
  225.     is E_SLOTSIZE bytes).  It returns the slot number of the
  226.     start of the expansion memory.  The EC_MEMADDR macro may be
  227.     used to convert this to a memory address.
  228.  
  229.     AllocBoardMem() knows about the intracacies of expansion
  230.     board hardware and will allocate the proper expansion
  231.     memory for each board type.
  232.  
  233.    INPUTS
  234.     slotSpec - the memory size field of the Type byte of
  235.         an expansion board
  236.  
  237.    RESULTS
  238.     startSlot - the slot number that was allocated, or -1 for error.
  239.  
  240.    EXAMPLES
  241.  
  242.         struct ExpansionRom *er;
  243.         slot = AllocBoardMem( er->er_Type & ERT_MEMMASK )
  244.  
  245.    EXCEPTIONS
  246.     Not typically called by user code.
  247.  
  248.    SEE ALSO
  249.     AllocExpansionMem, FreeExpansionMem, FreeBoardMem
  250.  
  251.    BUGS
  252.  
  253.  
  254. expansion.library/AllocConfigDev
  255.  
  256.    NAME
  257.     AllocConfigDev - allocate a ConfigDev structure
  258.  
  259.    SYNOPSIS
  260.     configDev = AllocConfigDev()
  261.     D0
  262.  
  263.    FUNCTION
  264.     This routine returns the address of a ConfigDev structure.
  265.     It is provided so new fields can be added to the structure
  266.     without breaking old, existing code.  The structure is cleared
  267.     when it is returned to the user.
  268.  
  269.    INPUTS
  270.  
  271.    RESULTS
  272.     configDev - either a valid ConfigDev structure or NULL.
  273.  
  274.    EXCEPTIONS
  275.  
  276.    SEE ALSO
  277.     FreeConfigDev
  278.  
  279.    BUGS
  280.  
  281.  
  282. expansion.library/AllocExpansionMem
  283.  
  284.    NAME
  285.     AllocExpansionMem - allocate expansion memory
  286.  
  287.    SYNOPSIS
  288.     startSlot = AllocExpansionMem( numSlots, slotOffset )
  289.     D0                             D0        D1
  290.  
  291.    FUNCTION
  292.     This function allocates numslots of expansion space (each slot
  293.     is E_SLOTSIZE bytes).  It returns the slot number of the
  294.     start of the expansion memory.  The EC_MEMADDR macro may be
  295.     used to convert this to a memory address.
  296.  
  297.     Boards that fit the expansion architecture have alignment
  298.     rules.  Normally a board must be on a binary boundary of its
  299.     size.  Four and Eight megabyte boards have special rules.
  300.     User defined boards might have other special rules.
  301.  
  302.     The routine AllocBoardMem() knows about all the allocation
  303.     rules for standard boards.  Most users will want to use
  304.     that routine if they want memory for a standard expansion
  305.     device.
  306.  
  307.     If AllocExpansionMem() succeeds, the startSlot will satisfy
  308.     the following equation:
  309.  
  310.         (startSlot - slotOffset) MOD slotAlign = 0
  311.  
  312.    INPUTS
  313.     numSlots - the number of slots required.
  314.     slotOffset - an offset from that boundary for startSlot.
  315.  
  316.    RESULTS
  317.     startSlot - the slot number that was allocated, or -1 for error.
  318.  
  319.    EXAMPLES
  320.  
  321.         AllocExpansionMem( 2, 0 )
  322.  
  323.     Tries to allocate 2 slots on a two slot boundary.
  324.  
  325.         AllocExpansionMem( 64, 32 )
  326.  
  327.     This is the allocation rule for 4 meg boards.  It allocates
  328.     4 megabytes (64 slots) on an odd 2 meg boundary.
  329.  
  330.    EXCEPTIONS
  331.     Not typically called by user code.
  332.  
  333.    SEE ALSO
  334.     FreeExpansionMem, AllocBoardMem, FreeBoardMem
  335.  
  336.    BUGS
  337.  
  338.  
  339. expansion.library/ConfigBoard
  340.  
  341.    NAME
  342.     ConfigBoard - configure a board
  343.  
  344.    SYNOPSIS
  345.     error = ConfigBoard( board, configDev )
  346.     D0                   A0     A1
  347.  
  348.    FUNCTION
  349.     This routine configures an expansion board.  The board
  350.     will generally live at E_EXPANSIONBASE, but the base is
  351.     passed as a parameter to allow future compatibility.
  352.     The configDev parameter must be a valid configDev that
  353.     has already had ReadExpansionRom() called on it.
  354.  
  355.     ConfigBoard will allocate expansion memory and place
  356.     the board at its new address.  It will update configDev
  357.     accordingly.  If there is not enough expansion memory
  358.     for this board then an error will be returned.
  359.  
  360.    INPUTS
  361.     board - the current address that the expansion board is
  362.         responding.
  363.     configDev - an initialized ConfigDev structure.
  364.  
  365.    RESULTS
  366.     error - non-zero if there was a problem configuring this board
  367.  
  368.    EXCEPTIONS
  369.         Not normally called by user code
  370.  
  371.    SEE ALSO
  372.     FreeConfigDev
  373.  
  374.    BUGS
  375.  
  376.  
  377. expansion.library/ConfigChain
  378.  
  379.    NAME
  380.     ConfigChain - configure the whole damn system
  381.  
  382.    SYNOPSIS
  383.     error = ConfigChain( baseAddr )
  384.     D0                   A0
  385.  
  386.    FUNCTION
  387.     This is the big one!  This routine will take a base address
  388.     (generally E_EXPANSIONBASE) and configure all the devices that
  389.     live there.  This routine will call all the other routines
  390.     that might need to be called.  All boards that are found will
  391.     be linked into the configuration list.
  392.  
  393.    INPUTS
  394.     baseAddr - the base address to start looking for boards.
  395.  
  396.    RESULTS
  397.     error - non-zero if something went wrong.
  398.  
  399.    EXCEPTIONS
  400.         Not normally called by user code
  401.  
  402.    SEE ALSO
  403.     FreeConfigDev
  404.  
  405.    BUGS
  406.  
  407.  
  408. expansion.library/FindConfigDev
  409.  
  410.    NAME
  411.     FindConfigDev - find a matching ConfigDev entry
  412.  
  413.    SYNOPSIS
  414.     configDev = FindConfigDev( oldConfigDev, manufacturer, product )
  415.     D0                         A0            D0            D1
  416.  
  417.    FUNCTION
  418.     This routine searches the list of existing ConfigDev
  419.     structures in the system and looks for one that has
  420.     the specified manufacturer and product codes.
  421.  
  422.     If the oldConfigDev is NULL the the search is from the
  423.     start of the list of configuration devices.  If it is
  424.     not null then it searches from the first configuration
  425.     device entry AFTER oldConfigDev.
  426.  
  427.     A code of -1 is treated as a wildcard -- e.g. it matches
  428.     any manufacturer (or product)
  429.  
  430.    INPUTS
  431.     oldConfigDev - a valid ConfigDev structure, or NULL to start
  432.         from the start of the list.
  433.     manufacturer - the manufacturer code being searched for, or
  434.         -1 to ignore manufacturer numbers.
  435.     product - the product code being searched for, or -1 to
  436.         ignore product numbers.
  437.  
  438.    RESULTS
  439.     configDev - the next ConfigDev entry that matches the
  440.         manufacturer and product codes, or NULL if there
  441.         are no more matches.
  442.  
  443.    EXCEPTIONS
  444.  
  445.    EXAMPLES
  446.     /* to find all configdevs of the proper type */
  447.     struct ConfigDev *cd = NULL;
  448.  
  449.     while( cd = FindConfigDev( cd, MANUFACTURER, PRODUCT ) ) {
  450.         /* do something with the returned ConfigDev */
  451.     }
  452.  
  453.    SEE ALSO
  454.  
  455.    BUGS
  456.  
  457.  
  458. expansion.library/FreeBoardMem
  459.  
  460.    NAME
  461.     FreeBoardMem - allocate standard device expansion memory
  462.  
  463.    SYNOPSIS
  464.     FreeBoardMem( startSlot, slotSpec )
  465.                   D0         D1
  466.  
  467.    FUNCTION
  468.     This function frees numslots of expansion space (each slot
  469.     is E_SLOTSIZE bytes).  It is the inverse function of
  470.     AllocBoardMem().
  471.  
  472.    INPUTS
  473.     startSlot - a slot number in expansion space.
  474.     slotSpec - the memory size field of the Type byte of
  475.         an expansion board
  476.  
  477.    RESULTS
  478.  
  479.    EXAMPLES
  480.  
  481.     struct ExpansionRom *er;
  482.     int startSlot;
  483.     int slotSpec;
  484.  
  485.     slotSpec = er->er_Type & ERT_MEMMASK;
  486.     startSlot = AllocBoardMem( er->er_Type & ERT_MEMMAK );    
  487.  
  488.     if( startSlot != -1 ) {
  489.         FreeBoardMem( startSlot, slotSpec );
  490.     }
  491.  
  492.    EXCEPTIONS
  493.     If the caller tries to free a slot that is already in the
  494.     free list, FreeBoardMem will Alert() (e.g. crash the
  495.     system).
  496.  
  497.         Not normally called by user code
  498.  
  499.    SEE ALSO
  500.     AllocExpansionMem, FreeExpansionMem, AllocBoardMem
  501.  
  502.    BUGS
  503.  
  504.  
  505. expansion.library/FreeConfigDev
  506.  
  507.    NAME
  508.     FreeConfigDev - allocate a ConfigDev structure
  509.  
  510.    SYNOPSIS
  511.     FreeConfigDev( configDev )
  512.                    A0
  513.  
  514.    FUNCTION
  515.     This routine frees a ConfigDev structure as returned by
  516.     AllocConfigDev.
  517.  
  518.    INPUTS
  519.     configDev - a valid ConfigDev structure.
  520.  
  521.    RESULTS
  522.  
  523.    EXCEPTIONS
  524.  
  525.    SEE ALSO
  526.     AllocConfigDev
  527.  
  528.    BUGS
  529.  
  530.  
  531. expansion.library/FreeExpansionMem
  532.  
  533.    NAME
  534.     FreeExpansionMem - allocate standard device expansion memory
  535.  
  536.    SYNOPSIS
  537.     FreeExpansionMem( startSlot, numSlots )
  538.                       D0         D1
  539.  
  540.    FUNCTION
  541.     This function allocates numslots of expansion space (each slot
  542.     is E_SLOTSIZE bytes).  It is the inverse function of
  543.     AllocExpansionMem().
  544.  
  545.    INPUTS
  546.     startSlot - the slot number that was allocated, or -1 for error.
  547.     numSlots - the number of slots to be freed.
  548.  
  549.    RESULTS
  550.  
  551.    EXAMPLES
  552.  
  553.    EXCEPTIONS
  554.     If the caller tries to free a slot that is already in the
  555.     free list, FreeExpansionMem will Alert() (e.g. crash the
  556.     system).
  557.  
  558.         Not normally called by user code
  559.  
  560.    SEE ALSO
  561.     AllocExpansionMem, AllocBoardMem, FreeBoardMem
  562.  
  563.    BUGS
  564.  
  565.  
  566. expansion.library/GetCurrentBinding
  567.  
  568.    NAME
  569.     GetCurrentBinding - sets static board configuration area
  570.  
  571.    SYNOPSIS
  572.     actual = GetCurrentBinding( currentBinding, size )
  573.                                 A0              D0:16
  574.  
  575.    FUNCTION
  576.     This function writes the contents of the "currentBinding"
  577.     structure out of a private place.  It may be set via
  578.     SetCurrentBinding().  This is really a kludge, but it is
  579.     the only way to pass extra arguments to a newly configured
  580.     device.
  581.  
  582.     A CurrentBinding structure has the name of the currently
  583.     loaded file, the product string that was associated with
  584.     this driver, and a pointer to the head of a singly linked
  585.     list of ConfigDev structures (linked through the cd_NextCD
  586.     field).
  587.  
  588.     Many devices may not need this information; they have hard
  589.     coded into themselves their manufacture number.  It is
  590.     recommended that you at least check that you can deal with
  591.     the product code in the linked ConfigDev structures.
  592.  
  593.    INPUTS
  594.     currentBinding - a pointer to a CurrentBinding structure
  595.  
  596.     size - the size of the user's binddriver structure.  No
  597.         more than this much data will be copied.  If size is
  598.         larger than the libraries idea a CurrentBinding size,
  599.         then the structure will be null padded.
  600.         
  601.  
  602.    RESULTS
  603.     actual - the true size of a CurrentBinding structure is returned.
  604.  
  605.    EXAMPLES
  606.  
  607.    EXCEPTIONS
  608.  
  609.    SEE ALSO
  610.     GetCurrentBinding
  611.  
  612.    BUGS
  613.  
  614.  
  615. expansion.library/ObtainConfigBinding
  616.  
  617.    NAME
  618.     ObtainConfigBinding - try to get permission to bind drivers
  619.  
  620.    SYNOPSIS
  621.     ObtainConfigBinding()
  622.  
  623.  
  624.    FUNCTION
  625.     ObtainConfigBinding gives permission to bind drivers to
  626.     ConfigDev structures.  It exists so two drivers at once
  627.     do not try and own the same ConfigDev structure.  This
  628.     call will block until it is safe proceed.
  629.  
  630.     Individual drivers to not need to call this routine.  It
  631.     is intended for BindDriver program, and others like it.
  632.     If your drivers won't be loaded via the standard method,
  633.     you may need to lock out others.
  634.  
  635.     It is crucially important that people lock out others
  636.     before loading new drivers.  Much of the data that is used
  637.     to configure things is statically kept, and others need
  638.     to be kept from using it.
  639.  
  640.     This call is build directly on Exec SignalSemaphore code
  641.     (e.g. ObtainSemaphore).
  642.  
  643.    INPUTS
  644.  
  645.    RESULTS
  646.  
  647.    EXCEPTIONS
  648.  
  649.    SEE ALSO
  650.     ReleaseConfigBinding
  651.  
  652.    BUGS
  653.  
  654.  
  655. expansion.library/ReadExpansionByte
  656.  
  657.    NAME
  658.     ReadExpansionByte - read a byte nybble by nybble.
  659.  
  660.    SYNOPSIS
  661.     byte = ReadExpansionByte( board, offset )
  662.     D0                        A0     D0
  663.  
  664.    FUNCTION
  665.     ReadExpansionByte reads a byte from a new-style expansion
  666.     board.  These boards have their readable data organized
  667.     as a series of nybbles in memory.  This routine reads
  668.     two nybbles and returns the byte value.
  669.  
  670.     In general, this routine will only be called by ReadExpansionRom.
  671.  
  672.     The offset is a byte offset into a ExpansionRom structure.
  673.     The actual memory address read will be four times larger.
  674.     The macros EROFFSET and ECOFFSET are provided to help get
  675.     these offsets from C.
  676.  
  677.    INPUTS
  678.     board - a pointer to the base of a new style expansion board.
  679.     offset - a logical offset from the board base
  680.  
  681.    RESULTS
  682.     byte - a byte of data from the expansion board, or -1 if there
  683.         was an error reading from the board.
  684.  
  685.    EXAMPLES
  686.     byte = ReadExpansionByte( cd->BoardAddr, EROFFSET( er_Type ) );
  687.     ints = ReadExpansionByte( cd->BoardAddr, ECOFFSET( ec_Interrupt ) );
  688.  
  689.    EXCEPTIONS
  690.     Not typically called by user code.
  691.  
  692.    SEE ALSO
  693.     WriteExpansionByte, ReadExpansionRom
  694.  
  695.    BUGS
  696.  
  697.  
  698. expansion.library/ReadExpansionRom
  699.  
  700.    NAME
  701.     ReadExpansionRom - read a boards configuration rom space
  702.  
  703.    SYNOPSIS
  704.     error = ReadExpansionRom( board, configDev )
  705.     D0                        A0     A1
  706.  
  707.    FUNCTION
  708.     ReadExpansionRom reads a the rom portion of an expansion
  709.     device in to cd_Rom portion of a ConfigDev structure.
  710.     This routine knows how to detect whether or not there is
  711.     actually a board there,
  712.  
  713.     In addition, the Rom portion of a new style expansion board
  714.     is encoded in ones-complement format (except for the first
  715.     two nybbles -- the er_Type field).  ReadExpansionRom knows
  716.     about this and un-complements the appropriate fields.
  717.  
  718.    INPUTS
  719.     board - a pointer to the base of a new style expansion board.
  720.     configDev - the ConfigDev structure that will be read in.
  721.     offset - a logical offset from the configdev base
  722.  
  723.    RESULTS
  724.     error - If the board address does not contain a valid new style
  725.         expansion board, then error will be non-zero.
  726.  
  727.    EXAMPLES
  728.  
  729.     configDev = AllocConfigDev();
  730.     if( ! configDev ) panic();
  731.  
  732.     error = ReadExpansionBoard( board, configDev );
  733.     if( ! error ) {
  734.         configDev->cd_BoardAddr = board;
  735.         ConfigBoard( configDev );
  736.     }
  737.  
  738.    EXCEPTIONS
  739.     Not typically called by user code.
  740.  
  741.    SEE ALSO
  742.     ReadExpansionByte, WriteExpansionByte
  743.  
  744.    BUGS
  745.  
  746.  
  747. expansion.library/ReleaseConfigBinding
  748.  
  749.    NAME
  750.     ReleaseConfigBinding - allow others to bind to drivers
  751.  
  752.    SYNOPSIS
  753.     ReleaseConfigBinding()
  754.     
  755.  
  756.    FUNCTION
  757.     This call should be used when you are done binding drivers
  758.     to ConfigDev entries.  It releases the SignalSemaphore; this
  759.     allows others to bind their drivers to ConfigDev structures.
  760.  
  761.    INPUTS
  762.  
  763.    RESULTS
  764.  
  765.    EXAMPLES
  766.  
  767.    EXCEPTIONS
  768.  
  769.    SEE ALSO
  770.     ObtainConfigBinding
  771.  
  772.    BUGS
  773.  
  774.  
  775. expansion.library/RemConfigDev
  776.  
  777.    NAME
  778.     RemConfigDev - remove a ConfigDev structure from the system
  779.  
  780.    SYNOPSIS
  781.     RemConfigDev( configDev )
  782.                   A0
  783.  
  784.    FUNCTION
  785.     This routine removes the specified ConfigDev structure from the
  786.     list of Configuration Devices in the system.
  787.  
  788.    INPUTS
  789.     configDev - a valid ConfigDev structure.
  790.  
  791.    RESULTS
  792.  
  793.    EXCEPTIONS
  794.  
  795.    SEE ALSO
  796.     AddConfigDev
  797.  
  798.    BUGS
  799.  
  800.  
  801. expansion.library/SetCurrentBinding
  802.  
  803.    NAME
  804.     SetCurrentBinding - sets static board configuration area
  805.  
  806.    SYNOPSIS
  807.     SetCurrentBinding( currentBinding, size )
  808.                        A0           D0:16
  809.  
  810.    FUNCTION
  811.     This function records the contents of the "currentBinding"
  812.     structure in a private place.  It may be read via
  813.     GetCurrentBinding().  This is really a kludge, but it is
  814.     the only way to pass extra arguments to a newly configured
  815.     device.
  816.  
  817.     A CurrentBinding structure has the name of the currently
  818.     loaded file, the product string that was associated with
  819.     this driver, and a pointer to the head of a singly linked
  820.     list of ConfigDev structures (linked through the cd_NextCD
  821.     field).
  822.  
  823.     Many devices may not need this information; they have hard
  824.     coded into themselves their manufacture number.  It is
  825.     recommended that you at least check that you can deal with
  826.     the product code in the linked ConfigDev structures.
  827.  
  828.    INPUTS
  829.     currentBinding - a pointer to a CurrentBinding structure
  830.  
  831.     size - the size of the user's binddriver structure.  No
  832.         more than this much data will be copied.  If size is
  833.         larger than the libraries idea a CurrentBinding size,
  834.         then the structure will be null padded.
  835.         
  836.    RESULTS
  837.  
  838.    EXAMPLES
  839.  
  840.    EXCEPTIONS
  841.  
  842.    SEE ALSO
  843.     GetCurrentBinding
  844.  
  845.    BUGS
  846.  
  847.  
  848. expansion.library/WriteExpansionByte
  849.  
  850.    NAME
  851.     WriteExpansionByte - write a byte nybble by nybble.
  852.  
  853.    SYNOPSIS
  854.     error = WriteExpansionByte( board, offset, byte )
  855.     D0                          A0     D0      D1
  856.  
  857.    FUNCTION
  858.     WriteExpansionByte write a byte to a new-style expansion
  859.     board.  These boards have their writeable data organized
  860.     as a series of nybbles in memory.  This routine writes
  861.     two nybbles in a very carefull manner to work with all
  862.     types of new expansion boards.
  863.  
  864.     To make certain types of board less expensive, an expansion
  865.     board's write registers may be organized as either a
  866.     byte-wide or nybble-wide register.  If it is nybble-wide
  867.     then it must latch the less significant nybble until the
  868.     more significant nybble is written.  This allows the
  869.     following algorithm to work with either type of board:
  870.  
  871.         write the low order nybble to bits D15-D12 of
  872.             byte (offset*4)+2
  873.  
  874.         write the entire byte to bits D15-D8 of
  875.             byte (offset*4)
  876.  
  877.     The offset is a byte offset into a ExpansionRom structure.
  878.     The actual memory address read will be four times larger.
  879.     The macros EROFFSET and ECOFFSET are provided to help get
  880.     these offsets from C.
  881.  
  882.    INPUTS
  883.     board - a pointer to the base of a new style expansion board.
  884.     offset - a logical offset from the configdev base
  885.     byte - the byte of data to be written to the expansion board.
  886.  
  887.    RESULTS
  888.     error - the routine will return a zero on success, non-zero if
  889.         there was a problem.
  890.  
  891.    EXAMPLES
  892.     err = WriteExpansionByte( cd->BoardAddr, ECOFFSET( ec_Shutup ),  0 );
  893.     err = WriteExpansionByte( cd->BoardAddr, ECOFFSET( ec_Interrupt ), 1 );
  894.  
  895.    EXCEPTIONS
  896.     Not typically called by user code.
  897.  
  898.    SEE ALSO
  899.     ReadExpansionByte, ReadExpansionRom
  900.  
  901.    BUGS
  902.  
  903.