summaryrefslogtreecommitdiff
path: root/MdePkg/Include
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-01 09:59:33 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2009-07-01 09:59:33 +0000
commitde1fad6887bf8f92b4a84bc14877ace68873ee8f (patch)
tree6f8853565a87bb80499ecb445ef51495e3d70b12 /MdePkg/Include
parent61efb259fb013773c582cbac2010529dbcb4568a (diff)
downloadedk2-de1fad6887bf8f92b4a84bc14877ace68873ee8f.zip
edk2-de1fad6887bf8f92b4a84bc14877ace68873ee8f.tar.gz
edk2-de1fad6887bf8f92b4a84bc14877ace68873ee8f.tar.bz2
Enhance function macro EFI_PEI_PCI_CFG_ADDRESS defined in MdePkg/Include/Ppi/PciCfg2.h to generate the correct Address for PI PciCfg PPI when bus number is larger than 127 and reg is less than 256. And Enhance function macro EFI_PEI_PCI_CFG_ADDRESS to handle that reg is larger than and equal to 256.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8701 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Include')
-rw-r--r--MdePkg/Include/Ppi/PciCfg2.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/MdePkg/Include/Ppi/PciCfg2.h b/MdePkg/Include/Ppi/PciCfg2.h
index 384bdba..95702c6 100644
--- a/MdePkg/Include/Ppi/PciCfg2.h
+++ b/MdePkg/Include/Ppi/PciCfg2.h
@@ -21,17 +21,19 @@
#ifndef __PEI_PCI_CFG2_H__
#define __PEI_PCI_CFG2_H__
+#include <Library/BaseLib.h>
+
#define EFI_PEI_PCI_CFG2_PPI_GUID \
{ 0x57a449a, 0x1fdc, 0x4c06, { 0xbf, 0xc9, 0xf5, 0x3f, 0x6a, 0x99, 0xbb, 0x92 } }
-
typedef struct _EFI_PEI_PCI_CFG2_PPI EFI_PEI_PCI_CFG2_PPI;
#define EFI_PEI_PCI_CFG_ADDRESS(bus,dev,func,reg) \
- (((bus) << 24) | \
- ((dev) << 16) | \
- ((func) << 8) | \
- ((reg) < 256 ? (reg) : ((UINT64)(reg) << 32)));
+ (UINT64) ( \
+ (((UINTN) bus) << 24) | \
+ (((UINTN) dev) << 16) | \
+ (((UINTN) func) << 8) | \
+ (((UINTN) (reg)) < 256 ? ((UINTN) (reg)) : (UINT64) (LShiftU64 ((UINT64) (reg), 32))));
///
/// EFI_PEI_PCI_CFG_PPI_WIDTH