]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Include/IndustryStandard/PciExpress21.h
MdePkg: Define structures for Resizable BAR Capability
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / PciExpress21.h
index 2c07cb560e92aea21d8dda9f9d61c273dbd1a494..4617dc1569846e4958ce435228f0c62243c04bc7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Support for the latest PCI standard.\r
 \r
-  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>\r
   (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
   SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
@@ -632,10 +632,30 @@ typedef struct {
 #define PCI_EXPRESS_EXTENDED_CAPABILITY_RESIZABLE_BAR_ID    0x0015\r
 #define PCI_EXPRESS_EXTENDED_CAPABILITY_RESIZABLE_BAR_VER1  0x1\r
 \r
+typedef union {\r
+  struct {\r
+    UINT32 Reserved:4;\r
+    UINT32 BarSizeCapability:28;\r
+  } Bits;\r
+  UINT32   Uint32;\r
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_CAPABILITY;\r
+\r
+\r
+typedef union {\r
+  struct {\r
+    UINT32 BarIndex:3;\r
+    UINT32 Reserved:2;\r
+    UINT32 ResizableBarNumber:3;\r
+    UINT32 BarSize:6;\r
+    UINT32 Reserved2:2;\r
+    UINT32 BarSizeCapability:16;\r
+  } Bits;\r
+  UINT32   Uint32;\r
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_CONTROL;\r
+\r
 typedef struct {\r
-  UINT32                                                 ResizableBarCapability;\r
-  UINT16                                                 ResizableBarControl;\r
-  UINT16                                                 Reserved;\r
+  PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_CAPABILITY ResizableBarCapability;\r
+  PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_CONTROL    ResizableBarControl;\r
 } PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY;\r
 \r
 typedef struct {\r
@@ -643,7 +663,7 @@ typedef struct {
   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
+#define GET_NUMBER_RESIZABLE_BARS(x) (x->Capability[0].ResizableBarControl.Bits.ResizableBarNumber)\r
 \r
 #define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_ID    0x000E\r
 #define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_VER1  0x1\r