Skip to content

Commit 350d6a9

Browse files
mingqiangchiacrnsi
authored andcommitted
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 <mingqiang.chi@intel.com>
1 parent eff44fb commit 350d6a9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

hypervisor/include/arch/x86/cpu.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@
138138

139139
#ifndef ASSEMBLER
140140

141-
#define BUS_LOCK "lock ; "
142-
143141
#define AP_MASK (((1UL << get_pcpu_nums()) - 1UL) & ~(1UL << 0U))
144142

145143
/**

hypervisor/include/lib/atomic.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929

3030
#ifndef ATOMIC_H
3131
#define ATOMIC_H
32-
#include <cpu.h>
32+
#include <types.h>
33+
34+
#define BUS_LOCK "lock ; "
3335

3436
#define build_atomic_load(name, size, type) \
3537
static inline type name(const volatile type *ptr) \

hypervisor/include/lib/bits.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929

3030
#ifndef BITS_H
3131
#define BITS_H
32-
#include <cpu.h>
32+
#include <atomic.h>
33+
3334
/**
3435
*
3536
* INVALID_BIT_INDEX means when input paramter is zero,

0 commit comments

Comments
 (0)