From 437dac74f67df5b00ce3c3552d1e14640cd25eb3 Mon Sep 17 00:00:00 2001 From: Yifan Liu Date: Thu, 23 Oct 2025 02:02:04 +0000 Subject: [PATCH] hv: mmu: Move MEM_xx definition to common mmu.h Tracked-On: #8830 Signed-off-by: Yifan Liu Reviewed-by: Fei, Li Acked-by: Wang Yu1 --- hypervisor/include/arch/x86/asm/mmu.h | 10 ---------- hypervisor/include/common/mmu.h | 10 ++++++++++ hypervisor/include/dm/vacpi.h | 1 + misc/hv_prebuild/static_checks.c | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/hypervisor/include/arch/x86/asm/mmu.h b/hypervisor/include/arch/x86/asm/mmu.h index e708932b1..75fa9f80f 100644 --- a/hypervisor/include/arch/x86/asm/mmu.h +++ b/hypervisor/include/arch/x86/asm/mmu.h @@ -33,16 +33,6 @@ */ #define PAGE_FAULT_ID_FLAG 0x00000010U -/* Defines used for common memory sizes */ -#define MEM_1K 1024U -#define MEM_2K (MEM_1K * 2U) -#define MEM_4K (MEM_1K * 4U) -#define MEM_1M (MEM_1K * 1024U) -#define MEM_2M (MEM_1M * 2U) -#define MEM_1G (MEM_1M * 1024U) -#define MEM_2G (MEM_1G * 2UL) -#define MEM_4G (MEM_1G * 4UL) - #ifndef ASSEMBLER #include diff --git a/hypervisor/include/common/mmu.h b/hypervisor/include/common/mmu.h index aca523e1b..dba3694dd 100644 --- a/hypervisor/include/common/mmu.h +++ b/hypervisor/include/common/mmu.h @@ -10,6 +10,16 @@ #include #include +/* Defines used for common memory sizes */ +#define MEM_1K 1024U +#define MEM_2K (MEM_1K * 2U) +#define MEM_4K (MEM_1K * 4U) +#define MEM_1M (MEM_1K * 1024U) +#define MEM_2M (MEM_1M * 2U) +#define MEM_1G (MEM_1M * 1024U) +#define MEM_2G (MEM_1G * 2UL) +#define MEM_4G (MEM_1G * 4UL) + void set_paging_supervisor(uint64_t base, uint64_t size); /** diff --git a/hypervisor/include/dm/vacpi.h b/hypervisor/include/dm/vacpi.h index f364847d0..1326ce525 100644 --- a/hypervisor/include/dm/vacpi.h +++ b/hypervisor/include/dm/vacpi.h @@ -8,6 +8,7 @@ #define VACPI_H #include +#include #include #define ACPI_OEM_ID "ACRN " diff --git a/misc/hv_prebuild/static_checks.c b/misc/hv_prebuild/static_checks.c index 9843e0a4e..8e812d5f1 100644 --- a/misc/hv_prebuild/static_checks.c +++ b/misc/hv_prebuild/static_checks.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include