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
|
|
|
|
|
|
|
#include "kernel.h"
|
|
|
|
#include <toolchain/common.h>
|
|
|
|
#include "posix_core.h"
|
|
|
|
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(CONFIG_ARCH_HAS_CUSTOM_SWAP_TO_MAIN)
|
2019-03-09 05:19:05 +08:00
|
|
|
void z_arch_switch_to_main_thread(struct k_thread *main_thread,
|
2017-10-03 22:31:55 +08:00
|
|
|
k_thread_stack_t *main_stack,
|
|
|
|
size_t main_stack_size, k_thread_entry_t _main);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @brief Performs architecture-specific initialization
|
|
|
|
*
|
|
|
|
* This routine performs architecture-specific initialization of the kernel.
|
|
|
|
* Trivial stuff is done inline; more complex initialization is done via
|
|
|
|
* function calls.
|
|
|
|
*
|
|
|
|
* @return N/A
|
|
|
|
*/
|
|
|
|
static inline void kernel_arch_init(void)
|
|
|
|
{
|
|
|
|
/* Nothing to be done */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static ALWAYS_INLINE void
|
2019-09-22 07:25:56 +08:00
|
|
|
z_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-09-22 06:58:15 +08:00
|
|
|
#define z_arch_is_in_isr() (_kernel.nested != 0U)
|
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_ */
|