home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / cbm / os-include.lha / os-include / resources / disk.h < prev    next >
C/C++ Source or Header  |  1993-10-15  |  3KB  |  124 lines

  1. #ifndef    RESOURCES_DISK_H
  2. #define RESOURCES_DISK_H
  3. /*
  4. **    $VER: disk.h 27.11 (21.11.90)
  5. **    Includes Release 40.15
  6. **
  7. **    disk.h -- external declarations for the disk resource
  8. **
  9. **    (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef    EXEC_TYPES_H
  14. #include "exec/types.h"
  15. #endif
  16.  
  17. #ifndef    EXEC_LISTS_H
  18. #include "exec/lists.h"
  19. #endif
  20.  
  21. #ifndef    EXEC_PORTS_H
  22. #include "exec/ports.h"
  23. #endif
  24.  
  25. #ifndef    EXEC_INTERRUPTS_H
  26. #include "exec/interrupts.h"
  27. #endif
  28.  
  29. #ifndef    EXEC_LIBRARIES_H
  30. #include "exec/libraries.h"
  31. #endif
  32.  
  33.  
  34. /********************************************************************
  35. *
  36. * Resource structures
  37. *
  38. ********************************************************************/
  39.  
  40.  
  41. struct DiscResourceUnit {
  42.     struct Message dru_Message;
  43.     struct Interrupt dru_DiscBlock;
  44.     struct Interrupt dru_DiscSync;
  45.     struct Interrupt dru_Index;
  46. };
  47.  
  48. struct DiscResource {
  49.     struct Library        dr_Library;
  50.     struct DiscResourceUnit    *dr_Current;
  51.     UBYTE            dr_Flags;
  52.     UBYTE            dr_pad;
  53.     struct Library        *dr_SysLib;
  54.     struct Library        *dr_CiaResource;
  55.     ULONG            dr_UnitID[4];
  56.     struct List        dr_Waiting;
  57.     struct Interrupt        dr_DiscBlock;
  58.     struct Interrupt        dr_DiscSync;
  59.     struct Interrupt        dr_Index;
  60.     struct Task            *dr_CurrTask;
  61. };
  62.  
  63. /* dr_Flags entries */
  64. #define DRB_ALLOC0    0    /* unit zero is allocated */
  65. #define DRB_ALLOC1    1    /* unit one is allocated */
  66. #define DRB_ALLOC2    2    /* unit two is allocated */
  67. #define DRB_ALLOC3    3    /* unit three is allocated */
  68. #define DRB_ACTIVE    7    /* is the disc currently busy? */
  69.  
  70. #define DRF_ALLOC0    (1<<0)    /* unit zero is allocated */
  71. #define DRF_ALLOC1    (1<<1)    /* unit one is allocated */
  72. #define DRF_ALLOC2    (1<<2)    /* unit two is allocated */
  73. #define DRF_ALLOC3    (1<<3)    /* unit three is allocated */
  74. #define DRF_ACTIVE    (1<<7)    /* is the disc currently busy? */
  75.  
  76.  
  77.  
  78. /********************************************************************
  79. *
  80. * Hardware Magic
  81. *
  82. ********************************************************************/
  83.  
  84.  
  85. #define    DSKDMAOFF    0x4000    /* idle command for dsklen register */
  86.  
  87.  
  88. /********************************************************************
  89. *
  90. * Resource specific commands
  91. *
  92. ********************************************************************/
  93.  
  94. /*
  95.  * DISKNAME is a generic macro to get the name of the resource.
  96.  * This way if the name is ever changed you will pick up the
  97.  *  change automatically.
  98.  */
  99.  
  100. #define DISKNAME    "disk.resource"
  101.  
  102.  
  103. #define    DR_ALLOCUNIT    (LIB_BASE - 0*LIB_VECTSIZE)
  104. #define    DR_FREEUNIT    (LIB_BASE - 1*LIB_VECTSIZE)
  105. #define    DR_GETUNIT    (LIB_BASE - 2*LIB_VECTSIZE)
  106. #define    DR_GIVEUNIT    (LIB_BASE - 3*LIB_VECTSIZE)
  107. #define    DR_GETUNITID    (LIB_BASE - 4*LIB_VECTSIZE)
  108. #define    DR_READUNITID    (LIB_BASE - 5*LIB_VECTSIZE)
  109.  
  110. #define    DR_LASTCOMM    (DR_READUNITID)
  111.  
  112. /********************************************************************
  113. *
  114. * drive types
  115. *
  116. ********************************************************************/
  117.  
  118. #define    DRT_AMIGA    (0x00000000)
  119. #define    DRT_37422D2S    (0x55555555)
  120. #define DRT_EMPTY    (0xFFFFFFFF)
  121. #define DRT_150RPM    (0xAAAAAAAA)
  122.  
  123. #endif /* RESOURCES_DISK_H */
  124.