mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 16:57:20 +00:00
HV: re-arch boot component header
The patch re-arch boot component header files by: - moving multiboot.h from include/arch/x86/ to boot/include/ and keep this header for multiboot1 protocol data struct only; - moving multiboot related MACROs in cpu_primary.S to multiboot.h; - creating an independent boot.h to store acrn specific boot information for other files' reference; Tracked-On: #4419 Signed-off-by: Victor Sun <victor.sun@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -6,11 +6,10 @@
|
||||
|
||||
#include <types.h>
|
||||
#include <errno.h>
|
||||
#include <multiboot.h>
|
||||
#include <boot.h>
|
||||
#include <pgtable.h>
|
||||
#include <dbg_cmd.h>
|
||||
#include <logmsg.h>
|
||||
#include <vboot.h>
|
||||
|
||||
void parse_hv_cmdline(void)
|
||||
{
|
||||
|
@@ -15,7 +15,7 @@
|
||||
#include <lapic.h>
|
||||
#include <per_cpu.h>
|
||||
#include <guest/vm.h>
|
||||
#include <multiboot.h>
|
||||
#include <boot.h>
|
||||
#include <deprivilege_boot.h>
|
||||
|
||||
static struct depri_boot_context depri_boot_ctx;
|
||||
|
@@ -10,7 +10,7 @@
|
||||
#include <per_cpu.h>
|
||||
#include <irq.h>
|
||||
#include <boot_context.h>
|
||||
#include <multiboot.h>
|
||||
#include <boot.h>
|
||||
#include <pgtable.h>
|
||||
#include <zeropage.h>
|
||||
#include <seed.h>
|
||||
|
@@ -4,11 +4,11 @@
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#include <multiboot.h>
|
||||
#include <vm.h>
|
||||
#include <types.h>
|
||||
#include <pgtable.h>
|
||||
#include <acpi.h>
|
||||
#include <boot.h>
|
||||
#include <vboot.h>
|
||||
#include <direct_boot.h>
|
||||
#include <deprivilege_boot.h>
|
||||
|
17
hypervisor/boot/include/boot.h
Normal file
17
hypervisor/boot/include/boot.h
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef BOOT_H_
|
||||
#define BOOT_H_
|
||||
|
||||
#include <multiboot.h>
|
||||
|
||||
#define MAX_BOOTARGS_SIZE 2048U
|
||||
|
||||
/* boot_regs store the multiboot info magic and address */
|
||||
extern uint32_t boot_regs[2];
|
||||
|
||||
#endif /* BOOT_H_ */
|
92
hypervisor/boot/include/multiboot.h
Normal file
92
hypervisor/boot/include/multiboot.h
Normal file
@@ -0,0 +1,92 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-3-Clause
|
||||
*/
|
||||
|
||||
#ifndef MULTIBOOT_H
|
||||
#define MULTIBOOT_H
|
||||
|
||||
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
|
||||
#define MULTIBOOT_INFO_MAGIC 0x2BADB002U
|
||||
|
||||
/* MULTIBOOT HEADER FLAGS */
|
||||
#define MULTIBOOT_HEADER_NEED_MEMINFO 0x00000002
|
||||
|
||||
/* MULTIBOOT INFO FLAGS */
|
||||
#define MULTIBOOT_INFO_HAS_CMDLINE 0x00000004U
|
||||
#define MULTIBOOT_INFO_HAS_MODS 0x00000008U
|
||||
#define MULTIBOOT_INFO_HAS_MMAP 0x00000040U
|
||||
#define MULTIBOOT_INFO_HAS_DRIVES 0x00000080U
|
||||
#define MULTIBOOT_INFO_HAS_LOADER_NAME 0x00000200U
|
||||
|
||||
#ifndef ASSEMBLER
|
||||
|
||||
struct multiboot_info {
|
||||
uint32_t mi_flags;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MEMORY. */
|
||||
uint32_t mi_mem_lower;
|
||||
uint32_t mi_mem_upper;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_BOOT_DEVICE. */
|
||||
uint8_t mi_boot_device_part3;
|
||||
uint8_t mi_boot_device_part2;
|
||||
uint8_t mi_boot_device_part1;
|
||||
uint8_t mi_boot_device_drive;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_CMDLINE. */
|
||||
uint32_t mi_cmdline;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MODS. */
|
||||
uint32_t mi_mods_count;
|
||||
uint32_t mi_mods_addr;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_{AOUT,ELF}_SYMS. */
|
||||
uint32_t mi_elfshdr_num;
|
||||
uint32_t mi_elfshdr_size;
|
||||
uint32_t mi_elfshdr_addr;
|
||||
uint32_t mi_elfshdr_shndx;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_MMAP. */
|
||||
uint32_t mi_mmap_length;
|
||||
uint32_t mi_mmap_addr;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_DRIVES. */
|
||||
uint32_t mi_drives_length;
|
||||
uint32_t mi_drives_addr;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_CONFIG_TABLE. */
|
||||
uint32_t unused_mi_config_table;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_LOADER_NAME. */
|
||||
uint32_t mi_loader_name;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_APM. */
|
||||
uint32_t unused_mi_apm_table;
|
||||
|
||||
/* Valid if mi_flags sets MULTIBOOT_INFO_HAS_VBE. */
|
||||
uint32_t unused_mi_vbe_control_info;
|
||||
uint32_t unused_mi_vbe_mode_info;
|
||||
uint32_t unused_mi_vbe_interface_seg;
|
||||
uint32_t unused_mi_vbe_interface_off;
|
||||
uint32_t unused_mi_vbe_interface_len;
|
||||
};
|
||||
|
||||
struct multiboot_mmap {
|
||||
uint32_t size;
|
||||
uint64_t baseaddr;
|
||||
uint64_t length;
|
||||
uint32_t type;
|
||||
} __packed;
|
||||
|
||||
struct multiboot_module {
|
||||
uint32_t mm_mod_start;
|
||||
uint32_t mm_mod_end;
|
||||
uint32_t mm_string;
|
||||
uint32_t mm_reserved;
|
||||
};
|
||||
|
||||
#endif /* ASSEMBLER */
|
||||
|
||||
#endif /* MULTIBOOT_H */
|
Reference in New Issue
Block a user