Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
arch_inlines.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 IoT.bzh
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_ARCH_ARM_ARCH_INLINES_H
8#define ZEPHYR_INCLUDE_ARCH_ARM_ARCH_INLINES_H
9
11#if defined(CONFIG_CPU_AARCH32_CORTEX_R) || defined(CONFIG_CPU_AARCH32_CORTEX_A)
14
15static ALWAYS_INLINE _cpu_t *arch_curr_cpu(void)
16{
17 return (_cpu_t *)(read_tpidruro() & TPIDRURO_CURR_CPU);
18}
19#else
20
21#ifndef CONFIG_SMP
22static ALWAYS_INLINE _cpu_t *arch_curr_cpu(void)
23{
24 /* Dummy implementation always return the first cpu */
25 return &_kernel.cpus[0];
26}
27#endif
28#endif
29
31{
32 /*
33 * Placeholder implementation to be replaced with an architecture
34 * specific call to get processor ID
35 */
36 return arch_curr_cpu()->id;
37}
38
39static ALWAYS_INLINE unsigned int arch_num_cpus(void)
40{
41 return CONFIG_MP_MAX_NUM_CPUS;
42}
43
44#endif /* ZEPHYR_INCLUDE_ARCH_ARM_ARCH_INLINES_H */
static ALWAYS_INLINE _cpu_t * arch_curr_cpu(void)
Definition: arch_inlines.h:17
static ALWAYS_INLINE uint32_t arch_proc_id(void)
Definition: arch_inlines.h:30
static ALWAYS_INLINE unsigned int arch_num_cpus(void)
Definition: arch_inlines.h:39
#define ALWAYS_INLINE
Definition: common.h:129
static ALWAYS_INLINE uint32_t read_tpidruro(void)
Definition: lib_helpers.h:75
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
tpidruro bits allocation
#define TPIDRURO_CURR_CPU
Definition: tpidruro.h:18