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

@@ -6,6 +6,7 @@
#include <hypervisor.h>
#include <multiboot.h>
#include <boot_context.h>
#include <vm0_boot.h>
#ifdef CONFIG_EFI_STUB
@@ -36,7 +37,7 @@ int uefi_sw_loader(struct acrn_vm *vm)
{
int ret = 0;
struct acrn_vcpu *vcpu = get_primary_vcpu(vm);
struct acrn_vcpu_regs *vcpu_regs = &vm0_boot_context;
struct acrn_vcpu_regs *vcpu_regs = &boot_context;
ASSERT(vm != NULL, "Incorrect argument");
@@ -47,8 +48,8 @@ int uefi_sw_loader(struct acrn_vm *vm)
/* For UEFI platform, the bsp init regs come from two places:
* 1. saved in efi_boot: gpregs, rip
* 2. saved when HV started: other registers
* We copy the info saved in efi_boot to vm0_boot_context and
* init bsp with vm0_boot_context.
* We copy the info saved in efi_boot to boot_context and
* init bsp with boot_context.
*/
memcpy_s(&(vcpu_regs->gprs), sizeof(struct acrn_gp_regs),
&(efi_ctx->vcpu_regs.gprs), sizeof(struct acrn_gp_regs));