summaryrefslogtreecommitdiffstats
path: root/MdePkg
diff options
context:
space:
mode:
authorLuo, Heng <heng.luo@intel.com>2021-01-04 14:59:53 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-01-04 08:25:28 +0000
commit42fe8ca453f1ab19d03d8dc945398997b00b0777 (patch)
treec130dec29ab79637951984665013dd409380b393 /MdePkg
parent140674a4601f804302e79d08cb06f91c882ddf28 (diff)
downloadedk2-42fe8ca453f1ab19d03d8dc945398997b00b0777.tar.gz
edk2-42fe8ca453f1ab19d03d8dc945398997b00b0777.tar.bz2
edk2-42fe8ca453f1ab19d03d8dc945398997b00b0777.zip
MdePkg: Define structures for Resizable BAR Capability
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3138 Define structures for Resizable BAR Capability in MdePkg/Include/IndustryStandard/PciExpress21.h, Change ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c to use new structures. Cc: Ray Ni <ray.ni@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Heng Luo <heng.luo@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/IndustryStandard/PciExpress21.h30
1 files changed, 25 insertions, 5 deletions
diff --git a/MdePkg/Include/IndustryStandard/PciExpress21.h b/MdePkg/Include/IndustryStandard/PciExpress21.h
index 2c07cb560e..4617dc1569 100644
--- a/MdePkg/Include/IndustryStandard/PciExpress21.h
+++ b/MdePkg/Include/IndustryStandard/PciExpress21.h
@@ -1,7 +1,7 @@
/** @file
Support for the latest PCI standard.
- Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -632,10 +632,30 @@ typedef struct {
#define PCI_EXPRESS_EXTENDED_CAPABILITY_RESIZABLE_BAR_ID 0x0015
#define PCI_EXPRESS_EXTENDED_CAPABILITY_RESIZABLE_BAR_VER1 0x1
+typedef union {
+ struct {
+ UINT32 Reserved:4;
+ UINT32 BarSizeCapability:28;
+ } Bits;
+ UINT32 Uint32;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_CAPABILITY;
+
+
+typedef union {
+ struct {
+ UINT32 BarIndex:3;
+ UINT32 Reserved:2;
+ UINT32 ResizableBarNumber:3;
+ UINT32 BarSize:6;
+ UINT32 Reserved2:2;
+ UINT32 BarSizeCapability:16;
+ } Bits;
+ UINT32 Uint32;
+} PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_CONTROL;
+
typedef struct {
- UINT32 ResizableBarCapability;
- UINT16 ResizableBarControl;
- UINT16 Reserved;
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_CAPABILITY ResizableBarCapability;
+ PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_CONTROL ResizableBarControl;
} PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY;
typedef struct {
@@ -643,7 +663,7 @@ typedef struct {
PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR_ENTRY Capability[1];
} PCI_EXPRESS_EXTENDED_CAPABILITIES_RESIZABLE_BAR;
-#define GET_NUMBER_RESIZABLE_BARS(x) (((x->Capability[0].ResizableBarControl) & 0xE0) >> 5)
+#define GET_NUMBER_RESIZABLE_BARS(x) (x->Capability[0].ResizableBarControl.Bits.ResizableBarNumber)
#define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_ID 0x000E
#define PCI_EXPRESS_EXTENDED_CAPABILITY_ARI_CAPABILITY_VER1 0x1