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 <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2019-10-03 15:17:30 -07:00 committed by Anas Nashif
commit 7f715bd113
2 changed files with 11 additions and 4 deletions

View file

@ -183,7 +183,7 @@ x86_sse_init:
mxcsr: .long X86_MXCSR_SANE 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 * Note that switch_handle for us is simply a pointer to the containing
* 'struct k_thread', thus: * 'struct k_thread', thus:
@ -192,8 +192,8 @@ mxcsr: .long X86_MXCSR_SANE
* RSI = (struct k_thread **) switched_from * RSI = (struct k_thread **) switched_from
*/ */
.globl z_arch_switch .globl z_x86_switch
z_arch_switch: z_x86_switch:
movq (%rsi), %rsi movq (%rsi), %rsi
andb $~X86_THREAD_FLAG_ALL, _thread_offset_to_flags(%rsi) andb $~X86_THREAD_FLAG_ALL, _thread_offset_to_flags(%rsi)

View file

@ -6,9 +6,16 @@
#ifndef ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_ #ifndef ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_
#define ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_ #define ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_
#include <kernel_structs.h>
#ifndef _ASMLANGUAGE #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. * @brief Initialize scheduler IPI vector.