Vlv2TbltDevicePkg/PlatformFlashAccessLib: Fix IA32 build issues
authorMichael Kinney <michael.d.kinney@intel.com>
Tue, 29 Nov 2016 09:13:21 +0000 (01:13 -0800)
committerMichael Kinney <michael.d.kinney@intel.com>
Tue, 29 Nov 2016 16:17:50 +0000 (08:17 -0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=263

Fix IA32 build issues in the PlatformFlashAccessLib.  Some of the
UINT64 FLASH addresses values need to be typecast to UINTN.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: David Wei <david.wei@intel.com>
Cc: Mang Guo <mang.guo@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Vlv2TbltDevicePkg/Feature/Capsule/Library/PlatformFlashAccessLib/PlatformFlashAccessLib.c

index efa1dca..f3cb31d 100644 (file)
@@ -59,7 +59,7 @@ PerformFlashWrite (
   }\r
 \r
   DEBUG((DEBUG_INFO, "                  - 0x%x(%x) - 0x%x\n", (UINTN)FlashAddress, (UINTN)FlashAddressType, Length));\r
-  LibFvbFlashDeviceBlockLock(FlashAddress, Length, FALSE);\r
+  LibFvbFlashDeviceBlockLock((UINTN)FlashAddress, Length, FALSE);\r
 \r
   //\r
   // Erase & Write\r
@@ -67,7 +67,7 @@ PerformFlashWrite (
   Status = LibFvbFlashDeviceBlockErase((UINTN)FlashAddress, Length);\r
   ASSERT_EFI_ERROR(Status);\r
   if (EFI_ERROR(Status)) {\r
-    LibFvbFlashDeviceBlockLock(FlashAddress, Length, TRUE);\r
+    LibFvbFlashDeviceBlockLock((UINTN)FlashAddress, Length, TRUE);\r
     DEBUG((DEBUG_ERROR, "Flash Erase error\n"));\r
     return Status;\r
   }\r
@@ -75,12 +75,12 @@ PerformFlashWrite (
   Status = LibFvbFlashDeviceWrite((UINTN)FlashAddress, &Length, Buffer);\r
   ASSERT_EFI_ERROR(Status);\r
   if (EFI_ERROR(Status)) {\r
-    LibFvbFlashDeviceBlockLock(FlashAddress, Length, TRUE);\r
+    LibFvbFlashDeviceBlockLock((UINTN)FlashAddress, Length, TRUE);\r
     DEBUG((DEBUG_ERROR, "Flash write error\n"));\r
     return Status;\r
   }\r
 \r
-  LibFvbFlashDeviceBlockLock(FlashAddress, Length, TRUE);\r
+  LibFvbFlashDeviceBlockLock((UINTN)FlashAddress, Length, TRUE);\r
 \r
   return EFI_SUCCESS;\r
 }\r
@@ -146,10 +146,10 @@ MicrocodeFlashWrite (
     // Save original buffer\r
     //\r
     if (OffsetHead != 0) {\r
-      CopyMem((UINT8 *)AlignedBuffer, (VOID *)AlignedFlashAddress, OffsetHead);\r
+      CopyMem((UINT8 *)AlignedBuffer, (VOID *)(UINTN)AlignedFlashAddress, OffsetHead);\r
     }\r
     if (OffsetTail != 0) {\r
-      CopyMem((UINT8 *)AlignedBuffer + OffsetHead + Length, (VOID *)(AlignedFlashAddress + OffsetHead + Length), OffsetTail);\r
+      CopyMem((UINT8 *)AlignedBuffer + OffsetHead + Length, (VOID *)(UINTN)(AlignedFlashAddress + OffsetHead + Length), OffsetTail);\r
     }\r
     //\r
     // Override new buffer\r