#include <linux/string.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/efi.h>
#include <linux/slab.h>
#include <asm/efi.h>
#include <asm/setup.h>
struct efi_runtime_map_entry { … };
static struct efi_runtime_map_entry **map_entries;
struct map_attribute { … };
static inline struct map_attribute *to_map_attr(struct attribute *attr)
{ … }
static ssize_t type_show(struct efi_runtime_map_entry *entry, char *buf)
{ … }
#define EFI_RUNTIME_FIELD(var) …
#define EFI_RUNTIME_U64_ATTR_SHOW(name) …
EFI_RUNTIME_U64_ATTR_SHOW(phys_addr);
EFI_RUNTIME_U64_ATTR_SHOW(virt_addr);
EFI_RUNTIME_U64_ATTR_SHOW(num_pages);
EFI_RUNTIME_U64_ATTR_SHOW(attribute);
static inline struct efi_runtime_map_entry *to_map_entry(struct kobject *kobj)
{ … }
static ssize_t map_attr_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{ … }
static struct map_attribute map_type_attr = …;
static struct map_attribute map_phys_addr_attr = …;
static struct map_attribute map_virt_addr_attr = …;
static struct map_attribute map_num_pages_attr = …;
static struct map_attribute map_attribute_attr = …;
static struct attribute *def_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static const struct sysfs_ops map_attr_ops = …;
static void map_release(struct kobject *kobj)
{ … }
static const struct kobj_type __refconst map_ktype = …;
static struct kset *map_kset;
static struct efi_runtime_map_entry *
add_sysfs_runtime_map_entry(struct kobject *kobj, int nr,
efi_memory_desc_t *md)
{ … }
int efi_get_runtime_map_size(void)
{ … }
int efi_get_runtime_map_desc_size(void)
{ … }
int efi_runtime_map_copy(void *buf, size_t bufsz)
{ … }
static int __init efi_runtime_map_init(void)
{ … }
subsys_initcall_sync(efi_runtime_map_init);