drivers/xen/xen-balloon.c
Source file repositories/reference/linux-study-clean/drivers/xen/xen-balloon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/xen/xen-balloon.c- Extension
.c- Size
- 7331 bytes
- Lines
- 265
- Domain
- Driver Families
- Bucket
- drivers/xen
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/errno.hlinux/mm_types.hlinux/init.hlinux/capability.hlinux/memory_hotplug.hxen/xen.hxen/interface/xen.hxen/balloon.hxen/xenbus.hxen/features.hxen/page.hxen/mem-reservation.h
Detected Declarations
function watch_targetfunction balloon_init_watcherfunction xen_balloon_initfunction target_kb_showfunction target_kb_storefunction target_showfunction target_storefunction register_balloonexport xen_balloon_init
Annotated Snippet
static const struct bus_type balloon_subsys = {
.name = BALLOON_CLASS_NAME,
.dev_name = BALLOON_CLASS_NAME,
};
static int register_balloon(struct device *dev)
{
int error;
error = subsys_system_register(&balloon_subsys, NULL);
if (error)
return error;
dev->id = 0;
dev->bus = &balloon_subsys;
dev->groups = balloon_groups;
error = device_register(dev);
if (error) {
bus_unregister(&balloon_subsys);
return error;
}
return 0;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/mm_types.h`, `linux/init.h`, `linux/capability.h`, `linux/memory_hotplug.h`, `xen/xen.h`, `xen/interface/xen.h`.
- Detected declarations: `function watch_target`, `function balloon_init_watcher`, `function xen_balloon_init`, `function target_kb_show`, `function target_kb_store`, `function target_show`, `function target_store`, `function register_balloon`, `export xen_balloon_init`.
- Atlas domain: Driver Families / drivers/xen.
- Implementation status: pattern 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.