2019-06-29 15:18:41 -07:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 Wind River Systems, Inc.
|
|
|
|
* Copyright (c) 2018 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* this file is only meant to be included by kernel_structs.h */
|
|
|
|
|
|
|
|
#ifndef ZEPHYR_ARCH_X86_INCLUDE_IA32_KERNEL_ARCH_FUNC_H_
|
|
|
|
#define ZEPHYR_ARCH_X86_INCLUDE_IA32_KERNEL_ARCH_FUNC_H_
|
|
|
|
|
|
|
|
#ifndef _ASMLANGUAGE
|
|
|
|
|
2019-08-12 15:54:24 -05:00
|
|
|
#include <stddef.h> /* For size_t */
|
|
|
|
|
2019-06-29 15:18:41 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2019-11-07 12:43:29 -08:00
|
|
|
static inline void arch_kernel_init(void)
|
2019-06-29 15:18:41 -07:00
|
|
|
{
|
2019-08-05 16:17:48 -07:00
|
|
|
/* No-op on this arch */
|
2019-06-29 15:18:41 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static ALWAYS_INLINE void
|
2019-11-07 12:43:29 -08:00
|
|
|
arch_thread_return_value_set(struct k_thread *thread, unsigned int value)
|
2019-06-29 15:18:41 -07:00
|
|
|
{
|
|
|
|
/* write into 'eax' slot created in z_swap() entry */
|
|
|
|
|
|
|
|
*(unsigned int *)(thread->callee_saved.esp) = value;
|
|
|
|
}
|
|
|
|
|
2019-11-07 12:43:29 -08:00
|
|
|
extern void arch_cpu_atomic_idle(unsigned int key);
|
2019-06-29 15:18:41 -07:00
|
|
|
|
2019-07-29 18:22:30 -07:00
|
|
|
#ifdef CONFIG_USERSPACE
|
2019-06-29 15:18:41 -07:00
|
|
|
extern FUNC_NORETURN void z_x86_userspace_enter(k_thread_entry_t user_entry,
|
|
|
|
void *p1, void *p2, void *p3,
|
|
|
|
u32_t stack_end,
|
|
|
|
u32_t stack_start);
|
|
|
|
|
2019-07-29 18:22:30 -07:00
|
|
|
void z_x86_thread_pt_init(struct k_thread *thread);
|
2019-07-25 18:18:03 -07:00
|
|
|
|
2019-10-01 13:42:35 -07:00
|
|
|
void z_x86_apply_mem_domain(struct x86_page_tables *ptables,
|
2019-07-29 18:22:30 -07:00
|
|
|
struct k_mem_domain *mem_domain);
|
2019-07-25 18:18:03 -07:00
|
|
|
|
2019-07-29 18:22:30 -07:00
|
|
|
#endif /* CONFIG_USERSPACE */
|
2019-07-31 14:21:14 -07:00
|
|
|
|
|
|
|
/* ASM code to fiddle with registers to enable the MMU with PAE paging */
|
|
|
|
void z_x86_enable_paging(void);
|
|
|
|
|
2019-06-29 15:18:41 -07:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _ASMLANGUAGE */
|
|
|
|
|
|
|
|
#endif /* ZEPHYR_ARCH_X86_INCLUDE_IA32_KERNEL_ARCH_FUNC_H_ */
|