patch-2.0.12 linux/arch/alpha/kernel/irq.c

Next file: linux/drivers/block/Makefile
Previous file: linux/arch/alpha/kernel/bios32.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.11/linux/arch/alpha/kernel/irq.c linux/arch/alpha/kernel/irq.c
@@ -32,6 +32,10 @@
 #  error Unable to handle more than 64 irq levels.
 #endif
 
+/* Reserved interrupts.  These must NEVER be requested by any driver!
+ */
+#define	IS_RESERVED_IRQ(irq)	((irq)==2)	/* IRQ 2 used by hw cascade */
+
 /*
  * Shadow-copy of masked interrupts.
  *  The bits are used as follows:
@@ -185,6 +189,8 @@
 
 	if (irq >= NR_IRQS)
 		return -EINVAL;
+	if (IS_RESERVED_IRQ(irq))
+		return -EINVAL;
 	if (!handler)
 		return -EINVAL;
 	p = irq_action + irq;
@@ -239,6 +245,10 @@
 
 	if (irq >= NR_IRQS) {
 		printk("Trying to free IRQ%d\n",irq);
+		return;
+	}
+	if (IS_RESERVED_IRQ(irq)) {
+		printk("Trying to free reserved IRQ %d\n", irq);
 		return;
 	}
 	for (p = irq + irq_action; (action = *p) != NULL; p = &action->next) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov