summaryrefslogtreecommitdiffstats
path: root/include/linux/tqueue.h
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
committer <ralf@linux-mips.org>1997-04-29 21:13:14 +0000
commit19c9bba94152148523ba0f7ef7cffe3d45656b11 (patch)
tree40b1cb534496a7f1ca0f5c314a523c69f1fee464 /include/linux/tqueue.h
parent7206675c40394c78a90e74812bbdbf8cf3cca1be (diff)
Import of Linux/MIPS 2.1.36
Diffstat (limited to 'include/linux/tqueue.h')
-rw-r--r--include/linux/tqueue.h37
1 files changed, 5 insertions, 32 deletions
diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h
index 8bd4e7f30..acebad9f2 100644
--- a/include/linux/tqueue.h
+++ b/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 @@ extern task_queue tq_timer, tq_immediate, tq_scheduler, tq_disk;
* 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);
}
}