patch-2.1.87 linux/arch/i386/kernel/irq.c

Next file: linux/arch/i386/kernel/smp.c
Previous file: linux/arch/i386/kernel/head.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.86/linux/arch/i386/kernel/irq.c linux/arch/i386/kernel/irq.c
@@ -570,22 +570,31 @@
 
 unsigned long __global_save_flags(void)
 {
-	return global_irq_holder == (unsigned char) smp_processor_id();
+	if (!local_irq_count[smp_processor_id()])
+		return global_irq_holder == (unsigned char) smp_processor_id();
+	else {
+		unsigned long x;
+		__save_flags(x);
+		return x;
+	}
 }
 
 void __global_restore_flags(unsigned long flags)
 {
-	switch (flags) {
-	case 0:
-		__global_sti();
-		break;
-	case 1:
-		__global_cli();
-		break;
-	default:
-		printk("global_restore_flags: %08lx (%08lx)\n",
-			flags, (&flags)[-1]);
-	}
+	if (!local_irq_count[smp_processor_id()]) {
+		switch (flags) {
+		case 0:
+			__global_sti();
+			break;
+		case 1:
+			__global_cli();
+			break;
+		default:
+			printk("global_restore_flags: %08lx (%08lx)\n",
+				flags, (&flags)[-1]);
+		}
+	} else
+		__restore_flags(flags);
 }
 
 #endif
@@ -707,10 +716,8 @@
 
 		irq_exit(cpu, irq);
 		__restore_flags(flags);
-	} else {
-		enable_IO_APIC_irq(irq);
+	} else
 		spin_unlock_irqrestore(&irq_controller_lock, flags);
-	}
 }
 #endif
 

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