cpu_relax();
}
+EXPORT_SYMBOL(synchronize_irq);
+
#endif /* CONFIG_SMP */
/* XXX Make this into free_irq() - Anton */
* This function may be called from IRQ context.
*/
- void disable_irq_nosync(unsigned int irq)
+inline void disable_irq_nosync(unsigned int irq)
{
irq_desc_t *desc = irq_desc + irq;
unsigned long flags;
spin_unlock_irqrestore(&desc->lock, flags);
}
+EXPORT_SYMBOL(disable_irq_nosync);
+
/**
* disable_irq - disable an irq and wait for completion
* @irq: Interrupt to disable
synchronize_irq(irq);
}
+EXPORT_SYMBOL(disable_irq);
+
/**
* enable_irq - enable interrupt handling on an irq
* @irq: Interrupt to enable
desc->depth--;
break;
case 0:
- printk("enable_irq(%u) unbalanced\n", irq);
+ printk("enable_irq(%u) unbalanced from %p\n", irq,
+ __builtin_return_address(0));
}
spin_unlock_irqrestore(&desc->lock, flags);
}
+EXPORT_SYMBOL(enable_irq);
+
int show_interrupts(struct seq_file *p, void *v)
{
int i, j;
static unsigned int parse_hex_value (const char *buffer,
unsigned long count, cpumask_t *ret)
{
- unsigned char hexnum [HEX_DIGITS];
+ unsigned char hexnum[HEX_DIGITS];
cpumask_t value = CPU_MASK_NONE;
int i;
return -EFAULT;
/*
- * Parse the first 16 characters as a hex string, any non-hex char
+ * Parse the first HEX_DIGITS characters as a hex string, any non-hex char
* is end-of-string. '00e1', 'e1', '00E1', 'E1' are all the same.
*/
for (k = 0; k < 4; ++k)
if (test_bit(k, (unsigned long *)&c))
cpu_set(k, value);
-
}
out:
*ret = value;
return -EIO;
err = parse_hex_value(buffer, count, &new_value);
+ if (err)
+ return err;
/*
* Do not allow disabling IRQs completely - it's a too easy
return sprintf (page, "%08lx\n", *mask);
}
-static int prof_cpu_mask_write_proc (struct file *file, const char *buffer,
+static int prof_cpu_mask_write_proc (struct file *file, const char __user *buffer,
unsigned long count, void *data)
{
cpumask_t *mask = (cpumask_t *)data;
/* create /proc/irq/1234/smp_affinity */
entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
- entry->nlink = 1;
- entry->data = (void *)(long)irq;
- entry->read_proc = irq_affinity_read_proc;
- entry->write_proc = irq_affinity_write_proc;
+ if (entry) {
+ entry->nlink = 1;
+ entry->data = (void *)(long)irq;
+ entry->read_proc = irq_affinity_read_proc;
+ entry->write_proc = irq_affinity_write_proc;
+ }
smp_affinity_entry[irq] = entry;
}
/* create /proc/irq/prof_cpu_mask */
entry = create_proc_entry("prof_cpu_mask", 0600, root_irq_dir);
+ if (!entry)
+ return;
+
entry->nlink = 1;
entry->data = (void *)&prof_cpu_mask;
entry->read_proc = prof_cpu_mask_read_proc;