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.

Dependency Surface

Detected Declarations

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

Implementation Notes