-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArmPkg: Update a few casting instances #6307
base: master
Are you sure you want to change the base?
Conversation
I'm not convinced the breaking-change label should be set. What does this set break? |
I marked it as breaking change mainly because there is public interface update inside ArmLib. Do we not mark an implicit integer promotion change as breaking? |
For ArmCacheWritebackGranule()? |
Agreed. The actual value in the existing implementation will not exceed the UINT32 limit, which was why it was kept as it was. But I updated the implementation to match UINT32 return anyway. Also, the breaking change label is removed. |
The current code path supporting `PcdArmGicV3WithV2Legacy` will read 32 bit CPU target and try to program ARM_GIC_ICDIPTR. However, all these operations are 32bit wide. This change casts the CpuTarget variable to be UINT32 before calling MMIO read. Cc: Leif Lindholm <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Sami Mujawar <[email protected]> Signed-off-by: Kun Qin <[email protected]>
The current implementation operates on 64bit value with implicit value truncation. This change updates the involved frequencies to use 64 bit based operations. Cc: Leif Lindholm <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Sami Mujawar <[email protected]> Signed-off-by: Kun Qin <[email protected]>
The existing operation in ArmArchTimerLib is operating on UINT32 or UINT64 based on the target system. This casting game originates from the fact that timer frequency is UINTN type. This change will simply promote all operations to UINT64 based, which will remove the casting and conditional #if in the code for better portability and readability. Cc: Leif Lindholm <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Sami Mujawar <[email protected]> Signed-off-by: Kun Qin <[email protected]>
ArmCacheWritebackGranule should not return value higher than MAX_UINT32. This change will allow the usage without architecture depenedent return size. Cc: Leif Lindholm <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Sami Mujawar <[email protected]> Signed-off-by: Kun Qin <[email protected]>
Update function implementation to match interface definition. The return should be bound to 0xffff0000, which is guaranteed to be a UINT32. Cc: Leif Lindholm <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Sami Mujawar <[email protected]> Signed-off-by: Kun Qin <[email protected]>
The current VectorBase is taking value from a 64bit PCD into a UINTN value, which could have truncated value for 32bit system. In addition, the comparison between UINTN and INTN could lead to undesired comparison outcome or compiler complaints. This change updates all of them to be UINT64 based operation. Cc: Leif Lindholm <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Sami Mujawar <[email protected]> Signed-off-by: Kun Qin <[email protected]>
The current DescribeExceptionSyndrome is taking ESR as 32bit value. However, ESR should be a 64 bit value. This change updates the function to intake a 64bit value. Cc: Leif Lindholm <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Sami Mujawar <[email protected]> Signed-off-by: Kun Qin <[email protected]>
Description
The existing ArmPkg implementation has some implicit casting and even truncation. Some caused build failures on non-GCC compilers. This change intends to fix those issues.
How This Was Tested
This change is tested on QEMU SBSA platform.
Integration Instructions
N/A