drivers/misc/uacce/uacce.c
Source file repositories/reference/linux-study-clean/drivers/misc/uacce/uacce.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/uacce/uacce.c- Extension
.c- Size
- 14386 bytes
- Lines
- 644
- Domain
- Driver Families
- Bucket
- drivers/misc
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compat.hlinux/dma-mapping.hlinux/iommu.hlinux/module.hlinux/poll.hlinux/slab.hlinux/uacce.h
Detected Declarations
function uacce_queue_is_validfunction uacce_start_queuefunction uacce_stop_queuefunction uacce_put_queuefunction uacce_fops_unl_ioctlfunction uacce_fops_compat_ioctlfunction uacce_bind_queuefunction uacce_unbind_queuefunction uacce_fops_openfunction uacce_fops_releasefunction uacce_vma_closefunction uacce_vma_mremapfunction uacce_fops_mmapfunction uacce_fops_pollfunction api_showfunction flags_showfunction available_instances_showfunction algorithms_showfunction region_mmio_size_showfunction region_dus_size_showfunction isolate_showfunction isolate_strategy_showfunction isolate_strategy_storefunction uacce_dev_is_visiblefunction uacce_releasefunction uacce_allocfunction uacce_registerfunction uacce_removefunction uacce_initfunction uacce_exitmodule init uacce_initexport uacce_allocexport uacce_registerexport uacce_remove
Annotated Snippet
static const struct file_operations uacce_fops = {
.owner = THIS_MODULE,
.open = uacce_fops_open,
.release = uacce_fops_release,
.unlocked_ioctl = uacce_fops_unl_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = uacce_fops_compat_ioctl,
#endif
.mmap = uacce_fops_mmap,
.poll = uacce_fops_poll,
};
#define to_uacce_device(dev) container_of(dev, struct uacce_device, dev)
static ssize_t api_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct uacce_device *uacce = to_uacce_device(dev);
return sysfs_emit(buf, "%s\n", uacce->api_ver);
}
static ssize_t flags_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct uacce_device *uacce = to_uacce_device(dev);
return sysfs_emit(buf, "%u\n", uacce->flags);
}
static ssize_t available_instances_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct uacce_device *uacce = to_uacce_device(dev);
if (!uacce->ops->get_available_instances)
return -ENODEV;
return sysfs_emit(buf, "%d\n",
uacce->ops->get_available_instances(uacce));
}
static ssize_t algorithms_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct uacce_device *uacce = to_uacce_device(dev);
return sysfs_emit(buf, "%s\n", uacce->algs);
}
static ssize_t region_mmio_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct uacce_device *uacce = to_uacce_device(dev);
return sysfs_emit(buf, "%lu\n",
uacce->qf_pg_num[UACCE_QFRT_MMIO] << PAGE_SHIFT);
}
static ssize_t region_dus_size_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct uacce_device *uacce = to_uacce_device(dev);
return sysfs_emit(buf, "%lu\n",
uacce->qf_pg_num[UACCE_QFRT_DUS] << PAGE_SHIFT);
}
static ssize_t isolate_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct uacce_device *uacce = to_uacce_device(dev);
return sysfs_emit(buf, "%d\n", uacce->ops->get_isolate_state(uacce));
}
static ssize_t isolate_strategy_show(struct device *dev, struct device_attribute *attr, char *buf)
{
struct uacce_device *uacce = to_uacce_device(dev);
u32 val;
if (!uacce->ops->isolate_err_threshold_read)
return -ENOENT;
val = uacce->ops->isolate_err_threshold_read(uacce);
return sysfs_emit(buf, "%u\n", val);
}
Annotation
- Immediate include surface: `linux/compat.h`, `linux/dma-mapping.h`, `linux/iommu.h`, `linux/module.h`, `linux/poll.h`, `linux/slab.h`, `linux/uacce.h`.
- Detected declarations: `function uacce_queue_is_valid`, `function uacce_start_queue`, `function uacce_stop_queue`, `function uacce_put_queue`, `function uacce_fops_unl_ioctl`, `function uacce_fops_compat_ioctl`, `function uacce_bind_queue`, `function uacce_unbind_queue`, `function uacce_fops_open`, `function uacce_fops_release`.
- Atlas domain: Driver Families / drivers/misc.
- Implementation status: pattern 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.