home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / dev / m2 / CycloneModules.lha / modules / txt / Disk.def < prev    next >
Text File  |  1996-08-01  |  3KB  |  122 lines

  1. (*
  2. **    Cyclone Modula-2 Interface module:
  3. **    $VER: disk.h 27.11 (21.11.90)
  4. **    Includes Release 40.15
  5. **
  6. **    disk.h -- external declarations for the disk resource
  7. **
  8. **    (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  9. **        All Rights Reserved
  10. **
  11. **      Interface module by Marcel Timmermans
  12. **      (C) Copyright 1995-1996 Marcel Timmermans
  13. **          All Rights Reserved
  14. *)
  15.  
  16. (*$ Implementation- *)
  17. DEFINITION MODULE Disk;
  18.  
  19. FROM SYSTEM   IMPORT ADDRESS,SHORTSET;
  20. FROM ExecD    IMPORT Message,Interrupt,Library,LibraryPtr,TaskPtr,List;
  21.  
  22. IMPORT Reg;
  23.  
  24. TYPE
  25.  
  26. (********************************************************************
  27. *
  28. * Resource structures
  29. *
  30. ********************************************************************)
  31.  
  32.  DiscResourceUnitPtr = POINTER TO DiscResourceUnit;
  33.  DiscResourceUnit = RECORD
  34.   message   : Message;
  35.   discBlock : Interrupt;
  36.   discSync  : Interrupt;
  37.   index     : Interrupt;
  38.  END;
  39.  
  40.  DiscResourcePtr = POINTER TO DiscResource;
  41.  DiscResource = RECORD
  42.   library       : Library;
  43.   current       : DiscResourceUnitPtr;
  44.   flags         : SHORTSET;
  45.   pad           : SHORTCARD;
  46.   sysLib        : LibraryPtr;
  47.   ciaResource   : LibraryPtr;
  48.   unitID        : ARRAY[0..3] OF LONGCARD;
  49.   waiting       : List;
  50.   discBlock     : Interrupt;
  51.   discSync      : Interrupt;
  52.   index         : Interrupt;
  53.   currTask      : TaskPtr;
  54.  END;
  55.  
  56. CONST
  57.  
  58. (* DiskResource.flags entries *)
  59.   alloc0  = 0;      (* unit zero is allocated *)
  60.   alloc1  = 1;      (* unit one is allocated *)
  61.   alloc2  = 2;      (* unit two is allocated *)
  62.   alloc3  = 3;      (* unit three is allocated *)
  63.   active  = 7;      (* is the disc currently busy? *)
  64.  
  65.  
  66.  
  67. (********************************************************************
  68. *
  69. * Hardware Magic
  70. *
  71. ********************************************************************)
  72.  
  73.  
  74.   dskDMAOff = 4000H;   (* idle command for dsklen register *)
  75.  
  76.  
  77. (********************************************************************
  78. *
  79. * Resource specific commands
  80. *
  81. ********************************************************************)
  82.  
  83. (*
  84.  * DISKNAME is a generic macro to get the name of the resource.
  85.  * This way if the name is ever changed you will pick up the
  86.  *  change automatically.
  87.  *)
  88.  
  89.   diskName = "disk.resource";
  90.  
  91.  
  92. (********************************************************************
  93. *
  94. * drive types
  95. *
  96. ********************************************************************)
  97.  
  98.   amiga         = 000000000H;
  99.   drt37422D2S   = 055555555H;
  100.   empty         = 0FFFFFFFFH;
  101.   drt150RPM     = 0AAAAAAAAH;
  102.  
  103.  
  104.  
  105. PROCEDURE AllocUnit(disk{Reg.A6}:DiscResourcePtr;unitNum{Reg.D0}:LONGINT):BOOLEAN; CODE -6;
  106.  
  107. PROCEDURE FreeUnit(disk{Reg.A6}:DiscResourcePtr;unitNum{Reg.D0}:LONGINT); CODE -12;
  108.  
  109. PROCEDURE GetUnit(disk{Reg.A6}:DiscResourcePtr;
  110.                   unitPointer{Reg.A1}:DiscResourceUnitPtr):DiscResourceUnitPtr; CODE -18;
  111.  
  112. PROCEDURE GiveUnit(disk{Reg.A6}:DiscResourcePtr); CODE -24;
  113.  
  114. PROCEDURE GetUnitID(disk{Reg.A6}:DiscResourcePtr;
  115.                     unitNum{Reg.D0}:LONGINT):LONGCARD; CODE -30;
  116.  
  117. PROCEDURE ReadUnitID(disk{Reg.A6}:DiscResourcePtr;
  118.                      unitNum{Reg.D0}:LONGINT):LONGCARD; CODE -36;
  119.  
  120.  
  121. END Disk.
  122.