Oliver,
I agree with the overflow issues related to signed types and bit 31 and bit 63.
Yes. Please do test the change I have suggested. We have used that same style
in some other places to handle similar compatibility issues.
Mike
From: Olivier Martin [mailto:olivier.mar...@arm.com]
Sent: Wednesday, April 01, 2015 8:12 AM
To: Kinney, Michael D
Cc: edk2-devel@lists.sourceforge.net
Subject: RE: [PATCH] MdePkg/DevicePath.h: Fixed 'integer operation result is
out of range'
The failing line is this one:
./OvmfPkg/QemuVideoDxe/Driver.c: AcpiDeviceNode.ADR = ACPI_DISPLAY_ADR (1, 0,
0, 1, 0, ACPI_ADR_DISPLAY_TYPE_VGA, 0, 0);
_DeviceIdScheme=(UINT32)1 should not be an issue. But ((INT32)1 << 31) would
overflow the sign bit.
Your change should also work. I can test it if you want.
From: Kinney, Michael D [mailto:michael.d.kin...@intel.com]
Sent: 01 April 2015 15:47
To: Olivier Martin; Kinney, Michael D
Cc: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
Subject: RE: [PATCH] MdePkg/DevicePath.h: Fixed 'integer operation result is
out of range'
Oliver,
What is the test case that fails? It is passing in a constant or a variable as
the first parameter to the macro. If it is a variable, I am guessing that the
type is smaller than UINT32?
It makes sense that the left shift 31 bits needs to be considered as a UINT32
for that to be meaningful.
I am curious. Does the following change top use a typecast to UINT32 before
the shift also resolve the compiler compatibility issue?
#define ACPI_DISPLAY_ADR(_DeviceIdScheme, _HeadId, _NonVgaOutput,
_BiosCanDetect, _VendorInfo, _Type, _Port, _Index) \
((UINT32)( ((UINT32)((_DeviceIdScheme) & 0x1) << 31) | \
(((_HeadId) & 0x7) << 18) | \
(((_NonVgaOutput) & 0x1) << 17) | \
(((_BiosCanDetect) & 0x1) << 16) | \
(((_VendorInfo) & 0xf) << 12) | \
(((_Type) & 0xf) << 8) | \
(((_Port) & 0xf) << 4) | \
((_Index) & 0xf) ))
Thanks,
Mike
From: Olivier Martin [mailto:olivier.mar...@arm.com]
Sent: Wednesday, April 01, 2015 4:53 AM
To: Kinney, Michael D
Cc: edk2-devel@lists.sourceforge.net<mailto:edk2-devel@lists.sourceforge.net>
Subject: [PATCH] MdePkg/DevicePath.h: Fixed 'integer operation result is out of
range'
Dear MdePkg maintainer,
ARM toolchain raised this compilation error when using the macro
ACPI_DISPLAY_ADR().
The attached patch this issue.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin
<olivier.mar...@arm.com<mailto:olivier.mar...@arm.com>>
Regards,
Olivier
-- IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered
in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
Registered in England & Wales, Company No: 2548782
-- IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient,
please notify the sender immediately and do not disclose the contents to any
other person, use it for any purpose, or store or copy the information in any
medium. Thank you.
ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered
in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ,
Registered in England & Wales, Company No: 2548782
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel