diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1997-01-07 02:33:00 +0000 |
---|---|---|
committer | <ralf@linux-mips.org> | 1997-01-07 02:33:00 +0000 |
commit | beb116954b9b7f3bb56412b2494b562f02b864b1 (patch) | |
tree | 120e997879884e1b9d93b265221b939d2ef1ade1 /include/linux/tqueue.h | |
parent | 908d4681a1dc3792ecafbe64265783a86c4cccb6 (diff) |
Import of Linux/MIPS 2.1.14
Diffstat (limited to 'include/linux/tqueue.h')
-rw-r--r-- | include/linux/tqueue.h | 60 |
1 files changed, 20 insertions, 40 deletions
diff --git a/include/linux/tqueue.h b/include/linux/tqueue.h index a5a15173a..8bd4e7f30 100644 --- a/include/linux/tqueue.h +++ b/include/linux/tqueue.h @@ -16,12 +16,6 @@ #include <asm/bitops.h> #include <asm/system.h> -#ifdef INCLUDE_INLINE_FUNCS -#define _INLINE_ extern -#else -#define _INLINE_ extern __inline__ -#endif - /* * New proposed "bottom half" handlers: * (C) 1994 Kai Petzke, wpp@marie.physik.tu-berlin.de @@ -54,22 +48,15 @@ struct tq_struct { typedef struct tq_struct * task_queue; -#define DECLARE_TASK_QUEUE(q) task_queue q = &tq_last - -extern struct tq_struct tq_last; -extern task_queue tq_timer, tq_immediate, tq_scheduler; +#define DECLARE_TASK_QUEUE(q) task_queue q = NULL -#ifdef INCLUDE_INLINE_FUNCS -struct tq_struct tq_last = { - &tq_last, 0, 0, 0 -}; -#endif +extern task_queue tq_timer, tq_immediate, tq_scheduler, tq_disk; /* * To implement your own list of active bottom halfs, use the following * two definitions: * - * struct tq_struct *my_bh = &tq_last; + * struct tq_struct *my_bh = NULL; * struct tq_struct run_my_bh = { * 0, 0, (void *)(void *) run_task_queue, &my_bh * }; @@ -92,7 +79,7 @@ struct tq_struct tq_last = { * "bh_list". You may call this function only from an interrupt * handler or a bottom half handler. */ -_INLINE_ void queue_task_irq(struct tq_struct *bh_pointer, +extern __inline__ void queue_task_irq(struct tq_struct *bh_pointer, task_queue *bh_list) { if (!set_bit(0,&bh_pointer->sync)) { @@ -105,7 +92,7 @@ _INLINE_ void queue_task_irq(struct tq_struct *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. */ -_INLINE_ void queue_task_irq_off(struct tq_struct *bh_pointer, +extern __inline__ void queue_task_irq_off(struct tq_struct *bh_pointer, task_queue *bh_list) { if (!(bh_pointer->sync & 1)) { @@ -119,7 +106,7 @@ _INLINE_ void queue_task_irq_off(struct tq_struct *bh_pointer, /* * queue_task: as queue_task_irq, but can be called from anywhere. */ -_INLINE_ void queue_task(struct tq_struct *bh_pointer, +extern __inline__ void queue_task(struct tq_struct *bh_pointer, task_queue *bh_list) { if (!set_bit(0,&bh_pointer->sync)) { @@ -135,29 +122,22 @@ _INLINE_ void queue_task(struct tq_struct *bh_pointer, /* * Call all "bottom halfs" on a given list. */ -_INLINE_ void run_task_queue(task_queue *list) +extern __inline__ void run_task_queue(task_queue *list) { - register struct tq_struct *save_p; - register struct tq_struct *p; - void *arg; - void (*f) (void *); - - while(1) { - p = xchg_ptr(list,&tq_last); - if(p == &tq_last) - break; - - do { - arg = p -> data; - f = p -> routine; - save_p = p -> next; - p -> sync = 0; - (*f)(arg); - p = save_p; - } while(p != &tq_last); + struct tq_struct *p; + + p = xchg(list,NULL); + while (p) { + void *arg; + void (*f) (void *); + struct tq_struct *save_p; + arg = p -> data; + f = p -> routine; + save_p = p; + p = p -> next; + save_p -> sync = 0; + (*f)(arg); } } -#undef _INLINE_ - #endif /* _LINUX_TQUEUE_H */ |