From 334382f9ef1f0564598cd2f96ad22d1a7f8b4c1c Mon Sep 17 00:00:00 2001 From: Tw Date: Mon, 11 Mar 2019 09:15:59 +0800 Subject: [PATCH] efi-stub: minor change for uefi refactor Include these changes: - substitute efi_context with uefi_context - remove EFI_STUB from Kconfig - remove EFI_ Signed-off-by: Tw --- efi-stub/Makefile | 4 ++-- efi-stub/boot.c | 9 +++++---- efi-stub/boot.h | 4 ++-- hypervisor/arch/x86/Kconfig | 10 ---------- 4 files changed, 9 insertions(+), 18 deletions(-) diff --git a/efi-stub/Makefile b/efi-stub/Makefile index 5b87d49b3..3a4fc9179 100644 --- a/efi-stub/Makefile +++ b/efi-stub/Makefile @@ -60,9 +60,9 @@ LDSCRIPT := $(GNUEFI_DIR)/elf_$(ARCH)_efi.lds INCDIR := $(SYSROOT)/usr/include CFLAGS=-I. -I.. -I../hypervisor/include/arch/x86/guest -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \ - -I../hypervisor/include/public -I../hypervisor/include/lib -I../hypervisor/bsp/include/uefi \ + -I../hypervisor/include/public -I../hypervisor/include/lib -I../hypervisor/bsp/include/ \ -DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \ - -Wall -I../fs/ -D$(ARCH) -O2 \ + -Wall -I../fs/ -D$(ARCH) -O2 -I../hypervisor/include/arch/x86 \ -include config.h CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387 diff --git a/efi-stub/boot.c b/efi-stub/boot.c index 0977bb613..cc8200fa9 100644 --- a/efi-stub/boot.c +++ b/efi-stub/boot.c @@ -37,7 +37,7 @@ #include "stdlib.h" #include "boot.h" #include "acrn_common.h" -#include "uefi.h" +#include "firmware_uefi.h" #include "MpService.h" EFI_SYSTEM_TABLE *sys_table; @@ -88,7 +88,7 @@ enable_disable_all_ap(BOOLEAN enable) } static inline void hv_jump(EFI_PHYSICAL_ADDRESS hv_start, - struct multiboot_info *mbi, struct efi_context *efi_ctx) + struct multiboot_info *mbi, struct uefi_context *efi_ctx) { hv_func hf; @@ -243,7 +243,7 @@ switch_to_guest_mode(EFI_HANDLE image, EFI_PHYSICAL_ADDRESS hv_hpa) EFI_STATUS err; struct multiboot_mmap *mmap; struct multiboot_info *mbi; - struct efi_context *efi_ctx; + struct uefi_context *efi_ctx; struct acpi_table_rsdp *rsdp = NULL; int32_t i; EFI_CONFIGURATION_TABLE *config_table; @@ -336,6 +336,7 @@ static inline EFI_STATUS isspace(CHAR8 ch) return ((uint8_t)ch <= ' '); } +#define DEFAULT_UEFI_OS_LOADER_NAME "\\EFI\\org.clearlinux\\bootloaderx64.efi" /** * efi_main - The entry point for the OS loader image. * @image: firmware-allocated handle that identifies the image @@ -401,7 +402,7 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *_table) * bootloader name to be used. Fall back to the default bootloader * as specified in config.h */ - bootloader_name = ch8_2_ch16(CONFIG_UEFI_OS_LOADER_NAME); + bootloader_name = ch8_2_ch16(DEFAULT_UEFI_OS_LOADER_NAME); } section = ".hv"; diff --git a/efi-stub/boot.h b/efi-stub/boot.h index 1bd332ff6..32c131435 100644 --- a/efi-stub/boot.h +++ b/efi-stub/boot.h @@ -76,7 +76,7 @@ typedef void(*hv_func)(int32_t, struct multiboot_info*); #define MBOOT_MMAP_NUMS 256 #define MBOOT_MMAP_SIZE (sizeof(struct multiboot_mmap) * MBOOT_MMAP_NUMS) #define MBOOT_INFO_SIZE (sizeof(struct multiboot_info)) -#define BOOT_CTX_SIZE (sizeof(struct efi_context)) +#define BOOT_CTX_SIZE (sizeof(struct uefi_context)) #define EFI_BOOT_MEM_SIZE \ (MBOOT_MMAP_SIZE + MBOOT_INFO_SIZE + BOOT_CTX_SIZE) #define MBOOT_MMAP_PTR(addr) \ @@ -84,7 +84,7 @@ typedef void(*hv_func)(int32_t, struct multiboot_info*); #define MBOOT_INFO_PTR(addr) \ ((struct multiboot_info *)((VOID *)(addr) + MBOOT_MMAP_SIZE)) #define BOOT_CTX_PTR(addr) \ - ((struct efi_context *)((VOID *)(addr) + MBOOT_MMAP_SIZE + MBOOT_INFO_SIZE)) + ((struct uefi_context *)((VOID *)(addr) + MBOOT_MMAP_SIZE + MBOOT_INFO_SIZE)) struct efi_info { diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index 3b3126988..976252c4e 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -301,16 +301,6 @@ config GPU_SBDF 00:02.0 in DRHD segment 0, this SBDF would be (0 << 16) | (0 << 8) | (2 << 3) | (0 << 0), i.e. 0x00000010. -config EFI_STUB - bool "Enable EFI stub" - depends on PLATFORM_UEFI - default y - -config UEFI_OS_LOADER_NAME - string "UEFI OS loader name" - depends on PLATFORM_UEFI - default "\\EFI\\org.clearlinux\\bootloaderx64.efi" - config MTRR_ENABLED bool "Memory Type Range Registers (MTRR) enabled" default y