2017-11-01 15:07:57 +01:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2017-11-15 02:13:40 +01:00
|
|
|
#include <linux/cpufreq.h>
|
2008-10-04 23:40:23 +04:00
|
|
|
#include <linux/fs.h>
|
|
|
|
|
#include <linux/init.h>
|
|
|
|
|
#include <linux/proc_fs.h>
|
|
|
|
|
#include <linux/seq_file.h>
|
|
|
|
|
|
|
|
|
|
extern const struct seq_operations cpuinfo_op;
|
2022-04-15 21:20:02 +02:00
|
|
|
|
2008-10-04 23:40:23 +04:00
|
|
|
static int cpuinfo_open(struct inode *inode, struct file *file)
|
|
|
|
|
{
|
|
|
|
|
return seq_open(file, &cpuinfo_op);
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-03 17:37:17 -08:00
|
|
|
static const struct proc_ops cpuinfo_proc_ops = {
|
2020-04-06 20:09:01 -07:00
|
|
|
.proc_flags = PROC_ENTRY_PERMANENT,
|
2020-02-03 17:37:17 -08:00
|
|
|
.proc_open = cpuinfo_open,
|
2020-11-04 09:27:35 +01:00
|
|
|
.proc_read_iter = seq_read_iter,
|
2020-02-03 17:37:17 -08:00
|
|
|
.proc_lseek = seq_lseek,
|
|
|
|
|
.proc_release = seq_release,
|
2008-10-04 23:40:23 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static int __init proc_cpuinfo_init(void)
|
|
|
|
|
{
|
2020-02-03 17:37:17 -08:00
|
|
|
proc_create("cpuinfo", 0, NULL, &cpuinfo_proc_ops);
|
2008-10-04 23:40:23 +04:00
|
|
|
return 0;
|
|
|
|
|
}
|
2014-01-23 15:55:45 -08:00
|
|
|
fs_initcall(proc_cpuinfo_init);
|