summaryrefslogtreecommitdiff
path: root/ArmPkg/Drivers/ArmGic/GicV2
diff options
context:
space:
mode:
authorSami Mujawar <sami.mujawar@arm.com>2021-05-26 17:31:53 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-06-01 15:52:01 +0000
commita44fef7de3454cb0cb32a65a5fca16bec0b9416d (patch)
tree347834ab1fad1d5d629cc9a8cd92d45efbff0bd6 /ArmPkg/Drivers/ArmGic/GicV2
parent4ec9a6f6cd2eb236c5dc135aa41a073edfa56901 (diff)
downloadedk2-a44fef7de3454cb0cb32a65a5fca16bec0b9416d.zip
edk2-a44fef7de3454cb0cb32a65a5fca16bec0b9416d.tar.gz
edk2-a44fef7de3454cb0cb32a65a5fca16bec0b9416d.tar.bz2
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 <sami.mujawar@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'ArmPkg/Drivers/ArmGic/GicV2')
-rw-r--r--ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c3
-rw-r--r--ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2NonSecLib.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2Dxe.c
index a93f684..9a0180b 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);
diff --git a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2NonSecLib.c b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2NonSecLib.c
index 85c2a92..781645e 100644
--- a/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2NonSecLib.c
+++ b/ArmPkg/Drivers/ArmGic/GicV2/ArmGicV2NonSecLib.c
@@ -1,6 +1,6 @@
/** @file
*
-* Copyright (c) 2011-2014, ARM Limited. All rights reserved.
+* Copyright (c) 2011-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-2-Clause-Patent
*
@@ -13,7 +13,7 @@
VOID
EFIAPI
ArmGicV2EnableInterruptInterface (
- IN INTN GicInterruptInterfaceBase
+ IN UINTN GicInterruptInterfaceBase
)
{
/*
@@ -26,7 +26,7 @@ ArmGicV2EnableInterruptInterface (
VOID
EFIAPI
ArmGicV2DisableInterruptInterface (
- IN INTN GicInterruptInterfaceBase
+ IN UINTN GicInterruptInterfaceBase
)
{
// Disable Gic Interface