home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / OB3.2D3.DMS / in.adf / Interfaces / BattMem.mod < prev    next >
Encoding:
Text File  |  1992-11-02  |  4.0 KB  |  144 lines

  1. (*-------------------------------------------------------------------------*)
  2. (*                                                                         *)
  3. (*  Amiga Oberon Interface Module:                    Date: 02-Nov-92      *)
  4. (*                                                                         *)
  5. (*   © 1992 by Fridtjof Siebert                                            *)
  6. (*                                                                         *)
  7. (*-------------------------------------------------------------------------*)
  8.  
  9. MODULE BattMem;
  10.  
  11. IMPORT e * := Exec;
  12.  
  13. CONST
  14.   battMemName * = "battmem.resource";
  15.  
  16.  
  17. (*
  18.  * Amiga specific bits in the battery-backedup ram.
  19.  *
  20.  *      Bits 0 to 31, inclusive
  21.  *)
  22.  
  23. (*
  24.  * AMIGA_AMNESIA
  25.  *
  26.  *              The battery-backedup memory has had a memory loss.
  27.  *              This bit is used as a flag that the user should be
  28.  *              notified that all battery-backed bit have been
  29.  *              reset and that some attention is required. Zero
  30.  *              indicates that a memory loss has occured.
  31.  *)
  32.  
  33.   amigaAmnesiaAddr    * = 0;
  34.   amigaAmnesiaLen     * = 1;
  35.  
  36.  
  37. (*
  38.  * SCSI_TIMEOUT
  39.  *
  40.  *              adjusts the timeout value for SCSI device selection.  A
  41.  *              value of 0 will produce short timeouts (128 ms) while a
  42.  *              value of 1 produces long timeouts (2 sec).  This is used
  43.  *              for SeaCrate drives (and some Maxtors apparently) that
  44.  *              don`t respond to selection until they are fully spun up
  45.  *              and intialised.
  46.  *)
  47.  
  48.   scsiTimeoutAddr     * = 1;
  49.   scsiTimeoutLen      * = 1;
  50.  
  51.  
  52. (*
  53.  * SCSI_LUNS
  54.  *
  55.  *              Determines if the controller attempts to access logical
  56.  *              units above 0 at any given SCSI address.  This prevents
  57.  *              problems with drives that respond to ALL LUN addresses
  58.  *              (instead of only 0 like they should).  Default value is
  59.  *              0 meaning don't support LUNs.
  60.  *)
  61.  
  62.   scsiLunsAddr        * = 2;
  63.   scsiLunsLen         * = 1;
  64.  
  65.  
  66. (*
  67.  * Shared bits in the battery-backedup ram.
  68.  *
  69.  *      Bits 64 and above
  70.  *)
  71.  
  72. (*
  73.  * SHARED_AMNESIA
  74.  *
  75.  *              The battery-backedup memory has had a memory loss.
  76.  *              This bit is used as a flag that the user should be
  77.  *              notified that all battery-backed bit have been
  78.  *              reset and that some attention is required. Zero
  79.  *              indicates that a memory loss has occured.
  80.  *)
  81.  
  82.   sharedAmnesiaAddr   * = 64;
  83.   sharedAmnesiaLen    * = 1;
  84.  
  85.  
  86. (*
  87.  * SCSI_HOST_ID
  88.  *
  89.  *              a 3 bit field (0-7) that is stored in complemented form
  90.  *              (this is so that default value of 0 really means 7)
  91.  *              It's used to set the A3000 controllers SCSI ID (on reset)
  92.  *)
  93.  
  94.   scsiHostIdAddr      * = 65;
  95.   scsiHostIdLen       * = 3;
  96.  
  97.  
  98. (*
  99.  * SCSI_SYNC_XFER
  100.  *
  101.  *              determines if the driver should initiate synchronous
  102.  *              transfer requests or leave it to the drive to send the
  103.  *              first request.  This supports drives that crash or
  104.  *              otherwise get confused when presented with a sync xfer
  105.  *              message.  Default=0=sync xfer not initiated.
  106.  *)
  107.  
  108.   scsiSyncXferAddr    * = 68;
  109.   scsiSyncXferLen     * = 1;
  110.  
  111.  
  112. (*
  113.  *      See Amix documentation for these bit definitions
  114.  *
  115.  *      Bits 32 to 63, inclusive
  116.  *)
  117.  
  118.  
  119.  
  120. VAR
  121.  
  122. (*
  123.  *  You have to put a pointer to the battmem.resource here to use the battmem
  124.  *  procedures:
  125.  *)
  126.  
  127.   base * : e.APTR;
  128.  
  129. (* "battmem.resource" *)
  130. PROCEDURE ObtainBattSemaphore *{base,-  6}();
  131. PROCEDURE ReleaseBattSemaphore*{base,- 12}();
  132. PROCEDURE ReadBattMem         *{base,- 18}(VAR buffer{8} : ARRAY OF e.BYTE;
  133.                                            offset{0}     : LONGINT;
  134.                                            length{1}     : LONGINT): LONGINT;
  135. PROCEDURE WriteBattMem        *{base,- 24}(buffer{8}     : ARRAY OF e.BYTE;
  136.                                            offset{0}     : LONGINT;
  137.                                            length{1}     : LONGINT): LONGINT;
  138.  
  139. END BattMem.
  140.  
  141.  
  142.  
  143.  
  144.