Re: [PATCH] Update Graphics Info Hob FrameBufferSize Based on UEFI Spec 2.0
Ashraf Ali S
Hi., Michaeltoggle quoted message Show quoted text
The issue was coming due to assign UINTN to UINT32 (warning C4244: '=': conversion from 'UINTN' to 'UINT32', possible loss of data)
I will fix this in my code instead of changing in the EDK2.
Closing this bug, Thanks
Happy New Year 😊
Ashraf Ali S
Intel Technology India Pvt. Ltd.
From: Kinney, Michael D <michael.d.kinney@...>
Sent: Monday, January 3, 2022 1:55 AM
To: S, Ashraf Ali <ashraf.ali.s@...>; email@example.com; Kinney, Michael D <michael.d.kinney@...>
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@...>; Solanki, Digant H <digant.h.solanki@...>; V, Sangeetha <sangeetha.v@...>; Ni, Ray <ray.ni@...>; Gao, Liming <gaoliming@...>; Liu, Zhiguang <zhiguang.liu@...>
Subject: RE: [PATCH] Update Graphics Info Hob FrameBufferSize Based on UEFI Spec 2.0
HOBs must never use UINTN or pointer fields. HOBs must always be the same size no matter what CPU or CPU mode the structure is compiler for.
This is also a non-backwards compatible change to a HOB structure.
For the case where the GraphicsOutputProtocol is build for X64 and uses this HOB as input, the UINT32 value from the HOB can be cast to UINTN for the protocol.
Given that the cast is from UINT32 -> UINT32 for IA32 builds and UINT32->UINT64 for X64 builds, I do not see any case where there would be possible loss of data. The cast would always be to a type that is the same size or larger.
Can you please verify the compiler error you observed?