mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 12:37:00 +07:00
powerpc/64: implement spin loop primitives
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
parent
fd851a3cdc
commit
ede8e2bbb0
@ -428,6 +428,26 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
|
|||||||
|
|
||||||
#ifdef CONFIG_PPC64
|
#ifdef CONFIG_PPC64
|
||||||
#define cpu_relax() do { HMT_low(); HMT_medium(); barrier(); } while (0)
|
#define cpu_relax() do { HMT_low(); HMT_medium(); barrier(); } while (0)
|
||||||
|
|
||||||
|
#define spin_begin() HMT_low()
|
||||||
|
|
||||||
|
#define spin_cpu_relax() barrier()
|
||||||
|
|
||||||
|
#define spin_cpu_yield() spin_cpu_relax()
|
||||||
|
|
||||||
|
#define spin_end() HMT_medium()
|
||||||
|
|
||||||
|
#define spin_until_cond(cond) \
|
||||||
|
do { \
|
||||||
|
if (unlikely(!(cond))) { \
|
||||||
|
spin_begin(); \
|
||||||
|
do { \
|
||||||
|
spin_cpu_relax(); \
|
||||||
|
} while (!(cond)); \
|
||||||
|
spin_end(); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define cpu_relax() barrier()
|
#define cpu_relax() barrier()
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user