patch-2.1.28 linux/kernel/sched.c

Next file: linux/net/core/sock.c
Previous file: linux/include/net/udp.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.27/linux/kernel/sched.c linux/kernel/sched.c
@@ -274,6 +274,25 @@
 	return weight;
 }
 
+void allow_interrupts(void)
+{
+#if defined(__SMP__) && defined(__i386__)
+/* UGH UGH UGH. Damn broken IRQ handling test-fix for x86.. */
+	int this_cpu=smp_processor_id();
+	int lock_depth = current_set[this_cpu]->lock_depth;
+	if (lock_depth) {
+		cli();
+		current_set[this_cpu]->lock_depth = 0;
+		active_kernel_processor = NO_PROC_ID;
+		__asm__ __volatile__("lock ; btrl    $0, kernel_flag");
+		sti();
+		/* interrupts should work here */
+		lock_kernel();
+		current_set[this_cpu]->lock_depth += lock_depth-1;
+	}
+#endif
+}		
+
 /*
  *  'schedule()' is the scheduler function. It's a very simple and nice
  * scheduler: it's not perfect, but certainly works for most things.
@@ -293,7 +312,7 @@
 	int this_cpu=smp_processor_id();
 
 /* check alarm, wake up any interruptible tasks that have got a signal */
-
+	allow_interrupts();
 	lock_kernel();
 	if (intr_count)
 		goto scheduling_in_interrupt;

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