From 52fe9f419fd5a4d6e399e7eb8f2835b44b162342 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Mon, 30 Jul 2018 10:28:34 +0800 Subject: [PATCH] hv: use macro instead of specify number use macro instead of specify number Signed-off-by: Wei Liu Acked-by: Eddie Dong --- hypervisor/arch/x86/guest/guest.c | 2 +- hypervisor/include/arch/x86/multiboot.h | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/hypervisor/arch/x86/guest/guest.c b/hypervisor/arch/x86/guest/guest.c index 6556a062a..9bb297c36 100644 --- a/hypervisor/arch/x86/guest/guest.c +++ b/hypervisor/arch/x86/guest/guest.c @@ -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); diff --git a/hypervisor/include/arch/x86/multiboot.h b/hypervisor/include/arch/x86/multiboot.h index 13b0a6263..ba010f69a 100644 --- a/hypervisor/include/arch/x86/multiboot.h +++ b/hypervisor/include/arch/x86/multiboot.h @@ -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;