Interface __PrefixOpSuffix
Inline function
Space | User/kernel |
Context | Sync/async/rt-irq |
May block | No |
SPL | Any |
Dynamic memory | No |
#include <ARCH/BITOPS.H>
static __finline__ void __PrefixOpSuffix(type *ptr, type val);
Description
This family of inline functions perform an atomic logical operation on memory. The operation will be performed between val and ptr location and the result will be stored at ptr location.
Parts of function name — Op, Suffix and Prefix determine logical operation, data type and atomicity requirements.
Arguments
- Prefix — This is the part of function name. It specifies atomicity of the operation.
- empty — Perform an operation that is atomic with respect to events on the CPU itself (ASTs or real time interrupts) but it is not atomic with respect to other CPUs or busmasters.
- LOCK_ — The operation will contain lock prefix, making it atomic with respect to other CPUs and bus mastering devices.
- Op — Determine the operation itself. Possibilities:
- OR — Bitwise OR.
- XOR — Bitwise XOR.
- AND — Bitwise AND.
- ADD — Adding two values.
- SUB — Subtract val from memory location.
- Suffix — This is the part of function name. It determines argument types:
- C — argument has the type signed or unsigned char or __s8 or __u8.
- I — argument has the type signed or unsigned int.
- L — argument has the type signed or unsigned long.
- 32 — argument has the type __u32 or __s32.
- ptr — Pointer pointing to a memory location that should be atomically changed.
- val — A value that will be bitwise-ORed at location ptr.
See also
__PrefixOpSuffixCondition __PrefixCMPXCHGSuffix