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>
This commit is contained in:
Sami Mujawar 2021-05-26 17:31:53 +01:00 committed by mergify[bot]
parent 4ec9a6f6cd
commit a44fef7de3
4 changed files with 24 additions and 16 deletions

View File

@ -104,10 +104,17 @@ GicGetCpuRedistributorBase (
return 0; return 0;
} }
/**
Return the GIC CPU Interrupt Interface ID.
@param GicInterruptInterfaceBase Base address of the GIC Interrupt Interface.
@retval CPU Interface Identification information.
**/
UINTN UINTN
EFIAPI EFIAPI
ArmGicGetInterfaceIdentification ( ArmGicGetInterfaceIdentification (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
) )
{ {
// Read the GIC Identification Register // Read the GIC Identification Register
@ -400,7 +407,7 @@ ArmGicDisableDistributor (
VOID VOID
EFIAPI EFIAPI
ArmGicEnableInterruptInterface ( ArmGicEnableInterruptInterface (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
) )
{ {
ARM_GIC_ARCH_REVISION Revision; ARM_GIC_ARCH_REVISION Revision;
@ -418,7 +425,7 @@ ArmGicEnableInterruptInterface (
VOID VOID
EFIAPI EFIAPI
ArmGicDisableInterruptInterface ( ArmGicDisableInterruptInterface (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
) )
{ {
ARM_GIC_ARCH_REVISION Revision; ARM_GIC_ARCH_REVISION Revision;

View File

@ -400,9 +400,10 @@ GicV2DxeInitialize (
// the system. // the system.
ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid); ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gHardwareInterruptProtocolGuid);
ASSERT (PcdGet64 (PcdGicInterruptInterfaceBase) <= MAX_UINTN);
ASSERT (PcdGet64 (PcdGicDistributorBase) <= MAX_UINTN); ASSERT (PcdGet64 (PcdGicDistributorBase) <= MAX_UINTN);
mGicInterruptInterfaceBase = PcdGet64 (PcdGicInterruptInterfaceBase); mGicInterruptInterfaceBase = (UINTN)PcdGet64 (PcdGicInterruptInterfaceBase);
mGicDistributorBase = (UINTN)PcdGet64 (PcdGicDistributorBase); mGicDistributorBase = (UINTN)PcdGet64 (PcdGicDistributorBase);
mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase); mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);

View File

@ -1,6 +1,6 @@
/** @file /** @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 * SPDX-License-Identifier: BSD-2-Clause-Patent
* *
@ -13,7 +13,7 @@
VOID VOID
EFIAPI EFIAPI
ArmGicV2EnableInterruptInterface ( ArmGicV2EnableInterruptInterface (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
) )
{ {
/* /*
@ -26,7 +26,7 @@ ArmGicV2EnableInterruptInterface (
VOID VOID
EFIAPI EFIAPI
ArmGicV2DisableInterruptInterface ( ArmGicV2DisableInterruptInterface (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
) )
{ {
// Disable Gic Interface // Disable Gic Interface

View File

@ -113,7 +113,7 @@
UINTN UINTN
EFIAPI EFIAPI
ArmGicGetInterfaceIdentification ( ArmGicGetInterfaceIdentification (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
); );
// GIC Secure interfaces // GIC Secure interfaces
@ -122,7 +122,7 @@ EFIAPI
ArmGicSetupNonSecure ( ArmGicSetupNonSecure (
IN UINTN MpId, IN UINTN MpId,
IN UINTN GicDistributorBase, IN UINTN GicDistributorBase,
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
); );
VOID VOID
@ -136,13 +136,13 @@ ArmGicSetSecureInterrupts (
VOID VOID
EFIAPI EFIAPI
ArmGicEnableInterruptInterface ( ArmGicEnableInterruptInterface (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
); );
VOID VOID
EFIAPI EFIAPI
ArmGicDisableInterruptInterface ( ArmGicDisableInterruptInterface (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
); );
VOID VOID
@ -203,8 +203,8 @@ ArmGicEndOfInterrupt (
UINTN UINTN
EFIAPI EFIAPI
ArmGicSetPriorityMask ( ArmGicSetPriorityMask (
IN INTN GicInterruptInterfaceBase, IN UINTN GicInterruptInterfaceBase,
IN INTN PriorityMask IN INTN PriorityMask
); );
VOID VOID
@ -252,19 +252,19 @@ EFIAPI
ArmGicV2SetupNonSecure ( ArmGicV2SetupNonSecure (
IN UINTN MpId, IN UINTN MpId,
IN UINTN GicDistributorBase, IN UINTN GicDistributorBase,
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
); );
VOID VOID
EFIAPI EFIAPI
ArmGicV2EnableInterruptInterface ( ArmGicV2EnableInterruptInterface (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
); );
VOID VOID
EFIAPI EFIAPI
ArmGicV2DisableInterruptInterface ( ArmGicV2DisableInterruptInterface (
IN INTN GicInterruptInterfaceBase IN UINTN GicInterruptInterfaceBase
); );
UINTN UINTN