summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
diff options
context:
space:
mode:
authorSami Mujawar <sami.mujawar@arm.com>2021-05-26 12:53:45 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-06-01 15:52:01 +0000
commit4ec9a6f6cd2eb236c5dc135aa41a073edfa56901 (patch)
treed4de5c298a970b0b468822c9d3717e7219973bfd /ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
parentb38068f9f6f38df747466c16da82ec15d6f9abcd (diff)
downloadedk2-4ec9a6f6cd2eb236c5dc135aa41a073edfa56901.tar.gz
edk2-4ec9a6f6cd2eb236c5dc135aa41a073edfa56901.tar.bz2
edk2-4ec9a6f6cd2eb236c5dc135aa41a073edfa56901.zip
ArmPkg: Fix data type used for GicDistributorBase
The data type used by variables representing the GicDistributorBase has been inconsistently used in the ArmGic driver and the library. The PCD defined for the GIC Distributor 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 <sami.mujawar@arm.com>
Diffstat (limited to 'ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c')
-rw-r--r--ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
index 779818ee89..a93f68495a 100644
--- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
+++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
@@ -2,7 +2,7 @@
Copyright (c) 2009, Hewlett-Packard Company. All rights reserved.<BR>
Portions copyright (c) 2010, Apple Inc. All rights reserved.<BR>
-Portions copyright (c) 2011-2017, ARM Ltd. All rights reserved.<BR>
+Portions copyright (c) 2011-2023, Arm Ltd. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -400,8 +400,10 @@ GicV2DxeInitialize (
// the system.
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
+ ASSERT (PcdGet64 (PcdGicDistributorBase) <= MAX_UINTN);
+
mGicInterruptInterfaceBase = PcdGet64 (PcdGicInterruptInterfaceBase);
- mGicDistributorBase = PcdGet64 (PcdGicDistributorBase);
+ mGicDistributorBase = (UINTN)PcdGet64 (PcdGicDistributorBase);
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
for (Index = 0; Index < mGicNumInterrupts; Index++) {