mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 17:44:19 +00:00

To make software license auditing simpler, use SPDX[0] license identifiers instead of duplicating the license text in every file. NOTE: Files that have been imported by FreeBSD have not been modified. [0]: https://spdx.org/ Change-Id: I80a00e1f641b8cc075ca5a95b10607ed9ed8761a Signed-off-by: dp-arm <dimitris.papastamos@arm.com>
47 lines
1.2 KiB
ArmAsm
47 lines
1.2 KiB
ArmAsm
/*
|
|
* Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <arch.h>
|
|
#include <asm_macros.S>
|
|
#include <assert_macros.S>
|
|
#include <platform_def.h>
|
|
|
|
.globl plat_my_core_pos
|
|
.globl plat_is_my_cpu_primary
|
|
.globl plat_get_my_entrypoint
|
|
.weak platform_get_core_pos
|
|
|
|
/* -----------------------------------------------------
|
|
* Compatibility wrappers for new platform APIs.
|
|
* -----------------------------------------------------
|
|
*/
|
|
func plat_my_core_pos
|
|
mrs x0, mpidr_el1
|
|
b platform_get_core_pos
|
|
endfunc plat_my_core_pos
|
|
|
|
func plat_is_my_cpu_primary
|
|
mrs x0, mpidr_el1
|
|
b platform_is_primary_cpu
|
|
endfunc plat_is_my_cpu_primary
|
|
|
|
func plat_get_my_entrypoint
|
|
mrs x0, mpidr_el1
|
|
b platform_get_entrypoint
|
|
endfunc plat_get_my_entrypoint
|
|
|
|
/* -----------------------------------------------------
|
|
* int platform_get_core_pos(int mpidr);
|
|
* With this function: CorePos = (ClusterId * 4) +
|
|
* CoreId
|
|
* -----------------------------------------------------
|
|
*/
|
|
func platform_get_core_pos
|
|
and x1, x0, #MPIDR_CPU_MASK
|
|
and x0, x0, #MPIDR_CLUSTER_MASK
|
|
add x0, x1, x0, LSR #6
|
|
ret
|
|
endfunc platform_get_core_pos
|