Changeset 125
- Timestamp:
- Jun 10, 2007, 10:14:08 AM (18 years ago)
- Location:
- GPL/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/include/sound/compat_22.h
r118 r125 380 380 #define up_write(x) up(x) 381 381 382 /* this is identical with tq_struct but the "routine" field is renamed to "func" */383 struct tasklet_struct {384 struct tasklet_struct *next; /* linked list of active bh's */385 unsigned long sync; /* must be initialized to zero */386 void (*func)(void *); /* function to call */387 void *data; /* argument to function */388 };389 390 #define tasklet_init(t,f,d) do { \391 (t)->next = NULL; \392 (t)->sync = 0; \393 (t)->func = (void (*)(void *))(f); \394 (t)->data = (void *)(d); \395 } while (0)396 397 382 #define tasklet_unlock_wait(t) while (test_bit(0, &(t)->sync)) { } 398 383 #define tasklet_kill(t) tasklet_unlock_wait(t) /* FIXME: world is not perfect... */ -
GPL/trunk/include/linux/interrupt.h
r32 r125 50 50 ISICOM_BH 51 51 }; 52 /* Tasklets --- multithreaded analogue of BHs. 53 54 Main feature differing them of generic softirqs: tasklet 55 is running only on one CPU simultaneously. 56 57 Main feature differing them of BHs: different tasklets 58 may be run simultaneously on different CPUs. 59 60 Properties: 61 * If tasklet_schedule() is called, then tasklet is guaranteed 62 to be executed on some cpu at least once after this. 63 * If the tasklet is already scheduled, but its excecution is still not 64 started, it will be executed only once. 65 * If this tasklet is already running on another CPU (or schedule is called 66 from tasklet itself), it is rescheduled for later. 67 * Tasklet is strictly serialized wrt itself, but not 68 wrt another tasklets. If client needs some intertask synchronization, 69 he makes it with spinlocks. 70 */ 71 72 struct tasklet_struct 73 { 74 struct tasklet_struct *next; 75 unsigned long state; 76 atomic_t count; 77 void (*func)(unsigned long); 78 unsigned long data; 79 }; 80 81 extern void tasklet_hi_schedule(struct tasklet_struct *t); 82 83 extern void tasklet_init(struct tasklet_struct *t, 84 void (*func)(unsigned long), unsigned long data); 52 85 53 86 /* -
GPL/trunk/lib32/task.c
r32 r125 27 27 #include <linux/fs.h> 28 28 #include <linux/tqueue.h> 29 #include <linux/interrupt.h> 29 30 #define LINUX 30 31 #include <ossdefos2.h> … … 33 34 struct task_struct *current = ¤t_task; 34 35 35 void tasklet_hi_schedule(struct t q_struct *t)36 void tasklet_hi_schedule(struct tasklet_struct *t) 36 37 { 37 if(t && t-> routine) {38 t-> routine(t->data);38 if(t && t->func) { 39 t->func(t->data); 39 40 } 41 } 42 43 void tasklet_init(struct tasklet_struct *t, 44 void (*func)(unsigned long), unsigned long data) 45 { 46 t->next = NULL; 47 t->state = 0; 48 t->func = func; 49 t->data = data; 40 50 } 41 51
Note:
See TracChangeset
for help on using the changeset viewer.