OvmfPkg: QemuVideoDxe: the VBE shim needs no 64-bit shifts (VS2010)
authorScott Duplichan <scott@notabs.org>
Fri, 14 Nov 2014 10:23:55 +0000 (10:23 +0000)
committerlersek <lersek@Edk2>
Fri, 14 Nov 2014 10:23:55 +0000 (10:23 +0000)
commit75f8e3aaff4d77ec2a04c14633d63b67c651edda
tree9dd1c337cc88dea3db15304f0b4a076e09b9c904
parentf7e899c7c74e5983e40e32257b33918ea6f466f0
OvmfPkg: QemuVideoDxe: the VBE shim needs no 64-bit shifts (VS2010)

The SegmentC local variable has type EFI_PHYSICAL_ADDRESS for (justified)
style reasons. However, the 64-bit bit-shifts that it undergoes result in
intrinsic calls when built with VS2010 for Ia32 / NOOPT.

The concrete value of SegmentC, 0xC0000, and the results  of the bitops
that are based on it, are statically computeable. Cast SegmentC to UINT32
before subjecting it to bitwise operations; we can see in advance that
this won't lead to range loss.

Contributed-under: TianoCore Contribution Agreement 1.0

Signed-off-by: Scott Duplichan <scott@notabs.org>
[lersek@redhat.com: dropped now superfluous outermost parens; commit msg]

Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Build-tested-by: Scott Duplichan <scott@notabs.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16385 6f19259b-4bc3-4df7-8a09-765794883524
OvmfPkg/QemuVideoDxe/VbeShim.c