zephyr/arch/x86/include/intel64/kernel_arch_data.h
Daniel Leung 43b2e291db x86_64: fix size to init stack at boot
The boot code of x86_64 initializes the stack (if enabled)
with a hard-coded size for the ISR stack. However,
the stack being used does not have to be the ISR stack,
and can be any defined stacks. So pass in the actual size
of the stack so the stack can be initialized properly.

Fixes #21843

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-09-17 21:05:45 -04:00

42 lines
1.1 KiB
C

/*
* Copyright (c) 2019 Intel Corp.
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_DATA_H_
#define ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_DATA_H_
#include <arch/x86/mmustructs.h>
#ifndef _ASMLANGUAGE
/* linker symbols defining the bounds of the kernel part loaded in locore */
extern char _locore_start[], _locore_end[];
/*
* Per-CPU bootstrapping parameters. See locore.S and cpu.c.
*/
struct x86_cpuboot {
volatile int ready; /* CPU has started */
uint16_t tr; /* selector for task register */
struct x86_tss64 *gs_base; /* Base address for GS segment */
uint64_t sp; /* initial stack pointer */
size_t stack_size; /* size of stack */
arch_cpustart_t fn; /* kernel entry function */
void *arg; /* argument for above function */
};
typedef struct x86_cpuboot x86_cpuboot_t;
extern uint8_t x86_cpu_loapics[]; /* CPU logical ID -> local APIC ID */
#endif /* _ASMLANGUAGE */
#ifdef CONFIG_X86_KPTI
#define Z_X86_TRAMPOLINE_STACK_SIZE 128
#endif
#endif /* ZEPHYR_ARCH_X86_INCLUDE_INTEL64_KERNEL_ARCH_DATA_H_ */