From 5f7273293dd3fabc7903647532d65d143f3994af Mon Sep 17 00:00:00 2001 From: czhang46 Date: Wed, 16 Oct 2013 07:43:14 +0000 Subject: [PATCH] Fix DxeCapsuleLib build failure Signed-off-by : Chao Zhang Reviewed-by : Gao Liming git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14779 6f19259b-4bc3-4df7-8a09-765794883524 --- .../Library/DxeCapsuleLib/DxeCapsuleLib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.c b/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.c index 104b194369..04db1a4f6c 100644 --- a/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.c +++ b/IntelFrameworkModulePkg/Library/DxeCapsuleLib/DxeCapsuleLib.c @@ -201,8 +201,8 @@ ProcessFmpCapsuleImage ( MemMapNode.Header.Type = HARDWARE_DEVICE_PATH; MemMapNode.Header.SubType = HW_MEMMAP_DP; MemMapNode.MemoryType = EfiBootServicesCode; - MemMapNode.StartingAddress = (EFI_PHYSICAL_ADDRESS)CapsuleHeader; - MemMapNode.EndingAddress = (EFI_PHYSICAL_ADDRESS)((UINT8 *)CapsuleHeader + CapsuleHeader->CapsuleImageSize - 1); + MemMapNode.StartingAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)CapsuleHeader; + MemMapNode.EndingAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)((UINT8 *)CapsuleHeader + CapsuleHeader->CapsuleImageSize - 1); DriverDevicePath = AppendDevicePathNode (NULL, &MemMapNode.Header); if (DriverDevicePath == NULL) { @@ -210,13 +210,13 @@ ProcessFmpCapsuleImage ( } for (Index = 0; Index < FmpCapsuleHeader->EmbeddedDriverCount; Index++) { - if (FmpCapsuleHeader->PayloadItemCount == 0 && Index == FmpCapsuleHeader->EmbeddedDriverCount - 1) { + if (FmpCapsuleHeader->PayloadItemCount == 0 && Index == (UINTN)FmpCapsuleHeader->EmbeddedDriverCount - 1) { // // When driver is last element in the ItemOffsetList array, the driver size is calculated by reference CapsuleImageSize in EFI_CAPSULE_HEADER // - DriverLen = CapsuleHeader->CapsuleImageSize - CapsuleHeader->HeaderSize - ItemOffsetList[Index]; + DriverLen = CapsuleHeader->CapsuleImageSize - CapsuleHeader->HeaderSize - (UINTN)ItemOffsetList[Index]; } else { - DriverLen = ItemOffsetList[Index + 1] - ItemOffsetList[Index]; + DriverLen = (UINTN)ItemOffsetList[Index + 1] - (UINTN)ItemOffsetList[Index]; } Status = gBS->LoadImage( @@ -265,7 +265,7 @@ ProcessFmpCapsuleImage ( Status = gBS->HandleProtocol( HandleBuffer[Index1], &gEfiFirmwareManagementProtocolGuid, - &Fmp + (VOID **)&Fmp ); if (EFI_ERROR(Status)) { continue;