drivers/xen/sys-hypervisor.c
Source file repositories/reference/linux-study-clean/drivers/xen/sys-hypervisor.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/xen/sys-hypervisor.c- Extension
.c- Size
- 14653 bytes
- Lines
- 675
- Domain
- Driver Families
- Bucket
- drivers/xen
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/slab.hlinux/kernel.hlinux/init.hlinux/kobject.hlinux/err.hasm/xen/hypervisor.hasm/xen/hypercall.hxen/xen.hxen/xenbus.hxen/interface/xen.hxen/interface/version.hxen/interface/xenpmu.h
Detected Declarations
struct hyp_sysfs_attrstruct pmu_modefunction type_showfunction xen_sysfs_type_initfunction guest_type_showfunction xen_sysfs_guest_type_initfunction major_showfunction minor_showfunction extra_showfunction xen_sysfs_version_initfunction uuid_show_fallbackfunction uuid_showfunction xen_sysfs_uuid_initfunction compiler_showfunction compiled_by_showfunction compile_date_showfunction xen_sysfs_compilation_initfunction capabilities_showfunction changeset_showfunction virtual_start_showfunction pagesize_showfunction xen_feature_showfunction features_showfunction buildid_showfunction xen_sysfs_properties_initfunction flag_showfunction xen_sysfs_flags_initfunction pmu_mode_storefunction pmu_mode_showfunction pmu_features_storefunction pmu_features_showfunction xen_sysfs_pmu_initfunction hyper_sysfs_initfunction hyp_sysfs_showfunction hyp_sysfs_storefunction hypervisor_subsys_initmodule init hyper_sysfs_initmodule init hypervisor_subsys_init
Annotated Snippet
device_initcall(hyper_sysfs_init);
static ssize_t hyp_sysfs_show(struct kobject *kobj,
struct attribute *attr,
char *buffer)
{
struct hyp_sysfs_attr *hyp_attr;
hyp_attr = container_of(attr, struct hyp_sysfs_attr, attr);
if (hyp_attr->show)
return hyp_attr->show(hyp_attr, buffer);
return 0;
}
static ssize_t hyp_sysfs_store(struct kobject *kobj,
struct attribute *attr,
const char *buffer,
size_t len)
{
struct hyp_sysfs_attr *hyp_attr;
hyp_attr = container_of(attr, struct hyp_sysfs_attr, attr);
if (hyp_attr->store)
return hyp_attr->store(hyp_attr, buffer, len);
return 0;
}
static const struct sysfs_ops hyp_sysfs_ops = {
.show = hyp_sysfs_show,
.store = hyp_sysfs_store,
};
static const struct kobj_type hyp_sysfs_kobj_type = {
.sysfs_ops = &hyp_sysfs_ops,
};
static int __init hypervisor_subsys_init(void)
{
if (!xen_domain())
return -ENODEV;
hypervisor_kobj->ktype = &hyp_sysfs_kobj_type;
return 0;
}
device_initcall(hypervisor_subsys_init);
Annotation
- Immediate include surface: `linux/slab.h`, `linux/kernel.h`, `linux/init.h`, `linux/kobject.h`, `linux/err.h`, `asm/xen/hypervisor.h`, `asm/xen/hypercall.h`, `xen/xen.h`.
- Detected declarations: `struct hyp_sysfs_attr`, `struct pmu_mode`, `function type_show`, `function xen_sysfs_type_init`, `function guest_type_show`, `function xen_sysfs_guest_type_init`, `function major_show`, `function minor_show`, `function extra_show`, `function xen_sysfs_version_init`.
- Atlas domain: Driver Families / drivers/xen.
- Implementation status: integration 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.