arch/powerpc/kernel/rtas-proc.c

Source file repositories/reference/linux-study-clean/arch/powerpc/kernel/rtas-proc.c

File Facts

System
Linux kernel
Corpus path
arch/powerpc/kernel/rtas-proc.c
Extension
.c
Size
22315 bytes
Lines
770
Domain
Architecture Layer
Bucket
arch/powerpc
Inferred role
Architecture Layer: implementation source
Status
source implementation candidate

Why This File Exists

CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.

Dependency Surface

Detected Declarations

Annotated Snippet

struct individual_sensor {
	unsigned int token;
	unsigned int quant;
};

struct rtas_sensors {
        struct individual_sensor sensor[MAX_SENSORS];
	unsigned int quant;
};

/* Globals */
static struct rtas_sensors sensors;
static struct device_node *rtas_node = NULL;
static unsigned long power_on_time = 0; /* Save the time the user set */
static char progress_led[MAX_LINELENGTH];

static unsigned long rtas_tone_frequency = 1000;
static unsigned long rtas_tone_volume = 0;

/* ****************************************************************** */
/* Declarations */
static int ppc_rtas_sensors_show(struct seq_file *m, void *v);
static int ppc_rtas_clock_show(struct seq_file *m, void *v);
static ssize_t ppc_rtas_clock_write(struct file *file,
		const char __user *buf, size_t count, loff_t *ppos);
static int ppc_rtas_progress_show(struct seq_file *m, void *v);
static ssize_t ppc_rtas_progress_write(struct file *file,
		const char __user *buf, size_t count, loff_t *ppos);
static int ppc_rtas_poweron_show(struct seq_file *m, void *v);
static ssize_t ppc_rtas_poweron_write(struct file *file,
		const char __user *buf, size_t count, loff_t *ppos);

static ssize_t ppc_rtas_tone_freq_write(struct file *file,
		const char __user *buf, size_t count, loff_t *ppos);
static int ppc_rtas_tone_freq_show(struct seq_file *m, void *v);
static ssize_t ppc_rtas_tone_volume_write(struct file *file,
		const char __user *buf, size_t count, loff_t *ppos);
static int ppc_rtas_tone_volume_show(struct seq_file *m, void *v);
static int ppc_rtas_rmo_buf_show(struct seq_file *m, void *v);

static int poweron_open(struct inode *inode, struct file *file)
{
	return single_open(file, ppc_rtas_poweron_show, NULL);
}

static const struct proc_ops ppc_rtas_poweron_proc_ops = {
	.proc_open	= poweron_open,
	.proc_read	= seq_read,
	.proc_lseek	= seq_lseek,
	.proc_write	= ppc_rtas_poweron_write,
	.proc_release	= single_release,
};

static int progress_open(struct inode *inode, struct file *file)
{
	return single_open(file, ppc_rtas_progress_show, NULL);
}

static const struct proc_ops ppc_rtas_progress_proc_ops = {
	.proc_open	= progress_open,
	.proc_read	= seq_read,
	.proc_lseek	= seq_lseek,
	.proc_write	= ppc_rtas_progress_write,
	.proc_release	= single_release,
};

static int clock_open(struct inode *inode, struct file *file)
{
	return single_open(file, ppc_rtas_clock_show, NULL);
}

static const struct proc_ops ppc_rtas_clock_proc_ops = {
	.proc_open	= clock_open,
	.proc_read	= seq_read,
	.proc_lseek	= seq_lseek,
	.proc_write	= ppc_rtas_clock_write,
	.proc_release	= single_release,
};

static int tone_freq_open(struct inode *inode, struct file *file)
{
	return single_open(file, ppc_rtas_tone_freq_show, NULL);
}

static const struct proc_ops ppc_rtas_tone_freq_proc_ops = {
	.proc_open	= tone_freq_open,
	.proc_read	= seq_read,
	.proc_lseek	= seq_lseek,
	.proc_write	= ppc_rtas_tone_freq_write,
	.proc_release	= single_release,

Annotation

Implementation Notes