Skip to content

Commit 7f715bd

Browse files
Andrew Boienashif
authored andcommitted
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 <[email protected]>
1 parent b12a094 commit 7f715bd

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

arch/x86/core/intel64/locore.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ x86_sse_init:
183183
mxcsr: .long X86_MXCSR_SANE
184184

185185
/*
186-
* void z_arch_switch(void *switch_to, void **switched_from);
186+
* void z_x86_switch(void *switch_to, void **switched_from);
187187
*
188188
* Note that switch_handle for us is simply a pointer to the containing
189189
* 'struct k_thread', thus:
@@ -192,8 +192,8 @@ mxcsr: .long X86_MXCSR_SANE
192192
* RSI = (struct k_thread **) switched_from
193193
*/
194194

195-
.globl z_arch_switch
196-
z_arch_switch:
195+
.globl z_x86_switch
196+
z_x86_switch:
197197
movq (%rsi), %rsi
198198

199199
andb $~X86_THREAD_FLAG_ALL, _thread_offset_to_flags(%rsi)

arch/x86/include/intel64/kernel_arch_func.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@
66
#ifndef ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_
77
#define ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_FUNC_H_
88

9+
#include <kernel_structs.h>
10+
911
#ifndef _ASMLANGUAGE
1012

11-
extern void z_arch_switch(void *switch_to, void **switched_from);
13+
extern void z_x86_switch(void *switch_to, void **switched_from);
14+
15+
static inline void z_arch_switch(void *switch_to, void **switched_from)
16+
{
17+
z_x86_switch(switch_to, switched_from);
18+
}
1219

1320
/**
1421
* @brief Initialize scheduler IPI vector.

0 commit comments

Comments
 (0)