zephyr/arch/arm64/core/macro_priv.inc

36 lines
551 B
PHP

/*
* Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef _MACRO_PRIV_INC_
#define _MACRO_PRIV_INC_
#include <arch/arm64/tpidrro_el0.h>
#ifdef _ASMLANGUAGE
/*
* Get CPU id
*/
.macro get_cpu_id xreg0
mrs \xreg0, mpidr_el1
/* FIMXME: aff3 not taken into consideration */
ubfx \xreg0, \xreg0, #0, #24
.endm
/*
* Get CPU pointer
*/
.macro get_cpu xreg0
mrs \xreg0, tpidrro_el0
and \xreg0, \xreg0, #TPIDRROEL0_CURR_CPU
.endm
#endif /* _ASMLANGUAGE */
#endif /* _MACRO_PRIV_INC_ */