mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-04 02:14:45 +00:00
HV: improve e820 interfaces and their usages
1. change its APIs as more indepentent, and modify the callers' code 2. limit its global variables as static, and return const to the callers 3. remove unused code in "CONFIG_CMA" Tracked-On: #1842 Signed-off-by: Minggui Cao <minggui.cao@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -12,17 +12,27 @@ struct e820_mem_params {
|
||||
uint64_t max_ram_blk_size;
|
||||
};
|
||||
|
||||
/* HV read multiboot header to get e820 entries info and calc total RAM info */
|
||||
void init_e820(void);
|
||||
void obtain_e820_mem_info(void);
|
||||
|
||||
/* before boot vm0(service OS), call it to hide the HV RAM entry in e820 table from vm0 */
|
||||
void rebuild_vm0_e820(void);
|
||||
|
||||
/* get some RAM below 1MB in e820 entries, hide it from vm0, return its start address */
|
||||
uint64_t e820_alloc_low_memory(uint32_t size_arg);
|
||||
|
||||
extern uint32_t e820_entries;
|
||||
extern struct e820_entry e820[E820_MAX_ENTRIES];
|
||||
extern struct e820_mem_params e820_mem;
|
||||
|
||||
/* copy the original e820 entries info to param_e820 */
|
||||
uint32_t create_e820_table(struct e820_entry *param_e820);
|
||||
|
||||
/* get total number of the e820 entries */
|
||||
uint32_t get_e820_entries_count(void);
|
||||
|
||||
/* get the e802 entiries */
|
||||
const struct e820_entry *get_e820_entry(void);
|
||||
|
||||
/* get the e820 total memory info */
|
||||
const struct e820_mem_params *get_e820_mem_info(void);
|
||||
|
||||
#ifdef CONFIG_PARTITION_MODE
|
||||
/*
|
||||
* Default e820 mem map:
|
||||
|
@@ -70,7 +70,7 @@
|
||||
#define LDTR_AR (0x0082U) /* LDT, type must be 2, refer to SDM Vol3 26.3.1.2 */
|
||||
#define TR_AR (0x008bU) /* TSS (busy), refer to SDM Vol3 26.3.1.2 */
|
||||
|
||||
int prepare_vm0_memmap_and_e820(struct acrn_vm *vm);
|
||||
int prepare_vm0_memmap(struct acrn_vm *vm);
|
||||
/* Definition for a mem map lookup */
|
||||
struct vm_lu_mem_map {
|
||||
struct list_head list; /* EPT mem map lookup list*/
|
||||
|
Reference in New Issue
Block a user