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>
This commit is contained in:
Mingqiang Chi 2019-01-29 17:04:39 +08:00 committed by Eddie Dong
parent 2b2dbe43d7
commit 615c2bf88b
4 changed files with 20 additions and 19 deletions

View File

@ -6,6 +6,7 @@
#include <hypervisor.h> #include <hypervisor.h>
#include <multiboot.h> #include <multiboot.h>
#include <e820.h>
#include <zeropage.h> #include <zeropage.h>
#include <sbl_seed_parse.h> #include <sbl_seed_parse.h>
#include <abl_seed_parse.h> #include <abl_seed_parse.h>

View File

@ -5,9 +5,9 @@
*/ */
#include <hypervisor.h> #include <hypervisor.h>
#include <e820.h>
#include <zeropage.h> #include <zeropage.h>
#include <boot_context.h> #include <boot_context.h>
#include <e820.h>
static void prepare_bsp_gdt(struct acrn_vm *vm) static void prepare_bsp_gdt(struct acrn_vm *vm)
{ {

View File

@ -7,6 +7,24 @@
#ifndef E820_H #ifndef E820_H
#define E820_H #define E820_H
/* E820 memory types */
#define E820_TYPE_RAM 1U /* EFI 1, 2, 3, 4, 5, 6, 7 */
#define E820_TYPE_RESERVED 2U
/* EFI 0, 11, 12, 13 (everything not used elsewhere) */
#define E820_TYPE_ACPI_RECLAIM 3U /* EFI 9 */
#define E820_TYPE_ACPI_NVS 4U /* EFI 10 */
#define E820_TYPE_UNUSABLE 5U /* EFI 8 */
/** Defines a single entry in an E820 memory map. */
struct e820_entry {
/** The base address of the memory range. */
uint64_t baseaddr;
/** The length of the memory range. */
uint64_t length;
/** The type of memory region. */
uint32_t type;
} __packed;
struct e820_mem_params { struct e820_mem_params {
uint64_t mem_bottom; uint64_t mem_bottom;
uint64_t mem_top; uint64_t mem_top;

View File

@ -169,24 +169,6 @@ void invept(const struct acrn_vcpu *vcpu);
const uint64_t *lookup_address(uint64_t *pml4_page, uint64_t addr, const uint64_t *lookup_address(uint64_t *pml4_page, uint64_t addr,
uint64_t *pg_size, const struct memory_ops *mem_ops); uint64_t *pg_size, const struct memory_ops *mem_ops);
/** Defines a single entry in an E820 memory map. */
struct e820_entry {
/** The base address of the memory range. */
uint64_t baseaddr;
/** The length of the memory range. */
uint64_t length;
/** The type of memory region. */
uint32_t type;
} __packed;
/* E820 memory types */
#define E820_TYPE_RAM 1U /* EFI 1, 2, 3, 4, 5, 6, 7 */
#define E820_TYPE_RESERVED 2U
/* EFI 0, 11, 12, 13 (everything not used elsewhere) */
#define E820_TYPE_ACPI_RECLAIM 3U /* EFI 9 */
#define E820_TYPE_ACPI_NVS 4U /* EFI 10 */
#define E820_TYPE_UNUSABLE 5U /* EFI 8 */
static inline void cache_flush_invalidate_all(void) static inline void cache_flush_invalidate_all(void)
{ {
asm volatile (" wbinvd\n" : : : "memory"); asm volatile (" wbinvd\n" : : : "memory");