home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / inc&ad2.0 / text_autodocs / expansion.doc < prev    next >
Text File  |  1992-09-01  |  22KB  |  766 lines

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