MdeModulePkg: ConSplitterDxe: use U64 mult/div wrappers in AbsPtr scaling

This is an emergency fix for UINT64 multiplications and divisions not
being done with the right BaseLib functions -- they break Ia32 builds.

Fixes: 30ed3422ab
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
Laszlo Ersek 2016-03-16 13:54:01 +01:00
parent 2939c778a3
commit 25896aa391
1 changed files with 24 additions and 3 deletions

View File

@ -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) {