22 static int show_irq_affinity(
int type,
struct seq_file *
m,
void *
v)
27 #ifdef CONFIG_GENERIC_PENDING_IRQ
28 if (irqd_is_setaffinity_pending(&desc->
irq_data))
29 mask = desc->pending_mask;
32 seq_cpumask_list(m, mask);
39 static int irq_affinity_hint_proc_show(
struct seq_file *m,
void *v)
49 if (desc->affinity_hint)
50 cpumask_copy(mask, desc->affinity_hint);
55 free_cpumask_var(mask);
60 #ifndef is_affinity_mask_valid
61 #define is_affinity_mask_valid(val) 1
65 static int irq_affinity_proc_show(
struct seq_file *m,
void *v)
67 return show_irq_affinity(0, m, v);
70 static int irq_affinity_list_proc_show(
struct seq_file *m,
void *v)
72 return show_irq_affinity(1, m, v);
79 unsigned int irq = (
int)(
long)PDE(file->
f_path.dentry->d_inode)->data;
83 if (!irq_can_set_affinity(irq) || no_irq_affinity)
86 if (!alloc_cpumask_var(&new_value,
GFP_KERNEL))
90 err = cpumask_parselist_user(buffer, count, new_value);
92 err = cpumask_parse_user(buffer, count, new_value);
106 if (!cpumask_intersects(new_value, cpu_online_mask)) {
111 irq_set_affinity(irq, new_value);
116 free_cpumask_var(new_value);
120 static ssize_t irq_affinity_proc_write(
struct file *file,
121 const char __user *buffer,
size_t count, loff_t *pos)
123 return write_irq_affinity(0, file, buffer, count, pos);
126 static ssize_t irq_affinity_list_proc_write(
struct file *file,
127 const char __user *buffer,
size_t count, loff_t *pos)
129 return write_irq_affinity(1, file, buffer, count, pos);
132 static int irq_affinity_proc_open(
struct inode *
inode,
struct file *file)
137 static int irq_affinity_list_proc_open(
struct inode *inode,
struct file *file)
139 return single_open(file, irq_affinity_list_proc_show, PDE(inode)->
data);
142 static int irq_affinity_hint_proc_open(
struct inode *inode,
struct file *file)
144 return single_open(file, irq_affinity_hint_proc_show, PDE(inode)->
data);
148 .
open = irq_affinity_proc_open,
152 .write = irq_affinity_proc_write,
156 .
open = irq_affinity_hint_proc_open,
163 .
open = irq_affinity_list_proc_open,
167 .write = irq_affinity_list_proc_write,
170 static int default_affinity_show(
struct seq_file *m,
void *v)
172 seq_cpumask(m, irq_default_affinity);
177 static ssize_t default_affinity_write(
struct file *file,
178 const char __user *buffer,
size_t count, loff_t *ppos)
183 if (!alloc_cpumask_var(&new_value,
GFP_KERNEL))
186 err = cpumask_parse_user(buffer, count, new_value);
200 if (!cpumask_intersects(new_value, cpu_online_mask)) {
205 cpumask_copy(irq_default_affinity, new_value);
209 free_cpumask_var(new_value);
213 static int default_affinity_open(
struct inode *inode,
struct file *file)
219 .
open = default_affinity_open,
223 .write = default_affinity_write,
226 static int irq_node_proc_show(
struct seq_file *m,
void *v)
234 static int irq_node_proc_open(
struct inode *inode,
struct file *file)
240 .
open = irq_node_proc_open,
247 static int irq_spurious_proc_show(
struct seq_file *m,
void *v)
251 seq_printf(m,
"count %u\n" "unhandled %u\n" "last_unhandled %u ms\n",
257 static int irq_spurious_proc_open(
struct inode *inode,
struct file *file)
263 .open = irq_spurious_proc_open,
269 #define MAX_NAMELEN 128
271 static int name_unique(
unsigned int irq,
struct irqaction *new_action)
279 for (action = desc->
action ; action; action = action->
next) {
280 if ((action != new_action) && action->
name &&
295 if (!desc->dir || action->
dir || !action->
name ||
296 !name_unique(irq, action))
308 #define MAX_NAMELEN 10
328 &irq_affinity_proc_fops, (
void *)(
long)irq);
332 &irq_affinity_hint_proc_fops, (
void *)(
long)irq);
336 &irq_affinity_list_proc_fops, (
void *)(
long)irq);
339 &irq_node_proc_fops, (
void *)(
long)irq);
343 &irq_spurious_proc_fops, (
void *)(
long)irq);
350 if (!root_irq_dir || !desc->dir)
376 static void register_default_affinity_proc(
void)
379 proc_create(
"irq/default_smp_affinity", 0600,
NULL,
380 &default_affinity_proc_fops);
394 register_default_affinity_proc();
407 #ifdef CONFIG_GENERIC_IRQ_SHOW
414 #ifndef ACTUAL_NR_IRQS
415 # define ACTUAL_NR_IRQS nr_irqs
422 unsigned long flags, any_count = 0;
423 int i = *(loff_t *) v,
j;
435 for (prec = 3,
j = 1000; prec < 10 &&
j <=
nr_irqs; ++prec)
451 action = desc->action;
452 if (!action && !any_count)
460 if (desc->
irq_data.chip->irq_print_chip)
469 #ifdef CONFIG_GENERIC_IRQ_SHOW_LEVEL
477 while ((action = action->next) !=
NULL)