OvmfPkg/VirtioBlkDxe/VirtioBlk.c:667: undefined reference to `__umoddi3'
OvmfPkg/VirtioBlkDxe/VirtioBlk.c:750: undefined reference to `__udivdi3'

These operations would come from libgcc in the IA32 build, but OVMF does not
link against libgcc.

Regression-tested the X64 build with Fedora 18 Alpha XFCE and Windows 8
Consumer Preview guests.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Laszlo Ersek <[email protected]>
---
 OvmfPkg/VirtioBlkDxe/VirtioBlk.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
index 86041f0..1ac36cd 100644
--- a/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
+++ b/OvmfPkg/VirtioBlkDxe/VirtioBlk.c
@@ -664,7 +664,7 @@ VirtioBlkInit (
       goto Failed;
     }
     if (BlockSize == 0 || BlockSize % 512 != 0 ||
-        NumSectors % (BlockSize / 512) != 0) {
+        ModU64x32 (NumSectors, BlockSize / 512) != 0) {
       //
       // We can only handle a logical block consisting of whole sectors,
       // and only a disk composed of whole logical blocks.
@@ -747,7 +747,8 @@ VirtioBlkInit (
   Dev->BlockIoMedia.WriteCaching     = !!(Features & VIRTIO_BLK_F_FLUSH);
   Dev->BlockIoMedia.BlockSize        = BlockSize;
   Dev->BlockIoMedia.IoAlign          = 0;
-  Dev->BlockIoMedia.LastBlock        = NumSectors / (BlockSize / 512) - 1;
+  Dev->BlockIoMedia.LastBlock        = DivU64x32 (NumSectors,
+                                         BlockSize / 512) - 1;
   return EFI_SUCCESS;
 
 ReleaseQueue:
-- 
1.7.1


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to