Skip to content

Commit 4fd870f

Browse files
binbinwu1lijinxia
authored andcommitted
hv: efi: remove multiple defined struct efi_ctx & dt_addr_t
In current code, struct efi_ctx and dt_addr_t are defined in two places. This patch removes one copy of the definitions. Signed-off-by: Binbin Wu <binbin.wu@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com> Acked-by: Jack Ren <jack.ren@intel.com>
1 parent d5be735 commit 4fd870f

File tree

3 files changed

+2
-45
lines changed

3 files changed

+2
-45
lines changed

hypervisor/bsp/uefi/efi/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ LDSCRIPT := $(GNUEFI_DIR)/elf_$(ARCH)_efi.lds
6060

6161
INCDIR := /usr/include
6262

63-
CFLAGS=-I. -I.. -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \
63+
CFLAGS=-I. -I.. -I../../../include/common -I$(INCDIR)/efi -I$(INCDIR)/efi/$(ARCH) \
6464
-DEFI_FUNCTION_WRAPPER -fPIC -fshort-wchar -ffreestanding \
6565
-Wall -I../fs/ -D$(ARCH) -O2 \
6666
-include config.h

hypervisor/bsp/uefi/efi/boot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include "efilinux.h"
3737
#include "stdlib.h"
3838
#include "boot.h"
39+
#include "acrn_efi.h"
3940

4041
EFI_SYSTEM_TABLE *sys_table;
4142
EFI_BOOT_SERVICES *boot;

hypervisor/bsp/uefi/efi/boot.h

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -80,56 +80,12 @@ struct efi_info {
8080
UINT32 efi_memmap_hi;
8181
};
8282

83-
typedef struct {
84-
UINT16 limit;
85-
UINT64 *base;
86-
} __attribute__((packed)) dt_addr_t;
87-
8883
struct e820_entry {
8984
UINT64 addr; /* start of memory segment */
9085
UINT64 size; /* size of memory segment */
9186
UINT32 type; /* type of memory segment */
9287
} __attribute__((packed));
9388

94-
95-
struct efi_ctx {
96-
uint64_t rip;
97-
VOID *rsdp;
98-
VOID *ap_trampoline_buf;
99-
dt_addr_t gdt;
100-
dt_addr_t idt;
101-
uint16_t tr_sel;
102-
uint16_t ldt_sel;
103-
uint64_t cr0;
104-
uint64_t cr3;
105-
uint64_t cr4;
106-
uint64_t rflags;
107-
uint16_t cs_sel;
108-
uint32_t cs_ar;
109-
uint16_t es_sel;
110-
uint16_t ss_sel;
111-
uint16_t ds_sel;
112-
uint16_t fs_sel;
113-
uint16_t gs_sel;
114-
uint64_t efer;
115-
uint64_t rax;
116-
uint64_t rbx;
117-
uint64_t rcx;
118-
uint64_t rdx;
119-
uint64_t rdi;
120-
uint64_t rsi;
121-
uint64_t rsp;
122-
uint64_t rbp;
123-
uint64_t r8;
124-
uint64_t r9;
125-
uint64_t r10;
126-
uint64_t r11;
127-
uint64_t r12;
128-
uint64_t r13;
129-
uint64_t r14;
130-
uint64_t r15;
131-
}__attribute__((packed));
132-
13389
struct acpi_table_rsdp {
13490
/* ACPI signature, contains "RSD PTR " */
13591
char signature[8];

0 commit comments

Comments
 (0)