Skip to Content
Mastering Linux Kernel Development
book

Mastering Linux Kernel Development

by CH Raghav Maruthi
October 2017
Intermediate to advanced
354 pages
9h 28m
English
Packt Publishing
Content preview from Mastering Linux Kernel Development

Atomic integer operations

Generic atomic operation interfaces include support for integer and bitwise operations. Integer operations are implemented to operate on special kernel-defined types called atomic_t (32-bit integer) and atomic64_t (64-bit integer). Definitions for these types can be found in the generic kernel header <linux/types.h>:

typedef struct {        int counter;} atomic_t;#ifdef CONFIG_64BITtypedef struct {        long counter;} atomic64_t;#endif

The implementation provides two groups of integer operations; one set applicable on 32 bit and the other group for 64 bit atomic variables. These interface operations are implemented as a set of macros and inline functions. Following is a summarized list of operations applicable on atomic_t type ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Kernel Development, Third Edition

Linux Kernel Development, Third Edition

Robert Love
Understanding the Linux Kernel

Understanding the Linux Kernel

Daniel P. Bovet, Marco Cesati
Linux Kernel Debugging

Linux Kernel Debugging

Kaiwan N. Billimoria

Publisher Resources

ISBN: 9781785883057Other