[DDK/XDK]
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 31 May 2010 02:15:15 +0000 (02:15 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Mon, 31 May 2010 02:15:15 +0000 (02:15 +0000)
- Use PCI_COMMON_HEADER_LAYOUT for C, too, place it where it belongs

svn path=/trunk/; revision=47480

reactos/include/ddk/wdm.h
reactos/include/xdk/iotypes.h

index af239bb..aaa474b 100644 (file)
@@ -4172,80 +4172,6 @@ typedef struct _SHARE_ACCESS {
   ULONG  SharedDelete;
 } SHARE_ACCESS, *PSHARE_ACCESS;
 
-/* While MS WDK uses inheritance in C++, we cannot do this with gcc, as
-   inheritance, even from a struct renders the type non-POD. So we use
-   this hack */
-#define PCI_COMMON_HEADER_LAYOUT \
-  USHORT  VendorID; \
-  USHORT  DeviceID; \
-  USHORT  Command; \
-  USHORT  Status; \
-  UCHAR   RevisionID; \
-  UCHAR   ProgIf; \
-  UCHAR   SubClass; \
-  UCHAR   BaseClass; \
-  UCHAR   CacheLineSize; \
-  UCHAR   LatencyTimer; \
-  UCHAR   HeaderType; \
-  UCHAR   BIST; \
-  union { \
-    struct _PCI_HEADER_TYPE_0 { \
-      ULONG   BaseAddresses[PCI_TYPE0_ADDRESSES]; \
-      ULONG   CIS; \
-      USHORT  SubVendorID; \
-      USHORT  SubSystemID; \
-      ULONG   ROMBaseAddress; \
-      UCHAR   CapabilitiesPtr; \
-      UCHAR   Reserved1[3]; \
-      ULONG   Reserved2; \
-      UCHAR   InterruptLine; \
-      UCHAR   InterruptPin; \
-      UCHAR   MinimumGrant; \
-      UCHAR   MaximumLatency; \
-    } type0; \
-    struct _PCI_HEADER_TYPE_1 { \
-      ULONG   BaseAddresses[PCI_TYPE1_ADDRESSES]; \
-      UCHAR   PrimaryBus; \
-      UCHAR   SecondaryBus; \
-      UCHAR   SubordinateBus; \
-      UCHAR   SecondaryLatency; \
-      UCHAR   IOBase; \
-      UCHAR   IOLimit; \
-      USHORT  SecondaryStatus; \
-      USHORT  MemoryBase; \
-      USHORT  MemoryLimit; \
-      USHORT  PrefetchBase; \
-      USHORT  PrefetchLimit; \
-      ULONG   PrefetchBaseUpper32; \
-      ULONG   PrefetchLimitUpper32; \
-      USHORT  IOBaseUpper16; \
-      USHORT  IOLimitUpper16; \
-      UCHAR   CapabilitiesPtr; \
-      UCHAR   Reserved1[3]; \
-      ULONG   ROMBaseAddress; \
-      UCHAR   InterruptLine; \
-      UCHAR   InterruptPin; \
-      USHORT  BridgeControl; \
-    } type1; \
-    struct _PCI_HEADER_TYPE_2 { \
-      ULONG   SocketRegistersBaseAddress; \
-      UCHAR   CapabilitiesPtr; \
-      UCHAR   Reserved; \
-      USHORT  SecondaryStatus; \
-      UCHAR   PrimaryBus; \
-      UCHAR   SecondaryBus; \
-      UCHAR   SubordinateBus; \
-      UCHAR   SecondaryLatency; \
-      struct  { \
-        ULONG   Base; \
-        ULONG   Limit; \
-      } Range[PCI_TYPE2_ADDRESSES-1]; \
-      UCHAR   InterruptLine; \
-      UCHAR   InterruptPin; \
-      USHORT  BridgeControl; \
-    } type2; \
-  } u;
-
 typedef enum _CREATE_FILE_TYPE {
   CreateFileTypeNone,
   CreateFileTypeNamedPipe,
@@ -6665,21 +6591,88 @@ typedef struct _PCI_SLOT_NUMBER {
 #define PCI_TYPE1_ADDRESSES               2
 #define PCI_TYPE2_ADDRESSES               5
 
+/* While MS WDK uses inheritance in C++, we cannot do this with gcc, as
+   inheritance, even from a struct renders the type non-POD. So we use
+   this hack */
+#define PCI_COMMON_HEADER_LAYOUT \
+  USHORT VendorID; \
+  USHORT DeviceID; \
+  USHORT Command; \
+  USHORT Status; \
+  UCHAR RevisionID; \
+  UCHAR ProgIf; \
+  UCHAR SubClass; \
+  UCHAR BaseClass; \
+  UCHAR CacheLineSize; \
+  UCHAR LatencyTimer; \
+  UCHAR HeaderType; \
+  UCHAR BIST; \
+  union { \
+    struct _PCI_HEADER_TYPE_0 { \
+      ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; \
+      ULONG CIS; \
+      USHORT SubVendorID; \
+      USHORT SubSystemID; \
+      ULONG ROMBaseAddress; \
+      UCHAR CapabilitiesPtr; \
+      UCHAR Reserved1[3]; \
+      ULONG Reserved2; \
+      UCHAR InterruptLine; \
+      UCHAR InterruptPin; \
+      UCHAR MinimumGrant; \
+      UCHAR MaximumLatency; \
+    } type0; \
+    struct _PCI_HEADER_TYPE_1 { \
+      ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; \
+      UCHAR PrimaryBus; \
+      UCHAR SecondaryBus; \
+      UCHAR SubordinateBus; \
+      UCHAR SecondaryLatency; \
+      UCHAR IOBase; \
+      UCHAR IOLimit; \
+      USHORT SecondaryStatus; \
+      USHORT MemoryBase; \
+      USHORT MemoryLimit; \
+      USHORT PrefetchBase; \
+      USHORT PrefetchLimit; \
+      ULONG PrefetchBaseUpper32; \
+      ULONG PrefetchLimitUpper32; \
+      USHORT IOBaseUpper16; \
+      USHORT IOLimitUpper16; \
+      UCHAR CapabilitiesPtr; \
+      UCHAR Reserved1[3]; \
+      ULONG ROMBaseAddress; \
+      UCHAR InterruptLine; \
+      UCHAR InterruptPin; \
+      USHORT BridgeControl; \
+    } type1; \
+    struct _PCI_HEADER_TYPE_2 { \
+      ULONG SocketRegistersBaseAddress; \
+      UCHAR CapabilitiesPtr; \
+      UCHAR Reserved; \
+      USHORT SecondaryStatus; \
+      UCHAR PrimaryBus; \
+      UCHAR SecondaryBus; \
+      UCHAR SubordinateBus; \
+      UCHAR SecondaryLatency; \
+      struct { \
+        ULONG Base; \
+        ULONG Limit; \
+      } Range[PCI_TYPE2_ADDRESSES-1]; \
+      UCHAR InterruptLine; \
+      UCHAR InterruptPin; \
+      USHORT BridgeControl; \
+    } type2; \
+  } u;
+
 typedef struct _PCI_COMMON_HEADER {
   PCI_COMMON_HEADER_LAYOUT
 } PCI_COMMON_HEADER, *PPCI_COMMON_HEADER;
 
-#ifdef __cplusplus
 typedef struct _PCI_COMMON_CONFIG {
   PCI_COMMON_HEADER_LAYOUT
   UCHAR DeviceSpecific[192];
 } PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
-#else
-typedef struct _PCI_COMMON_CONFIG {
-  PCI_COMMON_HEADER DUMMYSTRUCTNAME;
-  UCHAR DeviceSpecific[192];
-} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
-#endif
 
 #define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET(PCI_COMMON_CONFIG, DeviceSpecific))
 
index aac22cb..19af071 100644 (file)
@@ -495,80 +495,6 @@ typedef struct _SHARE_ACCESS {
   ULONG SharedDelete;
 } SHARE_ACCESS, *PSHARE_ACCESS;
 
-/* While MS WDK uses inheritance in C++, we cannot do this with gcc, as
-   inheritance, even from a struct renders the type non-POD. So we use
-   this hack */
-#define PCI_COMMON_HEADER_LAYOUT \
-  USHORT VendorID; \
-  USHORT DeviceID; \
-  USHORT Command; \
-  USHORT Status; \
-  UCHAR RevisionID; \
-  UCHAR ProgIf; \
-  UCHAR SubClass; \
-  UCHAR BaseClass; \
-  UCHAR CacheLineSize; \
-  UCHAR LatencyTimer; \
-  UCHAR HeaderType; \
-  UCHAR BIST; \
-  union { \
-    struct _PCI_HEADER_TYPE_0 { \
-      ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; \
-      ULONG CIS; \
-      USHORT SubVendorID; \
-      USHORT SubSystemID; \
-      ULONG ROMBaseAddress; \
-      UCHAR CapabilitiesPtr; \
-      UCHAR Reserved1[3]; \
-      ULONG Reserved2; \
-      UCHAR InterruptLine; \
-      UCHAR InterruptPin; \
-      UCHAR MinimumGrant; \
-      UCHAR MaximumLatency; \
-    } type0; \
-    struct _PCI_HEADER_TYPE_1 { \
-      ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; \
-      UCHAR PrimaryBus; \
-      UCHAR SecondaryBus; \
-      UCHAR SubordinateBus; \
-      UCHAR SecondaryLatency; \
-      UCHAR IOBase; \
-      UCHAR IOLimit; \
-      USHORT SecondaryStatus; \
-      USHORT MemoryBase; \
-      USHORT MemoryLimit; \
-      USHORT PrefetchBase; \
-      USHORT PrefetchLimit; \
-      ULONG PrefetchBaseUpper32; \
-      ULONG PrefetchLimitUpper32; \
-      USHORT IOBaseUpper16; \
-      USHORT IOLimitUpper16; \
-      UCHAR CapabilitiesPtr; \
-      UCHAR Reserved1[3]; \
-      ULONG ROMBaseAddress; \
-      UCHAR InterruptLine; \
-      UCHAR InterruptPin; \
-      USHORT BridgeControl; \
-    } type1; \
-    struct _PCI_HEADER_TYPE_2 { \
-      ULONG SocketRegistersBaseAddress; \
-      UCHAR CapabilitiesPtr; \
-      UCHAR Reserved; \
-      USHORT SecondaryStatus; \
-      UCHAR PrimaryBus; \
-      UCHAR SecondaryBus; \
-      UCHAR SubordinateBus; \
-      UCHAR SecondaryLatency; \
-      struct { \
-        ULONG Base; \
-        ULONG Limit; \
-      } Range[PCI_TYPE2_ADDRESSES-1]; \
-      UCHAR InterruptLine; \
-      UCHAR InterruptPin; \
-      USHORT BridgeControl; \
-    } type2; \
-  } u;
-
 typedef enum _CREATE_FILE_TYPE {
   CreateFileTypeNone,
   CreateFileTypeNamedPipe,
@@ -2988,21 +2914,88 @@ typedef struct _PCI_SLOT_NUMBER {
 #define PCI_TYPE1_ADDRESSES               2
 #define PCI_TYPE2_ADDRESSES               5
 
+/* While MS WDK uses inheritance in C++, we cannot do this with gcc, as
+   inheritance, even from a struct renders the type non-POD. So we use
+   this hack */
+#define PCI_COMMON_HEADER_LAYOUT \
+  USHORT VendorID; \
+  USHORT DeviceID; \
+  USHORT Command; \
+  USHORT Status; \
+  UCHAR RevisionID; \
+  UCHAR ProgIf; \
+  UCHAR SubClass; \
+  UCHAR BaseClass; \
+  UCHAR CacheLineSize; \
+  UCHAR LatencyTimer; \
+  UCHAR HeaderType; \
+  UCHAR BIST; \
+  union { \
+    struct _PCI_HEADER_TYPE_0 { \
+      ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; \
+      ULONG CIS; \
+      USHORT SubVendorID; \
+      USHORT SubSystemID; \
+      ULONG ROMBaseAddress; \
+      UCHAR CapabilitiesPtr; \
+      UCHAR Reserved1[3]; \
+      ULONG Reserved2; \
+      UCHAR InterruptLine; \
+      UCHAR InterruptPin; \
+      UCHAR MinimumGrant; \
+      UCHAR MaximumLatency; \
+    } type0; \
+    struct _PCI_HEADER_TYPE_1 { \
+      ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; \
+      UCHAR PrimaryBus; \
+      UCHAR SecondaryBus; \
+      UCHAR SubordinateBus; \
+      UCHAR SecondaryLatency; \
+      UCHAR IOBase; \
+      UCHAR IOLimit; \
+      USHORT SecondaryStatus; \
+      USHORT MemoryBase; \
+      USHORT MemoryLimit; \
+      USHORT PrefetchBase; \
+      USHORT PrefetchLimit; \
+      ULONG PrefetchBaseUpper32; \
+      ULONG PrefetchLimitUpper32; \
+      USHORT IOBaseUpper16; \
+      USHORT IOLimitUpper16; \
+      UCHAR CapabilitiesPtr; \
+      UCHAR Reserved1[3]; \
+      ULONG ROMBaseAddress; \
+      UCHAR InterruptLine; \
+      UCHAR InterruptPin; \
+      USHORT BridgeControl; \
+    } type1; \
+    struct _PCI_HEADER_TYPE_2 { \
+      ULONG SocketRegistersBaseAddress; \
+      UCHAR CapabilitiesPtr; \
+      UCHAR Reserved; \
+      USHORT SecondaryStatus; \
+      UCHAR PrimaryBus; \
+      UCHAR SecondaryBus; \
+      UCHAR SubordinateBus; \
+      UCHAR SecondaryLatency; \
+      struct { \
+        ULONG Base; \
+        ULONG Limit; \
+      } Range[PCI_TYPE2_ADDRESSES-1]; \
+      UCHAR InterruptLine; \
+      UCHAR InterruptPin; \
+      USHORT BridgeControl; \
+    } type2; \
+  } u;
+
 typedef struct _PCI_COMMON_HEADER {
   PCI_COMMON_HEADER_LAYOUT
 } PCI_COMMON_HEADER, *PPCI_COMMON_HEADER;
 
-#ifdef __cplusplus
 typedef struct _PCI_COMMON_CONFIG {
   PCI_COMMON_HEADER_LAYOUT
   UCHAR DeviceSpecific[192];
 } PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
-#else
-typedef struct _PCI_COMMON_CONFIG {
-  PCI_COMMON_HEADER DUMMYSTRUCTNAME;
-  UCHAR DeviceSpecific[192];
-} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG;
-#endif
 
 #define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET(PCI_COMMON_CONFIG, DeviceSpecific))