According to edk2 coding standard specification, Non-Boolean comparisons must use a compare operator (==, !=, >, < >=, <=). See Section 5.7.2.1 at https://edk2-docs.gitbook.io/ edk-ii-c-coding-standards-specification/5_source_files/ 57_c_programming Therefore, fix the comparison in ArmGicEnableDistributor() Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
38 lines
981 B
C
38 lines
981 B
C
/** @file
|
|
*
|
|
* Copyright (c) 2011-2023, Arm Limited. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
*
|
|
**/
|
|
|
|
#include <Uefi.h>
|
|
#include <Library/IoLib.h>
|
|
#include <Library/ArmGicLib.h>
|
|
|
|
VOID
|
|
EFIAPI
|
|
ArmGicEnableDistributor (
|
|
IN UINTN GicDistributorBase
|
|
)
|
|
{
|
|
ARM_GIC_ARCH_REVISION Revision;
|
|
UINT32 GicDistributorCtl;
|
|
|
|
/*
|
|
* Enable GIC distributor in Non-Secure world.
|
|
* Note: The ICDDCR register is banked when Security extensions are implemented
|
|
*/
|
|
Revision = ArmGicGetSupportedArchRevision ();
|
|
if (Revision == ARM_GIC_ARCH_REVISION_2) {
|
|
MmioWrite32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
|
} else {
|
|
GicDistributorCtl = MmioRead32 (GicDistributorBase + ARM_GIC_ICDDCR);
|
|
if ((GicDistributorCtl & ARM_GIC_ICDDCR_ARE) != 0) {
|
|
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x2);
|
|
} else {
|
|
MmioOr32 (GicDistributorBase + ARM_GIC_ICDDCR, 0x1);
|
|
}
|
|
}
|
|
}
|