2017-10-03 22:31:55 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Wind River Systems, Inc.
|
|
|
|
* Copyright (c) 2017 Oticon A/S
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* This file is only meant to be included by kernel_structs.h */
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#ifndef ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_
|
|
|
|
#define ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_
|
2017-10-03 22:31:55 +08:00
|
|
|
|
2019-10-24 23:08:21 +08:00
|
|
|
#include <kernel_arch_data.h>
|
2017-10-03 22:31:55 +08:00
|
|
|
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-11-08 04:43:29 +08:00
|
|
|
static inline void arch_kernel_init(void)
|
2017-10-03 22:31:55 +08:00
|
|
|
{
|
|
|
|
/* Nothing to be done */
|
|
|
|
}
|
|
|
|
|
|
|
|
static ALWAYS_INLINE void
|
2019-11-08 04:43:29 +08:00
|
|
|
arch_thread_return_value_set(struct k_thread *thread, unsigned int value)
|
2017-10-03 22:31:55 +08:00
|
|
|
{
|
|
|
|
thread->callee_saved.retval = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-11-08 04:43:29 +08:00
|
|
|
static inline bool arch_is_in_isr(void)
|
2019-10-04 05:32:22 +08:00
|
|
|
{
|
2020-03-17 01:18:03 +08:00
|
|
|
return _kernel.cpus[0].nested != 0U;
|
2019-10-04 05:32:22 +08:00
|
|
|
}
|
2017-10-03 22:31:55 +08:00
|
|
|
|
|
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
|
2018-09-15 01:43:44 +08:00
|
|
|
#endif /* ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_ */
|