From 581c0a239ad0a09442e6c729e8a1ab736b8991c3 Mon Sep 17 00:00:00 2001 From: Kaige Fu Date: Tue, 23 Apr 2019 10:40:14 +0000 Subject: [PATCH] HV: move AP_MASK to cpu.h It is better to use an unified MACRO. So, this patch moves AP_MASK to cpu.h and removes the defination of the MACRO spanning different source files. Tracked-On: #2991 Signed-off-by: Kaige Fu Acked-by: Eddie Dong --- hypervisor/arch/x86/cpu.c | 2 -- hypervisor/arch/x86/pm.c | 2 -- hypervisor/include/arch/x86/cpu.h | 2 ++ 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/hypervisor/arch/x86/cpu.c b/hypervisor/arch/x86/cpu.c index ead5789a5..897e1f914 100644 --- a/hypervisor/arch/x86/cpu.c +++ b/hypervisor/arch/x86/cpu.c @@ -30,8 +30,6 @@ #define CPU_UP_TIMEOUT 100U /* millisecond */ #define CPU_DOWN_TIMEOUT 100U /* millisecond */ -#define AP_MASK (((1UL << phys_cpu_num) - 1UL) & ~(1UL << 0U)) - struct per_cpu_region per_cpu_data[CONFIG_MAX_PCPU_NUM] __aligned(PAGE_SIZE); static uint16_t phys_cpu_num = 0U; static uint64_t pcpu_sync = 0UL; diff --git a/hypervisor/arch/x86/pm.c b/hypervisor/arch/x86/pm.c index 12069e369..ee749896a 100644 --- a/hypervisor/arch/x86/pm.c +++ b/hypervisor/arch/x86/pm.c @@ -20,8 +20,6 @@ #include #include -#define AP_MASK (((1UL << get_pcpu_nums()) - 1UL) & ~(1UL << 0U)) - struct cpu_context cpu_ctx; /* The values in this structure should come from host ACPI table */ diff --git a/hypervisor/include/arch/x86/cpu.h b/hypervisor/include/arch/x86/cpu.h index a284a78a0..258cf7d37 100644 --- a/hypervisor/include/arch/x86/cpu.h +++ b/hypervisor/include/arch/x86/cpu.h @@ -139,6 +139,8 @@ #define BUS_LOCK "lock ; " +#define AP_MASK (((1UL << get_pcpu_nums()) - 1UL) & ~(1UL << 0U)) + /** * * Identifiers for architecturally defined registers.