zephyr/arch/x86/include/intel64/kernel_arch_func.h
Charles E. Youse 8d97750eef arch/x86: (Intel64) add z_arch_curr_cpu() to enable CONFIG_SMP=y
And set qemu_x86_long board to build with CONFIG_SMP=y by default.
Apparently two benchmark tests - latency_measure and sys_kernel -
do not work with the SMP scheduler, so those tests are disabled.

Signed-off-by: Charles E. Youse <charles.youse@intel.com>
2019-10-07 19:46:55 -04:00

32 lines
640 B
C

/*
* Copyright (c) 2019 Intel Corporation
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_
#define ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_
#ifndef _ASMLANGUAGE
extern void z_arch_switch(void *switch_to, void **switched_from);
static inline void z_arch_kernel_init(void)
{
/* nothing */;
}
static inline struct _cpu *z_arch_curr_cpu(void)
{
struct _cpu *cpu;
__asm__ volatile("movq %%gs:(%c1), %0"
: "=r" (cpu)
: "i" (offsetof(x86_tss64_t, cpu)));
return cpu;
}
#endif /* _ASMLANGUAGE */
#endif /* ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_ */