#ifndef _TOOLS_LINUX_ASM_X86_ATOMIC_H #define _TOOLS_LINUX_ASM_X86_ATOMIC_H #include #include #include "rmwcc.h" #define LOCK_PREFIX "\n\tlock; " /* * Atomic operations that C can't guarantee us. Useful for * resource counting etc.. */ #define ATOMIC_INIT(i) { (i) } /** * atomic_read - read atomic variable * @v: pointer of type atomic_t * * Atomically reads the value of @v. */ static inline int atomic_read(const atomic_t *v) { return ACCESS_ONCE((v)->counter); } /** * atomic_set - set atomic variable * @v: pointer of type atomic_t * @i: required value * * Atomically sets the value of @v to @i. */ static inline void atomic_set(atomic_t *v, int i) { v->counter = i; } /** * atomic_inc - increment atomic variable * @v: pointer of type atomic_t * * Atomically increments @v by 1. */ static inline void atomic_inc(atomic_t *v) { asm volatile(LOCK_PREFIX "incl %0" : "+m" (v->counter)); } /** * atomic_dec_and_test - decrement and test * @v: pointer of type atomic_t * * Atomically decrements @v by 1 and * returns true if the result is 0, or false for all other * cases. */ static inline int atomic_dec_and_test(atomic_t *v) { GEN_UNARY_RMWcc(LOCK_PREFIX "decl", v->counter, "%0", "e"); } #endif /* _TOOLS_LINUX_ASM_X86_ATOMIC_H */ rx-pump-back'>packet-rx-pump-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
ipt>
AgeCommit message (Collapse)AuthorFilesLines
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2016-11-03 15:50:08 +0100
committerThomas Gleixner <tglx@linutronix.de>2016-11-09 23:45:29 +0100
commit7cc277b489b4fe91f42eb596b282879c2d13152e (patch)
treefb36ccbad2bd772cbc963a7236fbd776e8c2b687
parentdfbbd86a0f1c3ceec15b64c8f2149a903806ed8c (diff)
drivers base/cacheinfo: Convert to hotplug state machine
Install the callbacks via the state machine and let the core invoke the callbacks on the already online CPUs. No functional change. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: rt@linutronix.de Link: http://lkml.kernel.org/r/20161103145021.28528-13-bigeasy@linutronix.de Signed-off-by: Thomas Gleixner <tglx@linutronix.de>