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

  1. TABLE OF CONTENTS
  2.  
  3. misc.resource/MR_ALLOCMISCRESOURCE
  4. misc.resource/MR_FREEMISCRESOURCE
  5.  
  6. misc.resource/MR_ALLOCMISCRESOURCE           misc.resource/MR_ALLOCMISCRESOURCE
  7.  
  8.     NAME
  9.     MR_ALLOCMISCRESOURCE - allocate one of the misc resources
  10.  
  11.     SYNOPSIS
  12.        CurrentUser = MR_ALLOCMISCRESOURCE( unitNum, name ), misc.resource
  13.        D0                               D0       A1      A6
  14.  
  15.     STRPTR CurrentUser;
  16.     LONG unitNum;
  17.     STRPTR name;
  18.  
  19.     FUNCTION
  20.     This routine allocates one of the miscellaneous resources.
  21.     If the resource is currently allocated, an error is returned.
  22.     If you do get it, your name is associated with the resource
  23.     (so a user can see who has it allocated).
  24.  
  25.     This routine may not be called from an interrupt routine
  26.  
  27.     DESCRIPTION
  28.     There are certain parts of the hardware that a multitasking-
  29.     friendly program may need to take over.  The serial port
  30.     is a good example.  By grabbing the misc.resource for the
  31.     serial port, the caller would "own" the hardware registers
  32.     associated with that function.  Nobody else, including the
  33.     system serial driver is allowed to interfere.
  34.  
  35.     The misc.resource must be accessed using assembly language.  The set
  36.     of currently defined units and the function offsets from the resource 
  37.     base are listed in the resources/misc.i include file.
  38.  
  39.     INPUTS
  40.     unitNum - the number of the resource you want to allocate
  41.           (eg.  MR_SERIALBITS).
  42.     name - a mnenonic name that will help the user figure out
  43.         what piece of software is hogging a resource.
  44.         (havoc breaks out if a name of null is passed in...)
  45.  
  46.     RESULTS
  47.     CurrentUser - if the resource is busy, then the name of
  48.         the current user is returned.  If the resource is
  49.         free, then null is returned.
  50.  
  51.     BUGS
  52.  
  53.     SEE ALSO
  54.         resources/misc.i
  55.     misc.resource/MR_FREEMISCRESOURCE 
  56.  
  57. misc.resource/MR_FREEMISCRESOURCE             misc.resource/MR_FREEMISCRESOURCE
  58.  
  59.     NAME
  60.     MR_FREEMISCRESOURCE - make a resource available for reallocation
  61.  
  62.     SYNOPSIS
  63.         MR_FREEMISCRESOURCE( unitNum ), misc.resource
  64.                              D0         A6
  65.     LONG unitNum;
  66.  
  67.     FUNCTION
  68.     This routine frees one of the resources allocated
  69.     by MR_ALLOCMISCRESOURCE.  The resource is made available
  70.     for reuse.
  71.  
  72.     This routine may not be called from an interrupt routine.
  73.  
  74.     INPUTS
  75.     unitNum - the number of the miscellaneous resource to be freed.
  76.  
  77.     RESULTS
  78.     Frees the appropriate resource.
  79.  
  80.     BUGS
  81.  
  82.     SEE ALSO
  83.     misc.resource/MR_ALLOCMISCRESOURCE
  84.