arch/x86: elevate prep_c.c to common code
Elevate the previously 32-bit-only z_x86_prep_c() function to common code, so both 32-bit and 64-bit arches now enter the kernel this way. Minor changes to prep_c.c to make it build with the SMP scheduler on. Signed-off-by: Charles E. Youse <charles.youse@intel.com>
This commit is contained in:
parent
8d97750eef
commit
8279af76c8
5 changed files with 8 additions and 23 deletions
|
@ -9,6 +9,7 @@ endif ()
|
||||||
|
|
||||||
zephyr_library_sources(cpuhalt.c)
|
zephyr_library_sources(cpuhalt.c)
|
||||||
zephyr_library_sources(memmap.c)
|
zephyr_library_sources(memmap.c)
|
||||||
|
zephyr_library_sources(prep_c.c)
|
||||||
|
|
||||||
zephyr_library_sources_if_kconfig(pcie.c)
|
zephyr_library_sources_if_kconfig(pcie.c)
|
||||||
zephyr_library_sources_if_kconfig(reboot_rst_cnt.c)
|
zephyr_library_sources_if_kconfig(reboot_rst_cnt.c)
|
||||||
|
|
|
@ -18,7 +18,6 @@ zephyr_library_sources(
|
||||||
ia32/swap.S
|
ia32/swap.S
|
||||||
ia32/thread.c
|
ia32/thread.c
|
||||||
ia32/spec_ctrl.c
|
ia32/spec_ctrl.c
|
||||||
ia32/prep_c.c
|
|
||||||
)
|
)
|
||||||
|
|
||||||
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD ia32/irq_offload.c)
|
zephyr_library_sources_ifdef(CONFIG_IRQ_OFFLOAD ia32/irq_offload.c)
|
||||||
|
|
|
@ -108,20 +108,6 @@ __start:
|
||||||
rep stosq
|
rep stosq
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_MULTIBOOT_INFO
|
|
||||||
/* If EBX isn't 0, then we have a valid multiboot info struct. */
|
|
||||||
|
|
||||||
testl %ebx, %ebx
|
|
||||||
jz 1f
|
|
||||||
movl %ebx, %esi
|
|
||||||
|
|
||||||
movl $__MULTIBOOT_INFO_SIZEOF, %ecx
|
|
||||||
movq $multiboot_info, %rdi
|
|
||||||
rep
|
|
||||||
movsb
|
|
||||||
1:
|
|
||||||
#endif /* CONFIG_MULTIBOOT_INFO */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* set up SSE in case something uses the floating-point unit during
|
* set up SSE in case something uses the floating-point unit during
|
||||||
* early initialization (either directly, or if GCC gets clever)
|
* early initialization (either directly, or if GCC gets clever)
|
||||||
|
@ -132,7 +118,8 @@ __start:
|
||||||
|
|
||||||
/* don't replace CALL with JMP; honor the ABI stack alignment! */
|
/* don't replace CALL with JMP; honor the ABI stack alignment! */
|
||||||
|
|
||||||
call z_cstart
|
movl %ebx, %edi /* multiboot pointer (or NULL) */
|
||||||
|
call z_x86_prep_c /* enter kernel; never returns */
|
||||||
|
|
||||||
stop: jmp stop
|
stop: jmp stop
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,4 @@
|
||||||
|
|
||||||
GEN_OFFSET_SYM(_thread_arch_t, flags);
|
GEN_OFFSET_SYM(_thread_arch_t, flags);
|
||||||
|
|
||||||
/* size of struct multiboot_info, used by crt0.S/locore.S */
|
|
||||||
|
|
||||||
GEN_ABSOLUTE_SYM(__MULTIBOOT_INFO_SIZEOF, sizeof(struct multiboot_info));
|
|
||||||
|
|
||||||
GEN_ABS_SYM_END
|
GEN_ABS_SYM_END
|
||||||
|
|
|
@ -8,11 +8,13 @@
|
||||||
#include <arch/x86/acpi.h>
|
#include <arch/x86/acpi.h>
|
||||||
#include <arch/x86/multiboot.h>
|
#include <arch/x86/multiboot.h>
|
||||||
|
|
||||||
|
extern FUNC_NORETURN void z_cstart(void);
|
||||||
|
|
||||||
FUNC_NORETURN void z_x86_prep_c(struct multiboot_info *info)
|
FUNC_NORETURN void z_x86_prep_c(struct multiboot_info *info)
|
||||||
{
|
{
|
||||||
_kernel.nested = 0;
|
_kernel.cpus[0].nested = 0;
|
||||||
_kernel.irq_stack = Z_THREAD_STACK_BUFFER(_interrupt_stack) +
|
_kernel.cpus[0].irq_stack = Z_THREAD_STACK_BUFFER(_interrupt_stack) +
|
||||||
CONFIG_ISR_STACK_SIZE;
|
CONFIG_ISR_STACK_SIZE;
|
||||||
|
|
||||||
#ifdef CONFIG_X86_VERY_EARLY_CONSOLE
|
#ifdef CONFIG_X86_VERY_EARLY_CONSOLE
|
||||||
z_x86_early_serial_init();
|
z_x86_early_serial_init();
|
Loading…
Add table
Add a link
Reference in a new issue