Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
arch_inlines.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_ARCH_ARM64_ARCH_INLINES_H
8#define ZEPHYR_INCLUDE_ARCH_ARM64_ARCH_INLINES_H
9
10#ifndef _ASMLANGUAGE
11
12#include <kernel_structs.h>
15
16static ALWAYS_INLINE _cpu_t *arch_curr_cpu(void)
17{
18 return (_cpu_t *)(read_tpidrro_el0() & TPIDRROEL0_CURR_CPU);
19}
20
22{
24}
25
26#endif /* !_ASMLANGUAGE */
27#endif /* ZEPHYR_INCLUDE_ARCH_ARM64_ARCH_INLINES_H */
static ALWAYS_INLINE int arch_exception_depth(void)
Definition: arch_inlines.h:21
static ALWAYS_INLINE _cpu_t * arch_curr_cpu(void)
Definition: arch_inlines.h:16
#define ALWAYS_INLINE
Definition: common.h:116
static ALWAYS_INLINE uint64_t read_tpidrro_el0(void)
Definition: lib_helpers.h:69
tpidrro_el0 bits allocation
#define TPIDRROEL0_EXC_UNIT
Definition: tpidrro_el0.h:25
#define TPIDRROEL0_CURR_CPU
Definition: tpidrro_el0.h:22
#define TPIDRROEL0_EXC_DEPTH
Definition: tpidrro_el0.h:24