diff options
author | Dimitri Sivanich <sivanich@sgi.com> | 2010-03-12 01:08:56 +0300 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2010-03-24 16:10:03 +0300 |
commit | 92d6b71ab906be706f3679353b30a8d2c3831144 (patch) | |
tree | 2b82cc7f065f947f4a6430e0de3bc63a4870907d /kernel/irq/proc.c | |
parent | 220bf991b0366cc50a94feede3d7341fa5710ee4 (diff) | |
download | linux-92d6b71ab906be706f3679353b30a8d2c3831144.tar.xz |
genirq: Expose irq_desc->node in proc/irq
Expose irq_desc->node as /proc/irq/*/node.
This file provides device hardware locality information for apps
desiring to include hardware locality in irq mapping decisions.
Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq/proc.c')
-rw-r--r-- | kernel/irq/proc.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 6f50eccc79c0..e346e08f5c34 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c @@ -146,6 +146,26 @@ static const struct file_operations default_affinity_proc_fops = { .release = single_release, .write = default_affinity_write, }; + +static int irq_node_proc_show(struct seq_file *m, void *v) +{ + struct irq_desc *desc = irq_to_desc((long) m->private); + + seq_printf(m, "%d\n", desc->node); + return 0; +} + +static int irq_node_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, irq_node_proc_show, PDE(inode)->data); +} + +static const struct file_operations irq_node_proc_fops = { + .open = irq_node_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; #endif static int irq_spurious_proc_show(struct seq_file *m, void *v) @@ -230,6 +250,9 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc) /* create /proc/irq/<irq>/smp_affinity */ proc_create_data("smp_affinity", 0600, desc->dir, &irq_affinity_proc_fops, (void *)(long)irq); + + proc_create_data("node", 0444, desc->dir, + &irq_node_proc_fops, (void *)(long)irq); #endif proc_create_data("spurious", 0444, desc->dir, |