1 /*
2  * Copyright (c) 2020 Antony Pavlov <antonynpavlov@gmail.com>
3  *
4  * based on arch/riscv/include/kernel_arch_func.h
5  *
6  * SPDX-License-Identifier: Apache-2.0
7  */
8 
9 /**
10  * @file
11  * @brief Private kernel definitions
12  *
13  * This file contains private kernel function/macro definitions and various
14  * other definitions for the MIPS processor architecture.
15  */
16 
17 #ifndef ZEPHYR_ARCH_MIPS_INCLUDE_KERNEL_ARCH_FUNC_H_
18 #define ZEPHYR_ARCH_MIPS_INCLUDE_KERNEL_ARCH_FUNC_H_
19 
20 #include <kernel_arch_data.h>
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #ifndef _ASMLANGUAGE
arch_kernel_init(void)27 static ALWAYS_INLINE void arch_kernel_init(void)
28 {
29 }
30 
31 static ALWAYS_INLINE void
arch_thread_return_value_set(struct k_thread * thread,unsigned int value)32 arch_thread_return_value_set(struct k_thread *thread, unsigned int value)
33 {
34 	thread->arch.swap_return_value = value;
35 }
36 
37 FUNC_NORETURN void z_mips_fatal_error(unsigned int reason,
38 				       const struct arch_esf *esf);
39 
arch_is_in_isr(void)40 static inline bool arch_is_in_isr(void)
41 {
42 	return _current_cpu->nested != 0U;
43 }
44 
45 #ifdef CONFIG_IRQ_OFFLOAD
46 void z_irq_do_offload(void);
47 #endif
48 
49 #endif /* _ASMLANGUAGE */
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif /* ZEPHYR_ARCH_MIPS_INCLUDE_KERNEL_ARCH_FUNC_H_ */
56