include/linux/atomic/atomic-instrumented.h
Source file repositories/reference/linux-study-clean/include/linux/atomic/atomic-instrumented.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/atomic/atomic-instrumented.h- Extension
.h- Size
- 138196 bytes
- Lines
- 5054
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
Dependency Surface
linux/build_bug.hlinux/compiler.hlinux/instrumented.h
Detected Declarations
function atomic_readfunction atomic_read_acquirefunction atomic_setfunction atomic_set_releasefunction atomic_addfunction atomic_add_returnfunction atomic_add_return_acquirefunction atomic_add_return_releasefunction atomic_add_return_relaxedfunction atomic_fetch_addfunction atomic_fetch_add_acquirefunction atomic_fetch_add_releasefunction atomic_fetch_add_relaxedfunction atomic_subfunction atomic_sub_returnfunction atomic_sub_return_acquirefunction atomic_sub_return_releasefunction atomic_sub_return_relaxedfunction atomic_fetch_subfunction atomic_fetch_sub_acquirefunction atomic_fetch_sub_releasefunction atomic_fetch_sub_relaxedfunction atomic_incfunction atomic_inc_returnfunction atomic_inc_return_acquirefunction atomic_inc_return_releasefunction atomic_inc_return_relaxedfunction atomic_fetch_incfunction atomic_fetch_inc_acquirefunction atomic_fetch_inc_releasefunction atomic_fetch_inc_relaxedfunction atomic_decfunction atomic_dec_returnfunction atomic_dec_return_acquirefunction atomic_dec_return_releasefunction atomic_dec_return_relaxedfunction atomic_fetch_decfunction atomic_fetch_dec_acquirefunction atomic_fetch_dec_releasefunction atomic_fetch_dec_relaxedfunction atomic_andfunction atomic_fetch_andfunction atomic_fetch_and_acquirefunction atomic_fetch_and_releasefunction atomic_fetch_and_relaxedfunction atomic_andnotfunction atomic_fetch_andnotfunction atomic_fetch_andnot_acquire
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
// Generated by scripts/atomic/gen-atomic-instrumented.sh
// DO NOT MODIFY THIS FILE DIRECTLY
/*
* This file provoides atomic operations with explicit instrumentation (e.g.
* KASAN, KCSAN), which should be used unless it is necessary to avoid
* instrumentation. Where it is necessary to aovid instrumenation, the
* raw_atomic*() operations should be used.
*/
#ifndef _LINUX_ATOMIC_INSTRUMENTED_H
#define _LINUX_ATOMIC_INSTRUMENTED_H
#include <linux/build_bug.h>
#include <linux/compiler.h>
#include <linux/instrumented.h>
/**
* atomic_read() - atomic load with relaxed ordering
* @v: pointer to atomic_t
*
* Atomically loads the value of @v with relaxed ordering.
*
* Unsafe to use in noinstr code; use raw_atomic_read() there.
*
* Return: The value loaded from @v.
*/
static __always_inline int
atomic_read(const atomic_t *v)
{
instrument_atomic_read(v, sizeof(*v));
return raw_atomic_read(v);
}
/**
* atomic_read_acquire() - atomic load with acquire ordering
* @v: pointer to atomic_t
*
* Atomically loads the value of @v with acquire ordering.
*
* Unsafe to use in noinstr code; use raw_atomic_read_acquire() there.
*
* Return: The value loaded from @v.
*/
static __always_inline int
atomic_read_acquire(const atomic_t *v)
{
instrument_atomic_read(v, sizeof(*v));
return raw_atomic_read_acquire(v);
}
/**
* atomic_set() - atomic set with relaxed ordering
* @v: pointer to atomic_t
* @i: int value to assign
*
* Atomically sets @v to @i with relaxed ordering.
*
* Unsafe to use in noinstr code; use raw_atomic_set() there.
*
* Return: Nothing.
*/
static __always_inline void
atomic_set(atomic_t *v, int i)
{
instrument_atomic_write(v, sizeof(*v));
raw_atomic_set(v, i);
}
/**
* atomic_set_release() - atomic set with release ordering
* @v: pointer to atomic_t
* @i: int value to assign
*
* Atomically sets @v to @i with release ordering.
*
* Unsafe to use in noinstr code; use raw_atomic_set_release() there.
*
* Return: Nothing.
*/
static __always_inline void
atomic_set_release(atomic_t *v, int i)
{
kcsan_release();
instrument_atomic_write(v, sizeof(*v));
raw_atomic_set_release(v, i);
}
/**
Annotation
- Immediate include surface: `linux/build_bug.h`, `linux/compiler.h`, `linux/instrumented.h`.
- Detected declarations: `function atomic_read`, `function atomic_read_acquire`, `function atomic_set`, `function atomic_set_release`, `function atomic_add`, `function atomic_add_return`, `function atomic_add_return_acquire`, `function atomic_add_return_release`, `function atomic_add_return_relaxed`, `function atomic_fetch_add`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.