include/linux/logic_iomem.h

Source file repositories/reference/linux-study-clean/include/linux/logic_iomem.h

File Facts

System
Linux kernel
Corpus path
include/linux/logic_iomem.h
Extension
.h
Size
2124 bytes
Lines
63
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 logic_iomem_ops {
	unsigned long (*read)(void *priv, unsigned int offset, int size);
	void (*write)(void *priv, unsigned int offset, int size,
		      unsigned long val);

	void (*set)(void *priv, unsigned int offset, u8 value, int size);
	void (*copy_from)(void *priv, void *buffer, unsigned int offset,
			  int size);
	void (*copy_to)(void *priv, unsigned int offset, const void *buffer,
			int size);

	void (*unmap)(void *priv);
};

/**
 * struct logic_iomem_region_ops - ops for an IO memory handler
 * @map: map a range in the registered IO memory region, must
 *	fill *ops with the ops and may fill *priv to be passed
 *	to the ops. The offset is given as the offset into the
 *	registered resource region.
 *	The return value is negative for errors, or >= 0 for
 *	success. On success, the return value is added to the
 *	offset for later ops, to allow for partial mappings.
 */
struct logic_iomem_region_ops {
	long (*map)(unsigned long offset, size_t size,
		    const struct logic_iomem_ops **ops,
		    void **priv);
};

/**
 * logic_iomem_add_region - register an IO memory region
 * @resource: the resource description for this region
 * @ops: the IO memory mapping ops for this resource
 */
int logic_iomem_add_region(struct resource *resource,
			   const struct logic_iomem_region_ops *ops);

#endif /* __LOGIC_IOMEM_H */

Annotation

Implementation Notes