Branch data Line data Source code
1 : : /*
2 : : * Copyright (c) 2016 Wind River Systems, Inc.
3 : : * Copyright (c) 2017 Oticon A/S
4 : : *
5 : : * SPDX-License-Identifier: Apache-2.0
6 : : */
7 : :
8 : : /* This file is only meant to be included by kernel_structs.h */
9 : :
10 : : #ifndef ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_
11 : : #define ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_
12 : :
13 : : #include <kernel_arch_data.h>
14 : :
15 : : #include <zephyr/platform/hooks.h>
16 : :
17 : : #ifndef _ASMLANGUAGE
18 : :
19 : : #ifdef __cplusplus
20 : : extern "C" {
21 : : #endif
22 : :
23 : : static inline void arch_kernel_init(void)
24 : : {
25 : : soc_per_core_init_hook();
26 : : }
27 : :
28 : : static ALWAYS_INLINE void
29 : 10 : arch_thread_return_value_set(struct k_thread *thread, unsigned int value)
30 : : {
31 : 10 : thread->callee_saved.retval = value;
32 : 10 : }
33 : :
34 : : #ifdef __cplusplus
35 : : }
36 : : #endif
37 : :
38 : 710 : static inline bool arch_is_in_isr(void)
39 : : {
40 : 710 : return _kernel.cpus[0].nested != 0U;
41 : : }
42 : :
43 : : int arch_swap(unsigned int key);
44 : :
45 : : #endif /* _ASMLANGUAGE */
46 : :
47 : : #endif /* ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_ */
|