linux/kernel/module/procfs.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Module proc support
 *
 * Copyright (C) 2008 Alexey Dobriyan
 */

#include <linux/module.h>
#include <linux/kallsyms.h>
#include <linux/mutex.h>
#include <linux/seq_file.h>
#include <linux/proc_fs.h>
#include "internal.h"

#ifdef CONFIG_MODULE_UNLOAD
static inline void print_unload_info(struct seq_file *m, struct module *mod)
{}
#else /* !CONFIG_MODULE_UNLOAD */
static inline void print_unload_info(struct seq_file *m, struct module *mod)
{
	/* We don't know the usage count, or what modules are using. */
	seq_puts(m, " - -");
}
#endif /* CONFIG_MODULE_UNLOAD */

/* Called by the /proc file system to return a list of modules. */
static void *m_start(struct seq_file *m, loff_t *pos)
{}

static void *m_next(struct seq_file *m, void *p, loff_t *pos)
{}

static void m_stop(struct seq_file *m, void *p)
{}

static unsigned int module_total_size(struct module *mod)
{}

static int m_show(struct seq_file *m, void *p)
{}

/*
 * Format: modulename size refcount deps address
 *
 * Where refcount is a number or -, and deps is a comma-separated list
 * of depends or -.
 */
static const struct seq_operations modules_op =;

/*
 * This also sets the "private" pointer to non-NULL if the
 * kernel pointers should be hidden (so you can just test
 * "m->private" to see if you should keep the values private).
 *
 * We use the same logic as for /proc/kallsyms.
 */
static int modules_open(struct inode *inode, struct file *file)
{}

static const struct proc_ops modules_proc_ops =;

static int __init proc_modules_init(void)
{}
module_init();