home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / dev / oberon-a-1.4ß.lha / Oberon-A / source / amiga / BattMem.mod < prev    next >
Text File  |  1994-08-08  |  6KB  |  243 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: BattMem.mod $
  4.   Description: Interface to battmem.resource
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 00:51:03 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. MODULE BattMem;
  23.  
  24. (*
  25. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  26. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  27. ** $V- OvflChk       $Z- ZeroVars
  28. *)
  29.  
  30. IMPORT E := Exec, SYS := SYSTEM;
  31.  
  32.  
  33. (*
  34. **      $VER: battmem.h 36.4 (1.5.90)
  35. **
  36. **      BattMem resource name strings.
  37. *)
  38.  
  39. CONST
  40.  
  41.   name        * = "battmem.resource";
  42.  
  43.  
  44. (*
  45. **      $VER: battmembitsamiga.h 39.3 (14.9.92)
  46. **
  47. **      BattMem Amiga specific bit definitions.
  48. *)
  49.  
  50.  
  51. (*
  52.  * Amiga specific bits in the battery-backedup ram.
  53.  *
  54.  *      Bits 0 to 31, inclusive
  55.  *)
  56.  
  57. (*
  58.  * AmigaAmnesia
  59.  *
  60.  *              The battery-backedup memory has had a memory loss.
  61.  *              This bit is used as a flag that the user should be
  62.  *              notified that all battery-backed bit have been
  63.  *              reset and that some attention is required. Zero
  64.  *              indicates that a memory loss has occured.
  65.  *)
  66.  
  67.   amigaAmnesiaAddr      * = 0;
  68.   amigaAmnesiaLen       * = 1;
  69.  
  70.  
  71. (*
  72.  * scsiTimeout
  73.  *
  74.  *              adjusts the timeout value for SCSI device selection.  A
  75.  *              value of 0 will produce short timeouts (128 ms) while a
  76.  *              value of 1 produces long timeouts (2 sec).  This is used
  77.  *              for SeaCrate drives (and some Maxtors apparently) that
  78.  *              don`t respond to selection until they are fully spun up
  79.  *              and intialised.
  80.  *)
  81.  
  82.   scsiTimeoutAddr       * = 1;
  83.   scsiTimeoutLen        * = 1;
  84.  
  85.  
  86. (*
  87.  * scsiLuns
  88.  *
  89.  *              Determines if the controller attempts to access logical
  90.  *              units above 0 at any given SCSI address.  This prevents
  91.  *              problems with drives that respond to ALL LUN addresses
  92.  *              (instead of only 0 like they should).  Default value is
  93.  *              0 meaning don't support LUNs.
  94.  *)
  95.  
  96.   scsiLunsAddr          * = 2;
  97.   scsiLunsLen           * = 1;
  98.  
  99.  
  100. (*
  101. **      $VER: battmembitsamix.h 1.1 (25.5.90)
  102. **
  103. **      BattMem Amix specific bit definitions.
  104. *)
  105.  
  106.  
  107. (*
  108.  *      See Amix documentation for these bit definitions
  109.  *
  110.  *      Bits 32 to 63, inclusive
  111.  *)
  112.  
  113. (*
  114. **      $VER: battmembitsshared.h 39.2 (4.6.93)
  115. **
  116. **      BattMem shared specific bit definitions.
  117. *)
  118.  
  119.  
  120. (*
  121.  * Shared bits in the battery-backedup ram.
  122.  *
  123.  *      Bits 64 and above
  124.  *)
  125.  
  126. (*
  127.  * sharedAmnesia
  128.  *
  129.  *              The battery-backedup memory has had a memory loss.
  130.  *              This bit is used as a flag that the user should be
  131.  *              notified that all battery-backed bit have been
  132.  *              reset and that some attention is required. Zero
  133.  *              indicates that a memory loss has occured.
  134.  *)
  135.  
  136.   sharedAmnesiaAddr     * = 64;
  137.   sharedAmnesiaLen      * = 1;
  138.  
  139.  
  140. (*
  141.  * scsiHostID
  142.  *
  143.  *              a 3 bit field (0-7) that is stored in complemented form
  144.  *              (this is so that default value of 0 really means 7)
  145.  *              It's used to set the A3000 controllers SCSI ID (on reset)
  146.  *)
  147.  
  148.   scsiHostIdAddr       * = 65;
  149.   scsiHostIdLen        * = 3;
  150.  
  151.  
  152. (*
  153.  * scsiSyncXfer
  154.  *
  155.  *              determines if the driver should initiate synchronous
  156.  *              transfer requests or leave it to the drive to send the
  157.  *              first request.  This supports drives that crash or
  158.  *              otherwise get confused when presented with a sync xfer
  159.  *              message.  Default=0=sync xfer not initiated.
  160.  *)
  161.  
  162.   scsiSyncXferAddr     * = 68;
  163.   scsiSyncXferLen      * = 1;
  164.  
  165. (*
  166.  * scsiFastSync
  167.  *
  168.  *              determines if the driver should initiate fast synchronous
  169.  *              transfer requests (>5MB/s) instead of older <=5MB/s requests.
  170.  *              Note that this has no effect if synchronous transfers are not
  171.  *              negotiated by either side.
  172.  *              Default=0=fast sync xfer used.
  173.  *)
  174.  
  175.   scsiFastSyncAddr * = 69;
  176.   scsiFastSyncLen * = 1;
  177.  
  178. (*
  179.  * scsiTagQueues
  180.  *
  181.  *              determines if the driver should use SCSI-2 tagged queuing
  182.  *              which allows the drive to accept and reorder multiple read
  183.  *              and write requests.
  184.  *              Default=0=tagged queuing NOT enabled
  185.  *)
  186.  
  187.   scsiTagQueuesAddr * = 70;
  188.   scsiTagQueuesLen * = 1;
  189.  
  190.  
  191. (**-- Resource Base variable --------------------------------------------*)
  192.  
  193. TYPE
  194.  
  195.   BattMemBasePtr * = CPOINTER TO BattMemBase;
  196.   BattMemBase * = RECORD (E.Node) END;
  197.  
  198. VAR
  199.  
  200.   base * : BattMemBasePtr;
  201.  
  202.  
  203. (**-- Resource Functions ------------------------------------------------*)
  204.  
  205. (*
  206. **      $VER: battmem_protos.h 1.5 (4.3.91)
  207. *)
  208.  
  209. LIBCALL (base : BattMemBasePtr) ObtainBattSemaphore* ();
  210.   -6;
  211. LIBCALL (base : BattMemBasePtr) ReleaseBattSemaphore* ();
  212.   -12;
  213. LIBCALL (base : BattMemBasePtr) ReadBattMem*
  214.   ( VAR buffer [8] : ARRAY OF SYS.BYTE;
  215.     offset     [0] : E.ULONG;
  216.     length     [1] : E.ULONG )
  217.   : E.ULONG;
  218.   -18;
  219. LIBCALL (base : BattMemBasePtr) WriteBattMem*
  220.   ( buffer [8] : ARRAY OF SYS.BYTE;
  221.     offset [0] : E.ULONG;
  222.     length [1] : E.ULONG )
  223.   : E.ULONG;
  224.   -24;
  225.  
  226.  
  227. (**-- Resource Base variable --------------------------------------------*)
  228. (** $L- Address globals through A4 *)
  229.  
  230.  
  231. (**-----------------------------------*)
  232. PROCEDURE OpenResource * (mustOpen : BOOLEAN);
  233.  
  234. BEGIN (* OpenResource *)
  235.   IF base = NIL THEN
  236.     base := E.base.OpenResource (name);
  237.     IF mustOpen & (base = NIL) THEN HALT (100) END;
  238.   END;
  239. END OpenResource;
  240.  
  241.  
  242. END BattMem.
  243.