home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-1.ZIP / GCOMM / ASISHARE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-08-14  |  1.7 KB  |  52 lines

  1. /*  asishare.c
  2.  *
  3.  * The Greenleaf Comm Library
  4.  *
  5.  * Copyright (C) 1985-1990 Greenleaf Software Inc.  All Rights Reserved.
  6.  *
  7.  *  int asishare( mask )
  8.  *  unsigned mask;      -- Mask for bits to mask as_sbmask
  9.  *
  10.  *  This function customizes the interrupt routines for use with a particular
  11.  *  Category B board by arranging that the status port data will be masked
  12.  *  before being compared with the "sh_bmask" argument to asisetv().
  13.  *
  14.  *  Because some boards (e.g. QuadBoard-AT) have bits that are high all the
  15.  *  time, it is necessary that the interrupt not see them.
  16.  *
  17.  *  NOTE:  All ports must use the same mask, this does not mean that all
  18.  *      ports must reside on shared interrupt boards, only that all of
  19.  *      the boards must be of the same type.
  20.  *
  21.  *  RETURNS:
  22.  *              ASSUCCESS always.
  23.  *
  24.  *  USAGE:
  25.  *              Call AFTER asifirst() for at least one port.
  26.  *              Call only once (other calls ignored).
  27.  *
  28.  * MODIFICATIONS
  29.  *  David Nienhiser   04-FEB-1987  16:42:33.14
  30.  *      Modified to save mask value in global variable _asmask (in asifirs.c).
  31.  *      If the data structures have not been set up this function returns
  32.  *      ASSUCCESS.  It will then be up to asifirst() to set the value in
  33.  *      the data structure when it is built.  If the data structure has been
  34.  *      setup asishare will fill all values in as before.
  35.  *
  36.  */
  37.  
  38. #include <stdio.h>
  39. #include "gf.h"
  40. #include "asiports.h"
  41.  
  42. int GF_CONV asishare( unsigned mask )
  43. {
  44.         int i;
  45.  
  46.         _asmask=mask;
  47.         if(as_chnl)
  48.                 for (i=0; i<MAX_PORT; i++)
  49.                         as_chnl->tblport[i].as_mask = mask;
  50.         return (ASSUCCESS);
  51. }
  52.