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 : : #ifdef CONFIG_SOC_PER_CORE_INIT_HOOK 26 : : soc_per_core_init_hook(); 27 : : #endif /* CONFIG_SOC_PER_CORE_INIT_HOOK */ 28 : : } 29 : : 30 : : static ALWAYS_INLINE void 31 : 10 : arch_thread_return_value_set(struct k_thread *thread, unsigned int value) 32 : : { 33 : 10 : thread->callee_saved.retval = value; 34 : 10 : } 35 : : 36 : : #ifdef __cplusplus 37 : : } 38 : : #endif 39 : : 40 : 567 : static inline bool arch_is_in_isr(void) 41 : : { 42 : 567 : return _kernel.cpus[0].nested != 0U; 43 : : } 44 : : 45 : : #endif /* _ASMLANGUAGE */ 46 : : 47 : : #endif /* ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_ */