include/linux/counter.h
Source file repositories/reference/linux-study-clean/include/linux/counter.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/counter.h- Extension
.h- Size
- 22093 bytes
- Lines
- 639
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/array_size.hlinux/cdev.hlinux/device.hlinux/kfifo.hlinux/mutex.hlinux/spinlock_types.hlinux/types.hlinux/wait.huapi/linux/counter.h
Detected Declarations
struct counter_devicestruct counter_countstruct counter_synapsestruct counter_signalstruct counter_compstruct counter_signalstruct counter_synapsestruct counter_countstruct counter_event_nodestruct counter_opsstruct counter_devicestruct counter_availablestruct counter_arrayenum counter_comp_type
Annotated Snippet
struct counter_comp {
enum counter_comp_type type;
const char *name;
void *priv;
union {
int (*action_read)(struct counter_device *counter,
struct counter_count *count,
struct counter_synapse *synapse,
enum counter_synapse_action *action);
int (*device_u8_read)(struct counter_device *counter, u8 *val);
int (*count_u8_read)(struct counter_device *counter,
struct counter_count *count, u8 *val);
int (*signal_u8_read)(struct counter_device *counter,
struct counter_signal *signal, u8 *val);
int (*device_u32_read)(struct counter_device *counter,
u32 *val);
int (*count_u32_read)(struct counter_device *counter,
struct counter_count *count, u32 *val);
int (*signal_u32_read)(struct counter_device *counter,
struct counter_signal *signal, u32 *val);
int (*device_u64_read)(struct counter_device *counter,
u64 *val);
int (*count_u64_read)(struct counter_device *counter,
struct counter_count *count, u64 *val);
int (*signal_u64_read)(struct counter_device *counter,
struct counter_signal *signal, u64 *val);
int (*signal_array_u32_read)(struct counter_device *counter,
struct counter_signal *signal,
size_t idx, u32 *val);
int (*device_array_u64_read)(struct counter_device *counter,
size_t idx, u64 *val);
int (*count_array_u64_read)(struct counter_device *counter,
struct counter_count *count,
size_t idx, u64 *val);
int (*signal_array_u64_read)(struct counter_device *counter,
struct counter_signal *signal,
size_t idx, u64 *val);
};
union {
int (*action_write)(struct counter_device *counter,
struct counter_count *count,
struct counter_synapse *synapse,
enum counter_synapse_action action);
int (*device_u8_write)(struct counter_device *counter, u8 val);
int (*count_u8_write)(struct counter_device *counter,
struct counter_count *count, u8 val);
int (*signal_u8_write)(struct counter_device *counter,
struct counter_signal *signal, u8 val);
int (*device_u32_write)(struct counter_device *counter,
u32 val);
int (*count_u32_write)(struct counter_device *counter,
struct counter_count *count, u32 val);
int (*signal_u32_write)(struct counter_device *counter,
struct counter_signal *signal, u32 val);
int (*device_u64_write)(struct counter_device *counter,
u64 val);
int (*count_u64_write)(struct counter_device *counter,
struct counter_count *count, u64 val);
int (*signal_u64_write)(struct counter_device *counter,
struct counter_signal *signal, u64 val);
int (*signal_array_u32_write)(struct counter_device *counter,
struct counter_signal *signal,
size_t idx, u32 val);
int (*device_array_u64_write)(struct counter_device *counter,
size_t idx, u64 val);
int (*count_array_u64_write)(struct counter_device *counter,
struct counter_count *count,
size_t idx, u64 val);
int (*signal_array_u64_write)(struct counter_device *counter,
struct counter_signal *signal,
size_t idx, u64 val);
};
};
/**
* struct counter_signal - Counter Signal node
* @id: unique ID used to identify the Signal
* @name: device-specific Signal name
* @ext: optional array of Signal extensions
* @num_ext: number of Signal extensions specified in @ext
*/
struct counter_signal {
int id;
const char *name;
struct counter_comp *ext;
size_t num_ext;
};
/**
Annotation
- Immediate include surface: `linux/array_size.h`, `linux/cdev.h`, `linux/device.h`, `linux/kfifo.h`, `linux/mutex.h`, `linux/spinlock_types.h`, `linux/types.h`, `linux/wait.h`.
- Detected declarations: `struct counter_device`, `struct counter_count`, `struct counter_synapse`, `struct counter_signal`, `struct counter_comp`, `struct counter_signal`, `struct counter_synapse`, `struct counter_count`, `struct counter_event_node`, `struct counter_ops`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
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.