Skip to content

Commit 615c2bf

Browse files
mingqiangchiEddie Dong
authored andcommitted
hv:move e820 related macro and structure to e820.h
move 'struct e820_entry' 'E820_TYPE_XXX' from mmu.h to e820.h Tracked-On: #1842 Signed-off-by: Mingqiang Chi <mingqiang.chi@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent 2b2dbe4 commit 615c2bf

File tree

4 files changed

+20
-19
lines changed

4 files changed

+20
-19
lines changed

hypervisor/boot/sbl/multiboot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <hypervisor.h>
88
#include <multiboot.h>
9+
#include <e820.h>
910
#include <zeropage.h>
1011
#include <sbl_seed_parse.h>
1112
#include <abl_seed_parse.h>

hypervisor/common/vm_load.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
*/
66

77
#include <hypervisor.h>
8+
#include <e820.h>
89
#include <zeropage.h>
910
#include <boot_context.h>
10-
#include <e820.h>
1111

1212
static void prepare_bsp_gdt(struct acrn_vm *vm)
1313
{

hypervisor/include/arch/x86/e820.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@
77
#ifndef E820_H
88
#define E820_H
99

10+
/* E820 memory types */
11+
#define E820_TYPE_RAM 1U /* EFI 1, 2, 3, 4, 5, 6, 7 */
12+
#define E820_TYPE_RESERVED 2U
13+
/* EFI 0, 11, 12, 13 (everything not used elsewhere) */
14+
#define E820_TYPE_ACPI_RECLAIM 3U /* EFI 9 */
15+
#define E820_TYPE_ACPI_NVS 4U /* EFI 10 */
16+
#define E820_TYPE_UNUSABLE 5U /* EFI 8 */
17+
18+
/** Defines a single entry in an E820 memory map. */
19+
struct e820_entry {
20+
/** The base address of the memory range. */
21+
uint64_t baseaddr;
22+
/** The length of the memory range. */
23+
uint64_t length;
24+
/** The type of memory region. */
25+
uint32_t type;
26+
} __packed;
27+
1028
struct e820_mem_params {
1129
uint64_t mem_bottom;
1230
uint64_t mem_top;

hypervisor/include/arch/x86/mmu.h

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -169,24 +169,6 @@ void invept(const struct acrn_vcpu *vcpu);
169169
const uint64_t *lookup_address(uint64_t *pml4_page, uint64_t addr,
170170
uint64_t *pg_size, const struct memory_ops *mem_ops);
171171

172-
/** Defines a single entry in an E820 memory map. */
173-
struct e820_entry {
174-
/** The base address of the memory range. */
175-
uint64_t baseaddr;
176-
/** The length of the memory range. */
177-
uint64_t length;
178-
/** The type of memory region. */
179-
uint32_t type;
180-
} __packed;
181-
182-
/* E820 memory types */
183-
#define E820_TYPE_RAM 1U /* EFI 1, 2, 3, 4, 5, 6, 7 */
184-
#define E820_TYPE_RESERVED 2U
185-
/* EFI 0, 11, 12, 13 (everything not used elsewhere) */
186-
#define E820_TYPE_ACPI_RECLAIM 3U /* EFI 9 */
187-
#define E820_TYPE_ACPI_NVS 4U /* EFI 10 */
188-
#define E820_TYPE_UNUSABLE 5U /* EFI 8 */
189-
190172
static inline void cache_flush_invalidate_all(void)
191173
{
192174
asm volatile (" wbinvd\n" : : : "memory");

0 commit comments

Comments
 (0)