1 /*
2  * Copyright (c) 2021 KT-Elektronik, Klaucke und Partner GmbH
3  * Copyright (c) 2024 Renesas Electronics Corporation
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_ARCH_RX_INCLUDE_KERNEL_ARCH_FUNC_H_
8 #define ZEPHYR_ARCH_RX_INCLUDE_KERNEL_ARCH_FUNC_H_
9 
10 #ifndef _ASMLANGUAGE
11 #include <kernel_arch_data.h>
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
arch_kernel_init(void)17 static ALWAYS_INLINE void arch_kernel_init(void)
18 {
19 	/* check if: further device initialization functions must be called here */
20 }
21 
arch_is_in_isr(void)22 static inline bool arch_is_in_isr(void)
23 {
24 	return arch_curr_cpu()->nested != 0U;
25 }
26 
27 extern void z_rx_arch_switch(void *switch_to, void **switched_from);
28 extern void z_rx_fatal_error(unsigned int reason, const struct arch_esf *esf);
29 
arch_switch(void * switch_to,void ** switched_from)30 static inline void arch_switch(void *switch_to, void **switched_from)
31 {
32 	z_rx_arch_switch(switch_to, switched_from);
33 }
34 
35 #ifdef __cplusplus
36 }
37 #endif
38 
39 #endif /* _ASMLANGUAGE */
40 
41 #endif /* ZEPHYR_ARCH_RX_INCLUDE_KERNEL_ARCH_FUNC_H_ */
42