#include <linux/slab.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/kobject.h>
#include <linux/err.h>
#include <asm/xen/hypervisor.h>
#include <asm/xen/hypercall.h>
#include <xen/xen.h>
#include <xen/xenbus.h>
#include <xen/interface/xen.h>
#include <xen/interface/version.h>
#ifdef CONFIG_XEN_HAVE_VPMU
#include <xen/interface/xenpmu.h>
#endif
#define HYPERVISOR_ATTR_RO(_name) …
#define HYPERVISOR_ATTR_RW(_name) …
struct hyp_sysfs_attr { … };
static ssize_t type_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static int __init xen_sysfs_type_init(void)
{ … }
static ssize_t guest_type_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static int __init xen_sysfs_guest_type_init(void)
{ … }
static ssize_t major_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static ssize_t minor_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static ssize_t extra_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static struct attribute *version_attrs[] = …;
static const struct attribute_group version_group = …;
static int __init xen_sysfs_version_init(void)
{ … }
static ssize_t uuid_show_fallback(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
static ssize_t uuid_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static int __init xen_sysfs_uuid_init(void)
{ … }
static ssize_t compiler_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static ssize_t compiled_by_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static ssize_t compile_date_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static struct attribute *xen_compile_attrs[] = …;
static const struct attribute_group xen_compilation_group = …;
static int __init xen_sysfs_compilation_init(void)
{ … }
static ssize_t capabilities_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static ssize_t changeset_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static ssize_t virtual_start_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static ssize_t pagesize_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static ssize_t xen_feature_show(int index, char *buffer)
{ … }
static ssize_t features_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static ssize_t buildid_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RO(…);
static struct attribute *xen_properties_attrs[] = …;
static const struct attribute_group xen_properties_group = …;
static int __init xen_sysfs_properties_init(void)
{ … }
#define FLAG_UNAME …
#define FLAG_UNAME_FMT …
#define FLAG_UNAME_MAX …
#define FLAG_COUNT …
static_assert(…);
static ssize_t flag_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
#define FLAG_NODE(flag, node) …
static struct hyp_sysfs_attr flag_attrs[FLAG_COUNT] = …;
static struct attribute_group xen_flags_group = …;
static char flag_unames[FLAG_COUNT][FLAG_UNAME_MAX];
static int __init xen_sysfs_flags_init(void)
{ … }
#ifdef CONFIG_XEN_HAVE_VPMU
struct pmu_mode { … };
static struct pmu_mode pmu_modes[] = …;
static ssize_t pmu_mode_store(struct hyp_sysfs_attr *attr,
const char *buffer, size_t len)
{ … }
static ssize_t pmu_mode_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RW(…);
static ssize_t pmu_features_store(struct hyp_sysfs_attr *attr,
const char *buffer, size_t len)
{ … }
static ssize_t pmu_features_show(struct hyp_sysfs_attr *attr, char *buffer)
{ … }
HYPERVISOR_ATTR_RW(…);
static struct attribute *xen_pmu_attrs[] = …;
static const struct attribute_group xen_pmu_group = …;
static int __init xen_sysfs_pmu_init(void)
{ … }
#endif
static int __init hyper_sysfs_init(void)
{ … }
device_initcall(hyper_sysfs_init);
static ssize_t hyp_sysfs_show(struct kobject *kobj,
struct attribute *attr,
char *buffer)
{ … }
static ssize_t hyp_sysfs_store(struct kobject *kobj,
struct attribute *attr,
const char *buffer,
size_t len)
{ … }
static const struct sysfs_ops hyp_sysfs_ops = …;
static const struct kobj_type hyp_sysfs_kobj_type = …;
static int __init hypervisor_subsys_init(void)
{ … }
device_initcall(hypervisor_subsys_init);