Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

215 lines
5.2 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. eisa.h
  5. Abstract:
  6. This module contains the i386 EISA bus specific header file.
  7. Author:
  8. Shie-Lin Tzong (shielint) 6-June-1991
  9. Revision History:
  10. --*/
  11. //
  12. // SU module's version of the memory descriptor
  13. //
  14. typedef struct _MEMORY_LIST_ENTRY {
  15. ULONG BlockBase;
  16. ULONG BlockSize;
  17. } MEMORY_LIST_ENTRY, *PMEMORY_LIST_ENTRY;
  18. //
  19. // Memory configuration of eisa data block structure
  20. //
  21. typedef struct _EISA_MEMORY_TYPE {
  22. UCHAR ReadWrite: 1;
  23. UCHAR Cached : 1;
  24. UCHAR Reserved0 :1;
  25. UCHAR Type:2;
  26. UCHAR Shared:1;
  27. UCHAR Reserved1 :1;
  28. UCHAR MoreEntries : 1;
  29. } EISA_MEMORY_TYPE, *PEISA_MEMORY_TYPE;
  30. typedef struct _BTEISA_MEMORY_CONFIGURATION {
  31. EISA_MEMORY_TYPE ConfigurationByte;
  32. UCHAR DataSize;
  33. USHORT PhysicalAddress_LSW;
  34. UCHAR PhysicalAddress_MSB;
  35. USHORT MemorySize;
  36. } BTEISA_MEMORY_CONFIGURATION, *PBTEISA_MEMORY_CONFIGURATION;
  37. //
  38. // Interrupt configurationn of eisa data block structure
  39. //
  40. typedef struct _EISA_IRQ_DESCRIPTOR {
  41. UCHAR Interrupt : 4;
  42. UCHAR Reserved :1;
  43. UCHAR LevelTriggered :1;
  44. UCHAR Shared : 1;
  45. UCHAR MoreEntries : 1;
  46. } EISA_IRQ_DESCRIPTOR, *PEISA_IRQ_DESCRIPTOR;
  47. typedef struct _BTEISA_IRQ_CONFIGURATION {
  48. EISA_IRQ_DESCRIPTOR ConfigurationByte;
  49. UCHAR Reserved;
  50. } BTEISA_IRQ_CONFIGURATION, *PBTEISA_IRQ_CONFIGURATION;
  51. //
  52. // DMA description of eisa data block structure
  53. //
  54. typedef struct _DMA_CONFIG_BYTE0 {
  55. UCHAR Channel : 3;
  56. UCHAR Reserved : 3;
  57. UCHAR Shared :1;
  58. UCHAR MoreEntries :1;
  59. } DMA_CONFIG_BYTE0;
  60. typedef struct _DMA_CONFIG_BYTE1 {
  61. UCHAR Reserved0 : 2;
  62. UCHAR TransferSize : 2;
  63. UCHAR Timing : 2;
  64. UCHAR Reserved1 : 2;
  65. } DMA_CONFIG_BYTE1;
  66. typedef struct _BTEISA_DMA_CONFIGURATION {
  67. DMA_CONFIG_BYTE0 ConfigurationByte0;
  68. DMA_CONFIG_BYTE1 ConfigurationByte1;
  69. } BTEISA_DMA_CONFIGURATION, *PBTEISA_DMA_CONFIGURATION;
  70. typedef struct _EISA_PORT_DESCRIPTOR {
  71. UCHAR NumberPorts : 5;
  72. UCHAR Reserved :1;
  73. UCHAR Shared :1;
  74. UCHAR MoreEntries : 1;
  75. } EISA_PORT_DESCRIPTOR, *TEISA_PORT_DESCRIPTOR;
  76. typedef struct _BTEISA_PORT_CONFIGURATION {
  77. EISA_PORT_DESCRIPTOR Configuration;
  78. USHORT PortAddress;
  79. } BTEISA_PORT_CONFIGURATION, *PBTEISA_PORT_CONFIGURATION;
  80. typedef struct _BTEISA_SLOT_INFORMATION {
  81. UCHAR ReturnCode;
  82. UCHAR ReturnFlags;
  83. UCHAR MajorRevision;
  84. UCHAR MinorRevision;
  85. USHORT Checksum;
  86. UCHAR NumberFunctions;
  87. UCHAR FunctionInformation;
  88. ULONG CompressedId;
  89. } BTEISA_SLOT_INFORMATION, *PBTEISA_SLOT_INFORMATION,
  90. far *FPBTEISA_SLOT_INFORMATION;
  91. typedef struct _BTEISA_FUNCTION_INFORMATION {
  92. ULONG CompressedId;
  93. UCHAR IdSlotFlags1;
  94. UCHAR IdSlotFlags2;
  95. UCHAR MinorRevision;
  96. UCHAR MajorRevision;
  97. UCHAR Selections[26];
  98. UCHAR FunctionFlags;
  99. UCHAR TypeString[80];
  100. BTEISA_MEMORY_CONFIGURATION EisaMemory[9];
  101. BTEISA_IRQ_CONFIGURATION EisaIrq[7];
  102. BTEISA_DMA_CONFIGURATION EisaDma[4];
  103. BTEISA_PORT_CONFIGURATION EisaPort[20];
  104. UCHAR InitializationData[60];
  105. } BTEISA_FUNCTION_INFORMATION, *PBTEISA_FUNCTION_INFORMATION,
  106. far *FPBTEISA_FUNCTION_INFORMATION;
  107. //
  108. // Masks for EISA function information
  109. //
  110. #define EISA_FUNCTION_ENABLED 0x80
  111. #define EISA_FREE_FORM_DATA 0x40
  112. #define EISA_HAS_PORT_INIT_ENTRY 0x20
  113. #define EISA_HAS_PORT_RANGE 0x10
  114. #define EISA_HAS_DMA_ENTRY 0x08
  115. #define EISA_HAS_IRQ_ENTRY 0x04
  116. #define EISA_HAS_MEMORY_ENTRY 0x02
  117. #define EISA_HAS_TYPE_ENTRY 0x01
  118. #define EISA_HAS_INFORMATION EISA_HAS_PORT_RANGE + \
  119. EISA_HAS_DMA_ENTRY + \
  120. EISA_HAS_IRQ_ENTRY + \
  121. EISA_HAS_MEMORY_ENTRY + \
  122. EISA_HAS_TYPE_ENTRY
  123. //
  124. // Masks for EISA memory configuration
  125. //
  126. #define EISA_MORE_ENTRIES 0x80
  127. #define EISA_SYSTEM_MEMORY 0x00
  128. #define EISA_MEMORY_TYPE_RAM 0x01
  129. //
  130. // Returned error code for EISA bios call
  131. //
  132. #define EISA_INVALID_SLOT 0x80
  133. #define EISA_INVALID_FUNCTION 0x81
  134. #define EISA_INVALID_CONFIGURATION 0x82
  135. #define EISA_EMPTY_SLOT 0x83
  136. #define EISA_INVALID_BIOS_CALL 0x86
  137. //
  138. // Misc. definitions
  139. //
  140. #define _16MEGB ((ULONG)16 * 1024 * 1024)
  141. #define _64MEGB ((ULONG)64 * 1024 * 1024)
  142. BOOLEAN
  143. FindFunctionInformation (
  144. IN UCHAR SlotFlags,
  145. IN UCHAR FunctionFlags,
  146. OUT PBTEISA_FUNCTION_INFORMATION Buffer,
  147. IN BOOLEAN FromBeginning
  148. );
  149. USHORT
  150. CountMemoryBlocks (
  151. VOID
  152. );
  153. ULONG
  154. EisaConstructMemoryDescriptors (
  155. VOID
  156. );
  157. UCHAR
  158. BtGetEisaSlotInformation (
  159. PBTEISA_SLOT_INFORMATION SlotInformation,
  160. UCHAR Slot
  161. );
  162. UCHAR
  163. BtGetEisaFunctionInformation (
  164. PBTEISA_FUNCTION_INFORMATION FunctionInformation,
  165. UCHAR Slot,
  166. UCHAR Function
  167. );
  168. BOOLEAN
  169. BtIsEisaSystem (
  170. VOID
  171. );
  172. //
  173. // External References
  174. //
  175. extern MEMORY_LIST_ENTRY _far *MemoryDescriptorList;