diff options
-rw-r--r-- | arch/x86/machine/boot.c | 3 | ||||
-rw-r--r-- | arch/x86/machine/boot_asm.S | 11 |
2 files changed, 11 insertions, 3 deletions
diff --git a/arch/x86/machine/boot.c b/arch/x86/machine/boot.c index 31a8c2e..ebf3738 100644 --- a/arch/x86/machine/boot.c +++ b/arch/x86/machine/boot.c @@ -74,7 +74,8 @@ #define INIT_CGACHARS (80 * 25) #define INIT_CGACOLOR 0x7 -char boot_stack[BOOT_STACK_SIZE] __aligned(DATA_ALIGN) __bootdata; +char boot_stack[BOOT_STACK_SIZE] __aligned(DATA_ALIGN) __initdata; + char boot_ap_stack[BOOT_STACK_SIZE] __aligned(DATA_ALIGN) __bootdata; unsigned long boot_ap_id __bootdata; unsigned long boot_ap_stack_addr __bootdata; diff --git a/arch/x86/machine/boot_asm.S b/arch/x86/machine/boot_asm.S index 0d27b6f..0b08353 100644 --- a/arch/x86/machine/boot_asm.S +++ b/arch/x86/machine/boot_asm.S @@ -58,7 +58,7 @@ ASM_ENTRY(_start) ljmp $8, $1f 1: - movl $(boot_stack + BOOT_STACK_SIZE), %esp + movl $(boot_stack - KERNEL_OFFSET + BOOT_STACK_SIZE), %esp movl %esp, %ebp #ifdef __LP64__ @@ -84,13 +84,20 @@ ASM_ENTRY(_start) call boot_setup_paging movl %eax, %cr3 -#ifndef __LP64__ +#ifdef __LP64__ + .code64 + movq $(boot_stack + BOOT_STACK_SIZE), %rsp + movq %rsp, %rbp + .code32 +#else /* __LP64__ */ movl %cr0, %eax orl $CPU_CR0_PG, %eax movl %eax, %cr0 ljmp $8, $1f 1: + movl $(boot_stack + BOOT_STACK_SIZE), %esp + movl %esp, %ebp #endif /* __LP64__ */ call boot_main |