From a44fef7de3454cb0cb32a65a5fca16bec0b9416d Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Wed, 26 May 2021 17:31:53 +0100 Subject: ArmPkg: Fix data type used for GicInterruptInterfaceBase The data type used by variables representing the GicInterruptInterfaceBase has been inconsistently used in the ArmGic driver and the library. The PCD defined for the GIC Interrupt interface base address is UINT64. However, the data types for the variables used is UINTN, INTN, and at some places UINT32. Therefore, update the data types to use UINTN and add necessary typecasts when reading values from the PCD. This should then be consistent across AArch32 and AArch64 builds. Signed-off-by: Sami Mujawar Reviewed-by: Ard Biesheuvel --- ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c') diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c index a93f68495a..9a0180b627 100644 --- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c +++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c @@ -400,9 +400,10 @@ GicV2DxeInitialize ( // the system. ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid); + ASSERT (PcdGet64 (PcdGicInterruptInterfaceBase) <= MAX_UINTN); ASSERT (PcdGet64 (PcdGicDistributorBase) <= MAX_UINTN); - mGicInterruptInterfaceBase = PcdGet64 (PcdGicInterruptInterfaceBase); + mGicInterruptInterfaceBase = (UINTN)PcdGet64 (PcdGicInterruptInterfaceBase); mGicDistributorBase = (UINTN)PcdGet64 (PcdGicDistributorBase); mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase); -- cgit v1.2.3