diff options
Diffstat (limited to 'include/linux/tqueue.h')
-rw-r--r-- | include/linux/tqueue.h | 37 |
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); } } |