include/linux/atomic/atomic-long.h
Source file repositories/reference/linux-study-clean/include/linux/atomic/atomic-long.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/atomic/atomic-long.h- Extension
.h- Size
- 47250 bytes
- Lines
- 1813
- 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/compiler.hasm/types.h
Detected Declarations
function raw_atomic_long_readfunction raw_atomic_long_read_acquirefunction raw_atomic_long_setfunction raw_atomic_long_set_releasefunction raw_atomic_long_addfunction raw_atomic_long_add_returnfunction raw_atomic_long_add_return_acquirefunction raw_atomic_long_add_return_releasefunction raw_atomic_long_add_return_relaxedfunction raw_atomic_long_fetch_addfunction raw_atomic_long_fetch_add_acquirefunction raw_atomic_long_fetch_add_releasefunction raw_atomic_long_fetch_add_relaxedfunction raw_atomic_long_subfunction raw_atomic_long_sub_returnfunction raw_atomic_long_sub_return_acquirefunction raw_atomic_long_sub_return_releasefunction raw_atomic_long_sub_return_relaxedfunction raw_atomic_long_fetch_subfunction raw_atomic_long_fetch_sub_acquirefunction raw_atomic_long_fetch_sub_releasefunction raw_atomic_long_fetch_sub_relaxedfunction raw_atomic_long_incfunction raw_atomic_long_inc_returnfunction raw_atomic_long_inc_return_acquirefunction raw_atomic_long_inc_return_releasefunction raw_atomic_long_inc_return_relaxedfunction raw_atomic_long_fetch_incfunction raw_atomic_long_fetch_inc_acquirefunction raw_atomic_long_fetch_inc_releasefunction raw_atomic_long_fetch_inc_relaxedfunction raw_atomic_long_decfunction raw_atomic_long_dec_returnfunction raw_atomic_long_dec_return_acquirefunction raw_atomic_long_dec_return_releasefunction raw_atomic_long_dec_return_relaxedfunction raw_atomic_long_fetch_decfunction raw_atomic_long_fetch_dec_acquirefunction raw_atomic_long_fetch_dec_releasefunction raw_atomic_long_fetch_dec_relaxedfunction raw_atomic_long_andfunction raw_atomic_long_fetch_andfunction raw_atomic_long_fetch_and_acquirefunction raw_atomic_long_fetch_and_releasefunction raw_atomic_long_fetch_and_relaxedfunction raw_atomic_long_andnotfunction raw_atomic_long_fetch_andnotfunction raw_atomic_long_fetch_andnot_acquire
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
// Generated by scripts/atomic/gen-atomic-long.sh
// DO NOT MODIFY THIS FILE DIRECTLY
#ifndef _LINUX_ATOMIC_LONG_H
#define _LINUX_ATOMIC_LONG_H
#include <linux/compiler.h>
#include <asm/types.h>
#ifdef CONFIG_64BIT
typedef atomic64_t atomic_long_t;
#define ATOMIC_LONG_INIT(i) ATOMIC64_INIT(i)
#define atomic_long_cond_read_acquire atomic64_cond_read_acquire
#define atomic_long_cond_read_relaxed atomic64_cond_read_relaxed
#else
typedef atomic_t atomic_long_t;
#define ATOMIC_LONG_INIT(i) ATOMIC_INIT(i)
#define atomic_long_cond_read_acquire atomic_cond_read_acquire
#define atomic_long_cond_read_relaxed atomic_cond_read_relaxed
#endif
/**
* raw_atomic_long_read() - atomic load with relaxed ordering
* @v: pointer to atomic_long_t
*
* Atomically loads the value of @v with relaxed ordering.
*
* Safe to use in noinstr code; prefer atomic_long_read() elsewhere.
*
* Return: The value loaded from @v.
*/
static __always_inline long
raw_atomic_long_read(const atomic_long_t *v)
{
#ifdef CONFIG_64BIT
return raw_atomic64_read(v);
#else
return raw_atomic_read(v);
#endif
}
/**
* raw_atomic_long_read_acquire() - atomic load with acquire ordering
* @v: pointer to atomic_long_t
*
* Atomically loads the value of @v with acquire ordering.
*
* Safe to use in noinstr code; prefer atomic_long_read_acquire() elsewhere.
*
* Return: The value loaded from @v.
*/
static __always_inline long
raw_atomic_long_read_acquire(const atomic_long_t *v)
{
#ifdef CONFIG_64BIT
return raw_atomic64_read_acquire(v);
#else
return raw_atomic_read_acquire(v);
#endif
}
/**
* raw_atomic_long_set() - atomic set with relaxed ordering
* @v: pointer to atomic_long_t
* @i: long value to assign
*
* Atomically sets @v to @i with relaxed ordering.
*
* Safe to use in noinstr code; prefer atomic_long_set() elsewhere.
*
* Return: Nothing.
*/
static __always_inline void
raw_atomic_long_set(atomic_long_t *v, long i)
{
#ifdef CONFIG_64BIT
raw_atomic64_set(v, i);
#else
raw_atomic_set(v, i);
#endif
}
/**
* raw_atomic_long_set_release() - atomic set with release ordering
* @v: pointer to atomic_long_t
* @i: long value to assign
*
* Atomically sets @v to @i with release ordering.
Annotation
- Immediate include surface: `linux/compiler.h`, `asm/types.h`.
- Detected declarations: `function raw_atomic_long_read`, `function raw_atomic_long_read_acquire`, `function raw_atomic_long_set`, `function raw_atomic_long_set_release`, `function raw_atomic_long_add`, `function raw_atomic_long_add_return`, `function raw_atomic_long_add_return_acquire`, `function raw_atomic_long_add_return_release`, `function raw_atomic_long_add_return_relaxed`, `function raw_atomic_long_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.