patch-2.1.30 linux/include/linux/tqueue.h

Next file: linux/include/net/addrconf.h
Previous file: linux/include/linux/sysctl.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.29/linux/include/linux/tqueue.h linux/include/linux/tqueue.h
@@ -15,6 +15,7 @@
 
 #include <asm/bitops.h>
 #include <asm/system.h>
+#include <asm/spinlock.h>
 
 /*
  * New proposed "bottom half" handlers:
@@ -74,48 +75,20 @@
  * interrupt.
  */
 
-/*
- * queue_task_irq: put the bottom half handler "bh_pointer" on the list
- * "bh_list".  You may call this function only from an interrupt
- * handler or a bottom half handler.
- */
-extern __inline__ void queue_task_irq(struct tq_struct *bh_pointer,
-			       task_queue *bh_list)
-{
-	if (!set_bit(0,&bh_pointer->sync)) {
-		bh_pointer->next = *bh_list;
-		*bh_list = bh_pointer;
-	}
-}
-
-/*
- * queue_task_irq_off: put the bottom half handler "bh_pointer" on the list
- * "bh_list".  You may call this function only when interrupts are off.
- */
-extern __inline__ void queue_task_irq_off(struct tq_struct *bh_pointer,
-				 task_queue *bh_list)
-{
-	if (!(bh_pointer->sync & 1)) {
-		bh_pointer->sync = 1;
-		bh_pointer->next = *bh_list;
-		*bh_list = bh_pointer;
-	}
-}
-
+extern spinlock_t tqueue_lock;
 
 /*
- * queue_task: as queue_task_irq, but can be called from anywhere.
+ * queue_task
  */
 extern __inline__ void queue_task(struct tq_struct *bh_pointer,
 			   task_queue *bh_list)
 {
 	if (!set_bit(0,&bh_pointer->sync)) {
 		unsigned long flags;
-		save_flags(flags);
-		cli();
+		spin_lock_irqsave(&tqueue_lock, flags);
 		bh_pointer->next = *bh_list;
 		*bh_list = bh_pointer;
-		restore_flags(flags);
+		spin_unlock_irqrestore(&tqueue_lock, flags);
 	}
 }
 

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