From bbee9482d7a361474dd12b35bda1553a9996e130 Mon Sep 17 00:00:00 2001 From: vanjeff Date: Fri, 13 Apr 2007 02:23:10 +0000 Subject: [PATCH] Fixed some issues for IA32 architecture platform build. 1. added UINTN typecast for shift. 2. updated Nt32.fpd and Unix.fpd. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2564 6f19259b-4bc3-4df7-8a09-765794883524 --- EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c | 25 ++++++------------------ EdkNt32Pkg/Nt32.fpd | 10 ++++++++++ EdkUnixPkg/Unix.fpd | 10 ++++++++++ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c index fb6f21fe9d..1296836a30 100644 --- a/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c +++ b/EdkModulePkg/Bus/Pci/PciBus/Dxe/PciLib.c @@ -2113,7 +2113,7 @@ ReadConfigData ( return Status; } - Stride = 1 << AccessWidth; + Stride = 1 << AccessWidth; AccessAddress += Stride; if (AccessAddress >= (Address + (1 << Width))) { // @@ -2215,9 +2215,7 @@ UpdateConfigData ( { EFI_STATUS Status; EFI_PCI_REGISTER_VALUE_DATA *PciRegisterData; - UINT64 AndValue; - UINT64 OrValue; - UINT32 TempValue; + UINT64 TempValue; // // check register value incompatibility @@ -2226,28 +2224,17 @@ UpdateConfigData ( if (Status == EFI_SUCCESS) { - AndValue = (PciRegisterData->AndValue) >> ((Address & 0x3) * 8); - OrValue = (PciRegisterData->OrValue) >> ((Address & 0x3) * 8); - TempValue = * (UINT32 *) Buffer; - if (PciRegisterData->AndValue != VALUE_NOCARE) { - TempValue &= (UINT32) AndValue; - } - if (PciRegisterData->OrValue != VALUE_NOCARE) { - TempValue |= (UINT32) OrValue; - } - switch (Width) { case EfiPciWidthUint8: - *(UINT32 *)Buffer = *(UINT32 *)Buffer & 0xffffff00 + (UINT8)TempValue; + * (UINT8 *) Buffer = (UINT8) TempValue; break; - case EfiPciWidthUint16: - *(UINT32 *)Buffer = *(UINT32 *)Buffer & 0xffff0000 + (UINT16)TempValue; + * (UINT16 *) Buffer = (UINT16) TempValue; break; case EfiPciWidthUint32: - *(UINT32 *)Buffer = TempValue; + * (UINT32 *) Buffer = (UINT32) TempValue; break; default: @@ -2340,7 +2327,7 @@ WriteConfigData ( // UpdateConfigData (PciDeviceInfo, PCI_REGISTER_READ, AccessWidth, AccessAddress & 0xff, &Data); - Shift = (Address - AccessAddress) * 8; + Shift = (UINTN) ((Address - AccessAddress) * 8); switch (Width) { case EfiPciWidthUint8: Data = (* (UINT8 *) Buffer) << Shift | (Data & ~(0xff << Shift)); diff --git a/EdkNt32Pkg/Nt32.fpd b/EdkNt32Pkg/Nt32.fpd index ab4ac4b913..9eb391b61f 100644 --- a/EdkNt32Pkg/Nt32.fpd +++ b/EdkNt32Pkg/Nt32.fpd @@ -4537,6 +4537,8 @@ + + @@ -4651,6 +4653,14 @@ 4 320 + + PcdPciIncompatibleDeviceSupportMask + 0x0001003f + gEfiEdkModulePkgTokenSpaceGuid + UINT8 + 1 + 0x0 + FV_RECOVERY diff --git a/EdkUnixPkg/Unix.fpd b/EdkUnixPkg/Unix.fpd index b088f7d24c..c48a5e78c6 100644 --- a/EdkUnixPkg/Unix.fpd +++ b/EdkUnixPkg/Unix.fpd @@ -4521,6 +4521,8 @@ + + @@ -4635,6 +4637,14 @@ 4 320 + + PcdPciIncompatibleDeviceSupportMask + 0x0001003f + gEfiEdkModulePkgTokenSpaceGuid + UINT8 + 1 + 0x0 + FV_RECOVERY