mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 22:42:53 +00:00
hv: modularization: remove multiboot dependency on e820.h.
This is done by adding the MAX_MMAP_ENTRIES macro in multiboot.h. This macro has to be sync-ed with E820_MAX_ENTRIES manually though. Tracked-On: #5661 Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
parent
681688fbe4
commit
7c02dc0801
@ -28,7 +28,11 @@
|
||||
#define MULTIBOOT_INFO_HAS_EFI_MMAP 0x00010000U
|
||||
#define MULTIBOOT_INFO_HAS_EFI64 0x00020000U
|
||||
|
||||
/* TODO: MAX_MMAP_ENTRIES shall be config by config tool, and same as E820_MAX_ENTRIES */
|
||||
#define MAX_MMAP_ENTRIES 32U
|
||||
|
||||
#define MAX_BOOTARGS_SIZE 2048U
|
||||
|
||||
/* The modules in multiboot are: Pre-launched VM: kernel/ramdisk/acpi; SOS VM: kernel/ramdisk */
|
||||
#define MAX_MODULE_NUM (3U * PRE_VM_NUM + 2U * SOS_VM_NUM)
|
||||
|
||||
@ -37,7 +41,6 @@
|
||||
|
||||
#ifndef ASSEMBLER
|
||||
|
||||
#include <e820.h>
|
||||
#include <zeropage.h>
|
||||
#include <vm_configurations.h>
|
||||
|
||||
@ -70,7 +73,7 @@ struct acrn_multiboot_info {
|
||||
|
||||
uint32_t mi_mmap_entries;
|
||||
const void *mi_mmap_va;
|
||||
struct multiboot_mmap mi_mmap_entry[E820_MAX_ENTRIES];
|
||||
struct multiboot_mmap mi_mmap_entry[MAX_MMAP_ENTRIES];
|
||||
|
||||
const void *mi_acpi_rsdp_va;
|
||||
struct efi_info mi_efi_info;
|
||||
|
@ -94,9 +94,9 @@ void init_acrn_multiboot_info(uint32_t magic, uint32_t info, char *sig)
|
||||
int32_t sanitize_acrn_multiboot_info(uint32_t magic, uint32_t info)
|
||||
{
|
||||
if ((acrn_mbi.mi_mmap_entries != 0U) && (acrn_mbi.mi_mmap_va != NULL)) {
|
||||
if (acrn_mbi.mi_mmap_entries > E820_MAX_ENTRIES) {
|
||||
if (acrn_mbi.mi_mmap_entries > MAX_MMAP_ENTRIES) {
|
||||
pr_err("Too many E820 entries %d\n", acrn_mbi.mi_mmap_entries);
|
||||
acrn_mbi.mi_mmap_entries = E820_MAX_ENTRIES;
|
||||
acrn_mbi.mi_mmap_entries = MAX_MMAP_ENTRIES;
|
||||
}
|
||||
if (boot_from_multiboot1(magic, info)) {
|
||||
uint32_t mmap_entry_size = sizeof(struct multiboot_mmap);
|
||||
@ -171,7 +171,7 @@ int32_t sanitize_acrn_multiboot_info(uint32_t magic, uint32_t info)
|
||||
/*
|
||||
* @post retval != NULL
|
||||
* @post retval->mi_flags & MULTIBOOT_INFO_HAS_MMAP != 0U
|
||||
* @post (retval->mi_mmap_entries > 0U) && (retval->mi_mmap_entries <= E820_MAX_ENTRIES)
|
||||
* @post (retval->mi_mmap_entries > 0U) && (retval->mi_mmap_entries <= MAX_MMAP_ENTRIES)
|
||||
*/
|
||||
struct acrn_multiboot_info *get_acrn_multiboot_info(void)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user