Zephyr Project API
3.1.0
A Scalable Open Source RTOS
arch_inlines.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2021 Intel Corporation
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
#ifndef ZEPHYR_INCLUDE_ARCH_RISCV_ARCH_INLINES_H_
8
#define ZEPHYR_INCLUDE_ARCH_RISCV_ARCH_INLINES_H_
9
10
#ifndef _ASMLANGUAGE
11
12
#include <
zephyr/kernel_structs.h
>
13
14
static
ALWAYS_INLINE
_cpu_t *
arch_curr_cpu
(
void
)
15
{
16
#ifdef CONFIG_SMP
17
uint32_t
hartid;
18
19
__asm__
volatile
(
"csrr %0, mhartid"
:
"=r"
(hartid));
20
21
return
&_kernel.cpus[hartid];
22
#else
23
return
&_kernel.cpus[0];
24
#endif
/* CONFIG_SMP */
25
}
26
27
#endif
/* !_ASMLANGUAGE */
28
#endif
/* ZEPHYR_INCLUDE_ARCH_RISCV_ARCH_INLINES_H_ */
ALWAYS_INLINE
#define ALWAYS_INLINE
Definition:
common.h:124
kernel_structs.h
arch_curr_cpu
static ALWAYS_INLINE _cpu_t * arch_curr_cpu(void)
Definition:
arch_inlines.h:14
uint32_t
__UINT32_TYPE__ uint32_t
Definition:
stdint.h:90
include
zephyr
arch
riscv
arch_inlines.h
Generated on Fri Oct 14 2022 07:25:57 for Zephyr Project API by
1.9.2