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.

189 lines
4.7 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. NTCONFIG.H
  5. Abstract:
  6. This module contains the definitions associated with the conventions
  7. used to access the configuration registry.
  8. History:
  9. a--davj 04-Mar-97 Created.
  10. --*/
  11. #include <winnt.h>
  12. #ifndef _NTCONFIG_
  13. #define _NTCONFIG_
  14. typedef enum _CM_RESOURCE_TYPE {
  15. CmResourceTypeNull = 0, // Reserved
  16. CmResourceTypePort,
  17. CmResourceTypeInterrupt,
  18. CmResourceTypeMemory,
  19. CmResourceTypeDma,
  20. CmResourceTypeDeviceSpecific
  21. } CM_RESOURCE_TYPE;
  22. /*
  23. typedef union _LARGE_INTEGER {
  24. struct {
  25. ULONG LowPart;
  26. LONG HighPart;
  27. };
  28. LONGLONG QuadPart;
  29. } LARGE_INTEGER, *PLARGE_INTEGER;
  30. */
  31. typedef LARGE_INTEGER PHYSICAL_ADDRESS;
  32. typedef enum Interface_Type {
  33. Internal,
  34. Isa,
  35. Eisa,
  36. MicroChannel,
  37. TurboChannel,
  38. PCIBus,
  39. VMEBus,
  40. NuBus,
  41. PCMCIABus,
  42. CBus,
  43. MPIBus,
  44. MPSABus,
  45. MaximumInterfaceType
  46. }INTERFACE_TYPE;
  47. #define REG_RESOURCE_LIST ( 8 ) // Resource list in the resource map
  48. #define REG_FULL_RESOURCE_DESCRIPTOR ( 9 ) // Resource list in the hardware description
  49. //
  50. // Make sure alignment is made properly by compiler; otherwise move
  51. // flags back to the top of the structure (common to all members of the
  52. // union).
  53. //
  54. #pragma pack(4)
  55. typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR {
  56. UCHAR Type;
  57. UCHAR ShareDisposition;
  58. USHORT Flags;
  59. union {
  60. //
  61. // Range of port numbers, inclusive. These are physical, bus
  62. // relative. The value should be the same as the one passed to
  63. // HalTranslateBusAddress().
  64. //
  65. struct {
  66. PHYSICAL_ADDRESS Start;
  67. ULONG Length;
  68. } Port;
  69. //
  70. // IRQL and vector. Should be same values as were passed to
  71. // HalGetInterruptVector().
  72. //
  73. struct {
  74. ULONG Level;
  75. ULONG Vector;
  76. ULONG Affinity;
  77. } Interrupt;
  78. //
  79. // Range of memory addresses, inclusive. These are physical, bus
  80. // relative. The value should be the same as the one passed to
  81. // HalTranslateBusAddress().
  82. //
  83. struct {
  84. PHYSICAL_ADDRESS Start; // 64 bit physical addresses.
  85. ULONG Length;
  86. } Memory;
  87. //
  88. // Physical DMA channel.
  89. //
  90. struct {
  91. ULONG Channel;
  92. ULONG Port;
  93. ULONG Reserved1;
  94. } Dma;
  95. //
  96. // Device Specific information defined by the driver.
  97. // The DataSize field indicates the size of the data in bytes. The
  98. // data is located immediately after the DeviceSpecificData field in
  99. // the structure.
  100. //
  101. struct {
  102. ULONG DataSize;
  103. ULONG Reserved1;
  104. ULONG Reserved2;
  105. } DeviceSpecificData;
  106. } u;
  107. } CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR;
  108. #pragma pack()
  109. //
  110. // A Partial Resource List is what can be found in the ARC firmware
  111. // or will be generated by ntdetect.com.
  112. // The configuration manager will transform this structure into a Full
  113. // resource descriptor when it is about to store it in the regsitry.
  114. //
  115. // Note: There must a be a convention to the order of fields of same type,
  116. // (defined on a device by device basis) so that the fields can make sense
  117. // to a driver (i.e. when multiple memory ranges are necessary).
  118. //
  119. typedef struct _CM_PARTIAL_RESOURCE_LIST {
  120. USHORT Version;
  121. USHORT Revision;
  122. ULONG Count;
  123. CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1];
  124. } CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST;
  125. //
  126. // A Full Resource Descriptor is what can be found in the registry.
  127. // This is what will be returned to a driver when it queries the registry
  128. // to get device information; it will be stored under a key in the hardware
  129. // description tree.
  130. //
  131. // Note: The BusNumber and Type are redundant information, but we will keep
  132. // it since it allows the driver _not_ to append it when it is creating
  133. // a resource list which could possibly span multiple buses.
  134. //
  135. // Note2: There must a be a convention to the order of fields of same type,
  136. // (defined on a device by device basis) so that the fields can make sense
  137. // to a driver (i.e. when multiple memory ranges are necessary).
  138. //
  139. typedef struct _CM_FULL_RESOURCE_DESCRIPTOR {
  140. INTERFACE_TYPE InterfaceType;
  141. ULONG BusNumber;
  142. CM_PARTIAL_RESOURCE_LIST PartialResourceList;
  143. } CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR;
  144. //
  145. // The Resource list is what will be stored by the drivers into the
  146. // resource map via the IO API.
  147. //
  148. typedef struct _CM_RESOURCE_LIST {
  149. ULONG Count;
  150. CM_FULL_RESOURCE_DESCRIPTOR List[1];
  151. } CM_RESOURCE_LIST, *PCM_RESOURCE_LIST;
  152. #endif // _NTCONFIG_