2017-10-03 16:31:55 +02: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-14 19:43:44 +02:00
|
|
|
#ifndef ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_
|
|
|
|
#define ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_
|
2017-10-03 16:31:55 +02:00
|
|
|
|
2019-10-24 17:08:21 +02:00
|
|
|
#include <kernel_arch_data.h>
|
2017-10-03 16:31:55 +02:00
|
|
|
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-11-07 21:43:29 +01:00
|
|
|
static inline void arch_kernel_init(void)
|
2017-10-03 16:31:55 +02:00
|
|
|
{
|
|
|
|
/* Nothing to be done */
|
|
|
|
}
|
|
|
|
|
|
|
|
static ALWAYS_INLINE void
|
2019-11-07 21:43:29 +01:00
|
|
|
arch_thread_return_value_set(struct k_thread *thread, unsigned int value)
|
2017-10-03 16:31:55 +02:00
|
|
|
{
|
|
|
|
thread->callee_saved.retval = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-11-07 21:43:29 +01:00
|
|
|
static inline bool arch_is_in_isr(void)
|
2019-10-03 23:32:22 +02:00
|
|
|
{
|
2020-03-16 18:18:03 +01:00
|
|
|
return _kernel.cpus[0].nested != 0U;
|
2019-10-03 23:32:22 +02:00
|
|
|
}
|
2017-10-03 16:31:55 +02:00
|
|
|
|
|
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
|
2018-09-14 19:43:44 +02:00
|
|
|
#endif /* ZEPHYR_ARCH_POSIX_INCLUDE_KERNEL_ARCH_FUNC_H_ */
|