From 350d6a9eb6e3f7361949b521f6cfd9835899c320 Mon Sep 17 00:00:00 2001 From: Mingqiang Chi Date: Thu, 9 May 2019 13:20:29 +0800 Subject: [PATCH] hv:Move BUS_LOCK to atomic.h now this MACRO is used in atomic.h and bits.h, move it from cpu.h to atomic.h to avoid reverse dependency(i.e. from lower layer to upper one) Tracked-On: #1842 Signed-off-by: Mingqiang Chi --- hypervisor/include/arch/x86/cpu.h | 2 -- hypervisor/include/lib/atomic.h | 4 +++- hypervisor/include/lib/bits.h | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hypervisor/include/arch/x86/cpu.h b/hypervisor/include/arch/x86/cpu.h index 96d900251..7054e753b 100644 --- a/hypervisor/include/arch/x86/cpu.h +++ b/hypervisor/include/arch/x86/cpu.h @@ -138,8 +138,6 @@ #ifndef ASSEMBLER -#define BUS_LOCK "lock ; " - #define AP_MASK (((1UL << get_pcpu_nums()) - 1UL) & ~(1UL << 0U)) /** diff --git a/hypervisor/include/lib/atomic.h b/hypervisor/include/lib/atomic.h index 9f6aea521..4104f973c 100644 --- a/hypervisor/include/lib/atomic.h +++ b/hypervisor/include/lib/atomic.h @@ -29,7 +29,9 @@ #ifndef ATOMIC_H #define ATOMIC_H -#include +#include + +#define BUS_LOCK "lock ; " #define build_atomic_load(name, size, type) \ static inline type name(const volatile type *ptr) \ diff --git a/hypervisor/include/lib/bits.h b/hypervisor/include/lib/bits.h index bbb7b0fae..3783f444a 100644 --- a/hypervisor/include/lib/bits.h +++ b/hypervisor/include/lib/bits.h @@ -29,7 +29,8 @@ #ifndef BITS_H #define BITS_H -#include +#include + /** * * INVALID_BIT_INDEX means when input paramter is zero,