Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/64: implement spin loop primitives

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Nicholas Piggin and committed by
Michael Ellerman
ede8e2bb fd851a3c

+20
+20
arch/powerpc/include/asm/processor.h
··· 428 428 429 429 #ifdef CONFIG_PPC64 430 430 #define cpu_relax() do { HMT_low(); HMT_medium(); barrier(); } while (0) 431 + 432 + #define spin_begin() HMT_low() 433 + 434 + #define spin_cpu_relax() barrier() 435 + 436 + #define spin_cpu_yield() spin_cpu_relax() 437 + 438 + #define spin_end() HMT_medium() 439 + 440 + #define spin_until_cond(cond) \ 441 + do { \ 442 + if (unlikely(!(cond))) { \ 443 + spin_begin(); \ 444 + do { \ 445 + spin_cpu_relax(); \ 446 + } while (!(cond)); \ 447 + spin_end(); \ 448 + } \ 449 + } while (0) 450 + 431 451 #else 432 452 #define cpu_relax() barrier() 433 453 #endif