#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 */ 'submit' value='switch'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Mueller <smueller@chronox.de>2016-10-21 04:57:57 +0200
committerJonathan Corbet <corbet@lwn.net>2016-12-13 16:38:05 -0700
commitc30c98d174e5ecbb5d70c7c92846d4d884f8b38a (patch)
tree140fbcacc622aa31168cec3b13d9b8981e5649d0
parent0184cfe72d2f139c4feed7f3820ba2269f5de322 (diff)
crypto: doc - fix separation of cipher / req API
Keep the cipher API and the request API function documentation in separate sections. Signed-off-by: Stephan Mueller <smueller@chronox.de> Signed-off-by: Jonathan Corbet <corbet@lwn.net>