From 7f715bd113889d144f736f36617e021280349ba8 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Thu, 3 Oct 2019 15:17:30 -0700 Subject: [PATCH] intel64: add inline definition of z_arch_switch() This just calls the assembly code. Needed to be inline per the architecture API. Signed-off-by: Andrew Boie --- arch/x86/core/intel64/locore.S | 6 +++--- arch/x86/include/intel64/kernel_arch_func.h | 9 ++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/arch/x86/core/intel64/locore.S b/arch/x86/core/intel64/locore.S index 874bcb3f347..8dd4b558961 100644 --- a/arch/x86/core/intel64/locore.S +++ b/arch/x86/core/intel64/locore.S @@ -183,7 +183,7 @@ x86_sse_init: mxcsr: .long X86_MXCSR_SANE /* - * void z_arch_switch(void *switch_to, void **switched_from); + * void z_x86_switch(void *switch_to, void **switched_from); * * Note that switch_handle for us is simply a pointer to the containing * 'struct k_thread', thus: @@ -192,8 +192,8 @@ mxcsr: .long X86_MXCSR_SANE * RSI = (struct k_thread **) switched_from */ -.globl z_arch_switch -z_arch_switch: +.globl z_x86_switch +z_x86_switch: movq (%rsi), %rsi andb $~X86_THREAD_FLAG_ALL, _thread_offset_to_flags(%rsi) diff --git a/arch/x86/include/intel64/kernel_arch_func.h b/arch/x86/include/intel64/kernel_arch_func.h index 9463774af99..29f9a5f5d69 100644 --- a/arch/x86/include/intel64/kernel_arch_func.h +++ b/arch/x86/include/intel64/kernel_arch_func.h @@ -6,9 +6,16 @@ #ifndef ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_ #define ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_ +#include + #ifndef _ASMLANGUAGE -extern void z_arch_switch(void *switch_to, void **switched_from); +extern void z_x86_switch(void *switch_to, void **switched_from); + +static inline void z_arch_switch(void *switch_to, void **switched_from) +{ + z_x86_switch(switch_to, switched_from); +} /** * @brief Initialize scheduler IPI vector.