include/linux/uio_driver.h
Source file repositories/reference/linux-study-clean/include/linux/uio_driver.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/uio_driver.h- Extension
.h- Size
- 5416 bytes
- Lines
- 182
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/device.hlinux/fs.hlinux/interrupt.h
Detected Declarations
struct modulestruct uio_mapstruct uio_memstruct uio_portiostruct uio_portstruct uio_devicestruct uio_info
Annotated Snippet
struct uio_mem {
const char *name;
phys_addr_t addr;
dma_addr_t dma_addr;
unsigned long offs;
resource_size_t size;
int memtype;
void __iomem *internal_addr;
struct device *dma_device;
struct uio_map *map;
};
#define MAX_UIO_MAPS 5
struct uio_portio;
/**
* struct uio_port - description of a UIO port region
* @name: name of the port region for identification
* @start: start of port region
* @size: size of port region
* @porttype: type of port (see UIO_PORT_* below)
* @portio: for use by the UIO core only.
*/
struct uio_port {
const char *name;
unsigned long start;
unsigned long size;
int porttype;
struct uio_portio *portio;
};
#define MAX_UIO_PORT_REGIONS 5
struct uio_device {
struct module *owner;
struct device dev;
int minor;
atomic_t event;
struct fasync_struct *async_queue;
wait_queue_head_t wait;
struct uio_info *info;
struct mutex info_lock;
struct kobject *map_dir;
struct kobject *portio_dir;
};
/**
* struct uio_info - UIO device capabilities
* @uio_dev: the UIO device this info belongs to
* @name: device name
* @version: device driver version
* @mem: list of mappable memory regions, size==0 for end of list
* @port: list of port regions, size==0 for end of list
* @irq: interrupt number or UIO_IRQ_CUSTOM
* @irq_flags: flags for request_irq()
* @priv: optional private data
* @handler: the device's irq handler
* @mmap_prepare: mmap_prepare operation for this uio device
* @open: open operation for this uio device
* @release: release operation for this uio device
* @irqcontrol: disable/enable irqs when 0/1 is written to /dev/uioX
*/
struct uio_info {
struct uio_device *uio_dev;
const char *name;
const char *version;
struct uio_mem mem[MAX_UIO_MAPS];
struct uio_port port[MAX_UIO_PORT_REGIONS];
long irq;
unsigned long irq_flags;
void *priv;
irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
int (*mmap_prepare)(struct uio_info *info, struct vm_area_desc *desc);
int (*open)(struct uio_info *info, struct inode *inode);
int (*release)(struct uio_info *info, struct inode *inode);
int (*irqcontrol)(struct uio_info *info, s32 irq_on);
};
extern int __must_check
__uio_register_device(struct module *owner,
struct device *parent,
struct uio_info *info);
/* use a define to avoid include chaining to get THIS_MODULE */
/**
* uio_register_device - register a new userspace IO device
* @parent: parent device
* @info: UIO device capabilities
Annotation
- Immediate include surface: `linux/device.h`, `linux/fs.h`, `linux/interrupt.h`.
- Detected declarations: `struct module`, `struct uio_map`, `struct uio_mem`, `struct uio_portio`, `struct uio_port`, `struct uio_device`, `struct uio_info`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.