From de1fad6887bf8f92b4a84bc14877ace68873ee8f Mon Sep 17 00:00:00 2001 From: lgao4 Date: Wed, 1 Jul 2009 09:59:33 +0000 Subject: 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 --- MdePkg/Include/Ppi/PciCfg2.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'MdePkg') diff --git a/MdePkg/Include/Ppi/PciCfg2.h b/MdePkg/Include/Ppi/PciCfg2.h index 384bdbac4a..95702c60f0 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 + #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 -- cgit v1.2.3