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.

241 lines
6.6 KiB

  1. /*++
  2. Copyright (c) 1991-2000 Microsoft Corporation
  3. Module Name:
  4. pbiosp.h
  5. Abstract:
  6. PnP BIOS/ISA configuration data definitions
  7. Author:
  8. Shie-Lin Tzong (shielint) April 12, 1995
  9. Revision History:
  10. --*/
  11. //#include "nthal.h"
  12. //#include "hal.h"
  13. //
  14. // Constants
  15. //
  16. #define SMALL_RESOURCE_TAG (UCHAR)(0x00)
  17. #define LARGE_RESOURCE_TAG (UCHAR)(0x80)
  18. #define SMALL_TAG_MASK 0xf8
  19. #define SMALL_TAG_SIZE_MASK 7
  20. //
  21. // Small Resouce Tags with length bits stripped off
  22. //
  23. #define TAG_VERSION 0x08
  24. #define TAG_LOGICAL_ID 0x10
  25. #define TAG_COMPATIBLE_ID 0x18
  26. #define TAG_IRQ 0x20
  27. #define TAG_DMA 0x28
  28. #define TAG_START_DEPEND 0x30
  29. #define TAG_END_DEPEND 0x38
  30. #define TAG_IO 0x40
  31. #define TAG_IO_FIXED 0x48
  32. #define TAG_VENDOR 0x70
  33. #define TAG_END 0x78
  34. //
  35. // Large Resouce Tags
  36. //
  37. #define TAG_MEMORY 0x81
  38. #define TAG_ANSI_ID 0x82
  39. #define TAG_UNICODE_ID 0x83
  40. #define TAG_LVENDOR 0x84
  41. #define TAG_MEMORY32 0x85
  42. #define TAG_MEMORY32_FIXED 0x86
  43. //
  44. // Complete TAG if applicable.
  45. //
  46. #define TAG_COMPLETE_COMPATIBLE_ID 0x1C
  47. #define TAG_COMPLETE_END 0x79
  48. #include "pshpack1.h"
  49. //
  50. // PNP ISA Port descriptor definition
  51. //
  52. typedef struct _PNP_PORT_DESCRIPTOR_ {
  53. UCHAR Tag; // 01000111B, small item name = 08, length = 7
  54. UCHAR Information; // bit [0] = 1 device decodes full 16 bit addr
  55. // = 0 device decodes ISA addr bits[9-0]
  56. USHORT MinimumAddress;
  57. USHORT MaximumAddress;
  58. UCHAR Alignment; // Increment in 1 byte blocks
  59. UCHAR Length; // # contiguous Port requested
  60. } PNP_PORT_DESCRIPTOR, *PPNP_PORT_DESCRIPTOR;
  61. //
  62. // PNP ISA fixed Port descriptor definition
  63. //
  64. typedef struct _PNP_FIXED_PORT_DESCRIPTOR_ {
  65. UCHAR Tag; // 01001011B, small item name = 09, length = 3
  66. USHORT MinimumAddress;
  67. UCHAR Length; // # contiguous Port requested
  68. } PNP_FIXED_PORT_DESCRIPTOR, *PPNP_FIXED_PORT_DESCRIPTOR;
  69. //
  70. // PNP ISA IRQ descriptor definition
  71. //
  72. typedef struct _PNP_IRQ_DESCRIPTOR_ {
  73. UCHAR Tag; // 0010001XB small item name = 4 length = 2/3
  74. USHORT IrqMask; // bit 0 is irq 0
  75. UCHAR Information; // Optional
  76. } PNP_IRQ_DESCRIPTOR, *PPNP_IRQ_DESCRIPTOR;
  77. //
  78. // Masks for PNP_IRQ_DESCRIPTOR Information byte
  79. //
  80. #define PNP_IRQ_LEVEL_MASK 0xC
  81. #define PNP_IRQ_EDGE_MASK 0x3
  82. //
  83. // PNP ISA DMA descriptor definition
  84. //
  85. typedef struct _PNP_DMA_DESCRIPTOR_ {
  86. UCHAR Tag; // 00101010B, small item name = 05, length = 2
  87. UCHAR ChannelMask; // bit 0 is channel 0
  88. UCHAR Flags; // see spec
  89. } PNP_DMA_DESCRIPTOR, *PPNP_DMA_DESCRIPTOR;
  90. //
  91. // PNP ISA MEMORY descriptor
  92. //
  93. typedef struct _PNP_MEMORY_DESCRIPTOR_ {
  94. UCHAR Tag; // 10000001B, Large item name = 1
  95. USHORT Length; // Length of the descriptor = 9
  96. UCHAR Information; // See def below
  97. USHORT MinimumAddress; // address bit [8-23]
  98. USHORT MaximumAddress; // address bit [8-23]
  99. USHORT Alignment; // 0x0000 = 64KB
  100. USHORT MemorySize; // In 256 byte blocks
  101. } PNP_MEMORY_DESCRIPTOR, *PPNP_MEMORY_DESCRIPTOR;
  102. //
  103. // PNP ISA MEMORY32 descriptor
  104. //
  105. typedef struct _PNP_MEMORY32_DESCRIPTOR_ {
  106. UCHAR Tag; // 10000101B, Large item name = 5
  107. USHORT Length; // Length of the descriptor = 17
  108. UCHAR Information; // See def below
  109. ULONG MinimumAddress; // 32 bit addr
  110. ULONG MaximumAddress; // 32 bit addr
  111. ULONG Alignment; // 32 bit alignment
  112. ULONG MemorySize; // 32 bit length
  113. } PNP_MEMORY32_DESCRIPTOR, *PPNP_MEMORY32_DESCRIPTOR;
  114. //
  115. // PNP ISA FIXED MEMORY32 descriptor
  116. //
  117. typedef struct _PNP_FIXED_MEMORY32_DESCRIPTOR_ {
  118. UCHAR Tag; // 10000110B, Large item name = 6
  119. USHORT Length; // Length of the descriptor = 9
  120. UCHAR Information; // See def below
  121. ULONG BaseAddress; // 32 bit addr
  122. ULONG MemorySize; // 32 bit length
  123. } PNP_FIXED_MEMORY32_DESCRIPTOR, *PPNP_FIXED_MEMORY32_DESCRIPTOR;
  124. #define PNP_MEMORY_ROM_MASK 0x40
  125. #define PNP_MEMORY_SHADOWABLE_MASK 0x20
  126. #define PNP_MEMORY_CONTROL_MASK 0x18
  127. #define PNP_MEMORY_CONTROL_8BIT 00
  128. #define PNP_MEMORY_CONTROL_16BIT 01
  129. #define PNP_MEMORY_CONTROL_8AND16BIT 02
  130. #define PNP_MEMORY_CONTROL_32BIT 03
  131. #define PNP_MEMORY_SUPPORT_TYPE_MASK 04
  132. #define PNP_MEMORY_CACHE_SUPPORT_MASK 02
  133. #define PNP_MEMORY_WRITE_STATUS_MASK 01
  134. #define UNKNOWN_DOCKING_IDENTIFIER 0xffffffff
  135. #define UNABLE_TO_DETERMINE_DOCK_CAPABILITIES 0x89
  136. #define FUNCTION_NOT_SUPPORTED 0x82
  137. #define SYSTEM_NOT_DOCKED 0x87
  138. //
  139. // Pnp BIOS device node structure
  140. //
  141. typedef struct _PNP_BIOS_DEVICE_NODE {
  142. USHORT Size;
  143. UCHAR Node;
  144. ULONG ProductId;
  145. UCHAR DeviceType[3];
  146. USHORT DeviceAttributes;
  147. // followed by AllocatedResourceBlock, PossibleResourceBlock
  148. // and CompatibleDeviceId
  149. } PNP_BIOS_DEVICE_NODE, *PPNP_BIOS_DEVICE_NODE;
  150. //
  151. // DeviceType definition
  152. //
  153. #define BASE_TYPE_DOCKING_STATION 0xA
  154. //
  155. // Device attributes definitions
  156. //
  157. #define DEVICE_DOCKING 0x20
  158. #define DEVICE_REMOVABLE 0x40
  159. //
  160. // Pnp BIOS Installation check
  161. //
  162. typedef struct _PNP_BIOS_INSTALLATION_CHECK {
  163. UCHAR Signature[4]; // $PnP (ascii)
  164. UCHAR Revision;
  165. UCHAR Length;
  166. USHORT ControlField;
  167. UCHAR Checksum;
  168. ULONG EventFlagAddress; // Physical address
  169. USHORT RealModeEntryOffset;
  170. USHORT RealModeEntrySegment;
  171. USHORT ProtectedModeEntryOffset;
  172. ULONG ProtectedModeCodeBaseAddress;
  173. ULONG OemDeviceId;
  174. USHORT RealModeDataBaseAddress;
  175. ULONG ProtectedModeDataBaseAddress;
  176. } PNP_BIOS_INSTALLATION_CHECK, *PPNP_BIOS_INSTALLATION_CHECK;
  177. #include "poppack.h"
  178. //
  179. // Pnp BIOS ControlField masks
  180. //
  181. #define PNP_BIOS_CONTROL_MASK 0x3
  182. #define PNP_BIOS_EVENT_NOT_SUPPORTED 0
  183. #define PNP_BIOS_EVENT_POLLING 1
  184. #define PNP_BIOS_EVENT_ASYNC 2
  185. //
  186. // Pnp Bios event
  187. //
  188. #define ABOUT_TO_CHANGE_CONFIG 1
  189. #define DOCK_CHANGED 2
  190. #define SYSTEM_DEVICE_CHANGED 3
  191. #define CONFIG_CHANGE_FAILED 4