In the InitializeVariableFvHeader() function, both "Start" and "BlockSize"
have type UINTN. Therefore the (Start / BlockSize) division can be
compiled on all platforms without intrinsics.

In he current expression

  (EFI_LBA) Start / BlockSize

"Start" is cast to UINT64 (== EFI_LBA), which leads to a 64-by-32 bit
division on Ia32, breaking the VS2010 / NOOPT / Ia32 build. The simplest
way to fix this is to realize we don't need a cast at all. (The prototype
of QemuFlashWrite() is visible via "QemuFlash.h", and it will easily take
our UINTN quotient as UINT64.)

Suggested-by: Scott Duplichan <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <[email protected]>
---
 OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c 
b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c
index 42060c8..38be935 100644
--- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c
+++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.c
@@ -988,7 +988,7 @@ InitializeVariableFvHeader (
     //
     WriteLength = GoodFwVolHeader->HeaderLength;
     Status = QemuFlashWrite (
-               (EFI_LBA) Start / BlockSize,
+               Start / BlockSize,
                0,
                &WriteLength,
                (UINT8 *) GoodFwVolHeader);
-- 
1.8.3.1



------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to