modularization: boot component

Boot component prepares the very basic platform boot env. It finally call
into platform initilization entries:

- bsp_boot_init & cpu_secondary_init for start up
- or restore_s3_context for wakeup

this patch is the final one, it did some code clean up and move some definition
from vm0_boot.h to boot_context.h.

after this patch, the boot component include files:
arch/x86/boot/cpu_primary.S
arch/x86/boot/trampoline.S
arch/x86/boot/cpu_save_boot_ctx.S
arch/x86/boot/idt.S
boot/reloc.c
boot/include/reloc.h
include/arch/x86/boot/idt.h
include/arch/x86/boot/boot_context.h

Tracked-On: #1842
Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Jason Chen CJ
2018-11-30 20:20:06 +08:00
committed by wenlingz
parent b54f23316a
commit aa9af27338
10 changed files with 68 additions and 66 deletions

View File

@@ -4,11 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <cpu.h>
#include <mmu.h>
#include <gdt.h>
#include <idt.h>
#include <msr.h>
/* NOTE:
*

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <vm0_boot.h>
#include <boot_context.h>
.section entry, "ax"
.align 8
@@ -13,7 +13,7 @@
.global cpu_primary_save_32
cpu_primary_save_32:
/* save context from 32bit mode */
lea vm0_boot_context, %eax
lea boot_context, %eax
sgdt BOOT_CTX_GDT_OFFSET(%eax)
sidt BOOT_CTX_IDT_OFFSET(%eax)
str BOOT_CTX_TR_SEL_OFFSET(%eax)
@@ -50,7 +50,7 @@ cpu_primary_save_32:
.global cpu_primary_save_64
cpu_primary_save_64:
/* save context from 64bit mode */
lea vm0_boot_context(%rip), %r8
lea boot_context(%rip), %r8
sgdt BOOT_CTX_GDT_OFFSET(%r8)
sidt BOOT_CTX_IDT_OFFSET(%r8)
str BOOT_CTX_TR_SEL_OFFSET(%r8)
@@ -90,8 +90,8 @@ cpu_primary_save_64:
.text
.align 8
.global vm0_boot_context
vm0_boot_context:
.global boot_context
boot_context:
.rept SIZE_OF_BOOT_CTX
.byte 0x00
.endr

View File

@@ -4,7 +4,6 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <gdt.h>
#include <idt.h>
.altmacro

View File

@@ -15,10 +15,6 @@
*/
#include <spinlock.h>
#include <gdt.h>
#include <cpu.h>
#include <mmu.h>
#include <msr.h>
/* NOTE:
*
@@ -38,8 +34,6 @@
*/
.extern cpu_secondary_init
.extern ld_bss_end
.extern HOST_GDTR
.section .trampoline_reset,"ax"

View File

@@ -4,7 +4,7 @@
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <hypervisor.h>
#include <vm0_boot.h>
#include <boot_context.h>
#define CAT__(A,B) A ## B
#define CAT_(A,B) CAT__(A,B)