linux/kernel/module/sysfs.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Module sysfs support
 *
 * Copyright (C) 2008 Rusty Russell
 */

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
#include <linux/sysfs.h>
#include <linux/slab.h>
#include <linux/kallsyms.h>
#include <linux/mutex.h>
#include "internal.h"

/*
 * /sys/module/foo/sections stuff
 * J. Corbet <[email protected]>
 */
#ifdef CONFIG_KALLSYMS
struct module_sect_attr {};

struct module_sect_attrs {};

#define MODULE_SECT_READ_SIZE
static ssize_t module_sect_read(struct file *file, struct kobject *kobj,
				struct bin_attribute *battr,
				char *buf, loff_t pos, size_t count)
{}

static void free_sect_attrs(struct module_sect_attrs *sect_attrs)
{}

static void add_sect_attrs(struct module *mod, const struct load_info *info)
{}

static void remove_sect_attrs(struct module *mod)
{}

/*
 * /sys/module/foo/notes/.section.name gives contents of SHT_NOTE sections.
 */

struct module_notes_attrs {};

static void free_notes_attrs(struct module_notes_attrs *notes_attrs,
			     unsigned int i)
{}

static void add_notes_attrs(struct module *mod, const struct load_info *info)
{}

static void remove_notes_attrs(struct module *mod)
{}

#else /* !CONFIG_KALLSYMS */
static inline void add_sect_attrs(struct module *mod, const struct load_info *info) { }
static inline void remove_sect_attrs(struct module *mod) { }
static inline void add_notes_attrs(struct module *mod, const struct load_info *info) { }
static inline void remove_notes_attrs(struct module *mod) { }
#endif /* CONFIG_KALLSYMS */

static void del_usage_links(struct module *mod)
{}

static int add_usage_links(struct module *mod)
{}

static void module_remove_modinfo_attrs(struct module *mod, int end)
{}

static int module_add_modinfo_attrs(struct module *mod)
{}

static void mod_kobject_put(struct module *mod)
{}

static int mod_sysfs_init(struct module *mod)
{}

int mod_sysfs_setup(struct module *mod,
		    const struct load_info *info,
			   struct kernel_param *kparam,
			   unsigned int num_params)
{}

static void mod_sysfs_fini(struct module *mod)
{}

void mod_sysfs_teardown(struct module *mod)
{}

void init_param_lock(struct module *mod)
{}