hv: use macro instead of specify number

use macro instead of specify number

Signed-off-by: Wei Liu <weix.w.liu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Wei Liu 2018-07-30 10:28:34 +08:00 committed by lijinxia
parent 8ed98d33b7
commit 52fe9f419f
2 changed files with 6 additions and 5 deletions

View File

@ -458,7 +458,7 @@ void init_e820(void)
(HPA2HVA((uint64_t)boot_regs[1]));
pr_info("Multiboot info detected\n");
if ((mbi->mi_flags & 0x40U) != 0U) {
if ((mbi->mi_flags & MULTIBOOT_INFO_HAS_MMAP) != 0U) {
struct multiboot_mmap *mmap =
(struct multiboot_mmap *)
HPA2HVA((uint64_t)mbi->mi_mmap_addr);

View File

@ -7,10 +7,11 @@
#ifndef MULTIBOOT_H
#define MULTIBOOT_H
#define MULTIBOOT_INFO_MAGIC 0x2BADB002U
#define MULTIBOOT_INFO_HAS_CMDLINE 0x00000004U
#define MULTIBOOT_INFO_HAS_MODS 0x00000008U
#define MULTIBOOT_INFO_HAS_DRIVES 0x00000080U
#define MULTIBOOT_INFO_MAGIC 0x2BADB002U
#define MULTIBOOT_INFO_HAS_CMDLINE 0x00000004U
#define MULTIBOOT_INFO_HAS_MODS 0x00000008U
#define MULTIBOOT_INFO_HAS_MMAP 0x00000040U
#define MULTIBOOT_INFO_HAS_DRIVES 0x00000080U
struct multiboot_info {
uint32_t mi_flags;