]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/PciExpress21.h: Fix typo in PCI_REG_PCIE_SLOT_CONTROL
authorRuiyu Ni <ruiyu.ni@intel.com>
Thu, 26 Oct 2017 08:06:56 +0000 (16:06 +0800)
committerRuiyu Ni <ruiyu.ni@intel.com>
Wed, 8 Nov 2017 04:46:50 +0000 (12:46 +0800)
PCI_REG_PCIE_SLOT_CONTROL contains a typo. It is defined as:
typedef union {
  struct {
    UINT32 AttentionButtonPressed : 1;
    UINT32 ...
    ...
  } Bits;
  UINT16   Uint16;
} PCI_REG_PCIE_SLOT_CONTROL;

The bit field data type should be UINT16 instead of UINT32,
results sizeof (PCI_REG_PCIE_SLOT_CONTROL) equals to 4 instead of 2.

Because this structure is used in PCI_CAPABILITY_PCIEXP as below:
typedef struct {
  ...
  PCI_REG_PCIE_SLOT_CONTROL       SlotControl;
  PCI_REG_PCIE_SLOT_STATUS        SlotStatus;
} PCI_CAPABILITY_PCIEXP;

It cause the OFFSET_OF (PCI_CAPABILITY_PCIEXP, SlotStatus) equal
to a wrong value.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Include/IndustryStandard/PciExpress21.h

index ce9c06a7c6d71d2c3252852dd5913d7d61bfebe2..d90b5975ba922a47550121a978075b90625ee7e3 100644 (file)
@@ -182,18 +182,18 @@ typedef union {
 \r
 typedef union {\r
   struct {\r
-    UINT32 AttentionButtonPressed : 1;\r
-    UINT32 PowerFaultDetected : 1;\r
-    UINT32 MrlSensorChanged : 1;\r
-    UINT32 PresenceDetectChanged : 1;\r
-    UINT32 CommandCompletedInterrupt : 1;\r
-    UINT32 HotPlugInterrupt : 1;\r
-    UINT32 AttentionIndicator : 2;\r
-    UINT32 PowerIndicator : 2;\r
-    UINT32 PowerController : 1;\r
-    UINT32 ElectromechanicalInterlock : 1;\r
-    UINT32 DataLinkLayerStateChanged : 1;\r
-    UINT32 Reserved : 3;\r
+    UINT16 AttentionButtonPressed : 1;\r
+    UINT16 PowerFaultDetected : 1;\r
+    UINT16 MrlSensorChanged : 1;\r
+    UINT16 PresenceDetectChanged : 1;\r
+    UINT16 CommandCompletedInterrupt : 1;\r
+    UINT16 HotPlugInterrupt : 1;\r
+    UINT16 AttentionIndicator : 2;\r
+    UINT16 PowerIndicator : 2;\r
+    UINT16 PowerController : 1;\r
+    UINT16 ElectromechanicalInterlock : 1;\r
+    UINT16 DataLinkLayerStateChanged : 1;\r
+    UINT16 Reserved : 3;\r
   } Bits;\r
   UINT16   Uint16;\r
 } PCI_REG_PCIE_SLOT_CONTROL;\r