From patchwork Wed Mar 16 13:10:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 63929 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1312059lbc; Wed, 16 Mar 2016 06:10:41 -0700 (PDT) X-Received: by 10.66.66.140 with SMTP id f12mr5810651pat.122.1458133837291; Wed, 16 Mar 2016 06:10:37 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id q188si5190949pfq.49.2016.03.16.06.10.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 06:10:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id CA8601A1EF0; Wed, 16 Mar 2016 06:10:55 -0700 (PDT) X-Original-To: edk2-devel@ml01.01.org Delivered-To: edk2-devel@ml01.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4A93A1A1E33 for ; Wed, 16 Mar 2016 06:10:54 -0700 (PDT) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 6B64A73037 for ; Wed, 16 Mar 2016 13:10:34 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-113-41.phx2.redhat.com [10.3.113.41]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u2GDAXCY028901 for ; Wed, 16 Mar 2016 09:10:33 -0400 From: Laszlo Ersek To: edk2-devel@ml01.01.org Date: Wed, 16 Mar 2016 14:10:29 +0100 Message-Id: <1458133829-15247-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 16 Mar 2016 13:10:34 +0000 (UTC) Subject: [edk2] [COMMIT] MdeModulePkg: ConSplitterDxe: use U64 mult/div wrappers in AbsPtr scaling X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" This is an emergency fix for UINT64 multiplications and divisions not being done with the right BaseLib functions -- they break Ia32 builds. Fixes: 30ed3422ab2de03abf7c1433ebb482f6e5e16f45 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek --- Notes: This patch has been pushed as 25896aa391d04efecbee65bdf41a2de3660da440. I guess I'm losing patience with this kind of build breakage. See also . MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c | 27 +++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c index af90d5e5e4c3..0d6808197b16 100644 --- a/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c +++ b/MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitter.c @@ -4156,13 +4156,34 @@ ConSplitterAbsolutePointerGetState ( // Rescale to Con Splitter virtual Absolute Pointer's resolution. // if (!(MinX == 0 && MaxX == 0)) { - State->CurrentX = VirtualMinX + (CurrentState.CurrentX * (VirtualMaxX - VirtualMinX)) / (MaxX - MinX); + State->CurrentX = VirtualMinX + DivU64x64Remainder ( + MultU64x64 ( + CurrentState.CurrentX, + VirtualMaxX - VirtualMinX + ), + MaxX - MinX, + NULL + ); } if (!(MinY == 0 && MaxY == 0)) { - State->CurrentY = VirtualMinY + (CurrentState.CurrentY * (VirtualMaxY - VirtualMinY)) / (MaxY - MinY); + State->CurrentY = VirtualMinY + DivU64x64Remainder ( + MultU64x64 ( + CurrentState.CurrentY, + VirtualMaxY - VirtualMinY + ), + MaxY - MinY, + NULL + ); } if (!(MinZ == 0 && MaxZ == 0)) { - State->CurrentZ = VirtualMinZ + (CurrentState.CurrentZ * (VirtualMaxZ - VirtualMinZ)) / (MaxZ - MinZ); + State->CurrentZ = VirtualMinZ + DivU64x64Remainder ( + MultU64x64 ( + CurrentState.CurrentZ, + VirtualMaxZ - VirtualMinZ + ), + MaxZ - MinZ, + NULL + ); } } else if (Status == EFI_DEVICE_ERROR) {