mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-08-17 01:47:00 +02:00
MISRA Violation: MISRA-C:2012 R.14.4 - The controlling expression of an if statement and the controlling expression of an iteration-statement shall have essentially Boolean type. Signed-off-by: Abhyuday Godhasara <abhyuday.godhasara@xilinx.com> Change-Id: I8cf821a42015858200cc0c514600012c8f61061f
22 lines
418 B
C
22 lines
418 B
C
/*
|
|
* Copyright (c) 2018-2021, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <plat_private.h>
|
|
#include <plat/common/platform.h>
|
|
|
|
int plat_core_pos_by_mpidr(u_register_t mpidr)
|
|
{
|
|
if ((mpidr & MPIDR_CLUSTER_MASK) != 0U) {
|
|
return -1;
|
|
}
|
|
|
|
if ((mpidr & MPIDR_CPU_MASK) >= PLATFORM_CORE_COUNT) {
|
|
return -1;
|
|
}
|
|
|
|
return (int)versal_calc_core_pos(mpidr);
|
|
}
|