MdePkg: add missing #defines for decoding PCIe 2.1 extended capability structures
authorJaben Carsey <jaben.carsey@intel.com>
Fri, 10 Jan 2014 22:30:37 +0000 (22:30 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 10 Jan 2014 22:30:37 +0000 (22:30 +0000)
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15096 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/IndustryStandard/PciExpress21.h

index 3d121a24aefa3bb5a120827658f18ceb8a1b0987..a9915e032bfa3e5a202c638d766956298e642c34 100644 (file)
@@ -241,6 +241,8 @@ typedef struct {
   PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY  Capability[1];\r
 } PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR;\r
 \r
   PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY  Capability[1];\r
 } PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR;\r
 \r
+#define GET_NUMBER_RESIZABLE_BARS(x) (((x->Capability[0].ResizableBarControl) & 0xE0) >> 5)\r
+\r
 #define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_ID    0x000E\r
 #define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_VER1  0x1\r
 \r
 #define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_ID    0x000E\r
 #define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_VER1  0x1\r
 \r
@@ -284,4 +286,6 @@ typedef struct {
   UINT16                                                  TphStTable[1];\r
 } PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH;\r
 \r
   UINT16                                                  TphStTable[1];\r
 } PCI_EXPRESS_EXTENDED_CAPABILITIES_TPH;\r
 \r
+#define GET_TPH_TABLE_SIZE(x) ((x->TphRequesterCapability & 0x7FF0000)>>16) * sizeof(UINT16)\r
+\r
 #endif\r
 #endif\r