Skip to content

Commit 334382f

Browse files
tw4452852wenlingz
authored andcommitted
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 <wei.tan@intel.com>
1 parent 9b24620 commit 334382f

File tree

4 files changed

+9
-18
lines changed

4 files changed

+9
-18
lines changed

efi-stub/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ LDSCRIPT := $(GNUEFI_DIR)/elf_$(ARCH)_efi.lds
6060
INCDIR := $(SYSROOT)/usr/include
6161

6262
CFLAGS=-I. -I.. -I../hypervisor/include/arch/x86/guest -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \
63-
-I../hypervisor/include/public -I../hypervisor/include/lib -I../hypervisor/bsp/include/uefi \
63+
-I../hypervisor/include/public -I../hypervisor/include/lib -I../hypervisor/bsp/include/ \
6464
-DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \
65-
-Wall -I../fs/ -D$(ARCH) -O2 \
65+
-Wall -I../fs/ -D$(ARCH) -O2 -I../hypervisor/include/arch/x86 \
6666
-include config.h
6767

6868
CFLAGS += -mno-mmx -mno-sse -mno-sse2 -mno-80387 -mno-fp-ret-in-387

efi-stub/boot.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#include "stdlib.h"
3838
#include "boot.h"
3939
#include "acrn_common.h"
40-
#include "uefi.h"
40+
#include "firmware_uefi.h"
4141
#include "MpService.h"
4242

4343
EFI_SYSTEM_TABLE *sys_table;
@@ -88,7 +88,7 @@ enable_disable_all_ap(BOOLEAN enable)
8888
}
8989

9090
static inline void hv_jump(EFI_PHYSICAL_ADDRESS hv_start,
91-
struct multiboot_info *mbi, struct efi_context *efi_ctx)
91+
struct multiboot_info *mbi, struct uefi_context *efi_ctx)
9292
{
9393
hv_func hf;
9494

@@ -243,7 +243,7 @@ switch_to_guest_mode(EFI_HANDLE image, EFI_PHYSICAL_ADDRESS hv_hpa)
243243
EFI_STATUS err;
244244
struct multiboot_mmap *mmap;
245245
struct multiboot_info *mbi;
246-
struct efi_context *efi_ctx;
246+
struct uefi_context *efi_ctx;
247247
struct acpi_table_rsdp *rsdp = NULL;
248248
int32_t i;
249249
EFI_CONFIGURATION_TABLE *config_table;
@@ -336,6 +336,7 @@ static inline EFI_STATUS isspace(CHAR8 ch)
336336
return ((uint8_t)ch <= ' ');
337337
}
338338

339+
#define DEFAULT_UEFI_OS_LOADER_NAME "\\EFI\\org.clearlinux\\bootloaderx64.efi"
339340
/**
340341
* efi_main - The entry point for the OS loader image.
341342
* @image: firmware-allocated handle that identifies the image
@@ -401,7 +402,7 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *_table)
401402
* bootloader name to be used. Fall back to the default bootloader
402403
* as specified in config.h
403404
*/
404-
bootloader_name = ch8_2_ch16(CONFIG_UEFI_OS_LOADER_NAME);
405+
bootloader_name = ch8_2_ch16(DEFAULT_UEFI_OS_LOADER_NAME);
405406
}
406407

407408
section = ".hv";

efi-stub/boot.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ typedef void(*hv_func)(int32_t, struct multiboot_info*);
7676
#define MBOOT_MMAP_NUMS 256
7777
#define MBOOT_MMAP_SIZE (sizeof(struct multiboot_mmap) * MBOOT_MMAP_NUMS)
7878
#define MBOOT_INFO_SIZE (sizeof(struct multiboot_info))
79-
#define BOOT_CTX_SIZE (sizeof(struct efi_context))
79+
#define BOOT_CTX_SIZE (sizeof(struct uefi_context))
8080
#define EFI_BOOT_MEM_SIZE \
8181
(MBOOT_MMAP_SIZE + MBOOT_INFO_SIZE + BOOT_CTX_SIZE)
8282
#define MBOOT_MMAP_PTR(addr) \
8383
((struct multiboot_mmap *)((VOID *)(addr)))
8484
#define MBOOT_INFO_PTR(addr) \
8585
((struct multiboot_info *)((VOID *)(addr) + MBOOT_MMAP_SIZE))
8686
#define BOOT_CTX_PTR(addr) \
87-
((struct efi_context *)((VOID *)(addr) + MBOOT_MMAP_SIZE + MBOOT_INFO_SIZE))
87+
((struct uefi_context *)((VOID *)(addr) + MBOOT_MMAP_SIZE + MBOOT_INFO_SIZE))
8888

8989

9090
struct efi_info {

hypervisor/arch/x86/Kconfig

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -301,16 +301,6 @@ config GPU_SBDF
301301
00:02.0 in DRHD segment 0, this SBDF would be (0 << 16) | (0 << 8) |
302302
(2 << 3) | (0 << 0), i.e. 0x00000010.
303303

304-
config EFI_STUB
305-
bool "Enable EFI stub"
306-
depends on PLATFORM_UEFI
307-
default y
308-
309-
config UEFI_OS_LOADER_NAME
310-
string "UEFI OS loader name"
311-
depends on PLATFORM_UEFI
312-
default "\\EFI\\org.clearlinux\\bootloaderx64.efi"
313-
314304
config MTRR_ENABLED
315305
bool "Memory Type Range Registers (MTRR) enabled"
316306
default y

0 commit comments

Comments
 (0)