diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/workqueue.h | 17 | ||||
-rw-r--r-- | include/litmus/litmus_softirq.h | 24 |
2 files changed, 40 insertions, 1 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 25e02c941bac..a5c6cd3210be 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -83,6 +83,9 @@ struct work_struct { | |||
83 | #ifdef CONFIG_LOCKDEP | 83 | #ifdef CONFIG_LOCKDEP |
84 | struct lockdep_map lockdep_map; | 84 | struct lockdep_map lockdep_map; |
85 | #endif | 85 | #endif |
86 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
87 | struct task_struct *owner; | ||
88 | #endif | ||
86 | }; | 89 | }; |
87 | 90 | ||
88 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(WORK_STRUCT_NO_CPU) | 91 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(WORK_STRUCT_NO_CPU) |
@@ -115,11 +118,25 @@ struct execute_work { | |||
115 | #define __WORK_INIT_LOCKDEP_MAP(n, k) | 118 | #define __WORK_INIT_LOCKDEP_MAP(n, k) |
116 | #endif | 119 | #endif |
117 | 120 | ||
121 | #ifdef CONFIG_LITMUS_SOFTIRQD | ||
122 | #define __WORK_INIT_OWNER() \ | ||
123 | .owner = NULL, | ||
124 | |||
125 | #define PREPARE_OWNER(_work, _owner) \ | ||
126 | do { \ | ||
127 | (_work)->owner = (_owner); \ | ||
128 | } while(0) | ||
129 | #else | ||
130 | #define __WORK_INIT_OWNER() | ||
131 | #define PREPARE_OWNER(_work, _owner) | ||
132 | #endif | ||
133 | |||
118 | #define __WORK_INITIALIZER(n, f) { \ | 134 | #define __WORK_INITIALIZER(n, f) { \ |
119 | .data = WORK_DATA_STATIC_INIT(), \ | 135 | .data = WORK_DATA_STATIC_INIT(), \ |
120 | .entry = { &(n).entry, &(n).entry }, \ | 136 | .entry = { &(n).entry, &(n).entry }, \ |
121 | .func = (f), \ | 137 | .func = (f), \ |
122 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ | 138 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ |
139 | __WORK_INIT_OWNER() \ | ||
123 | } | 140 | } |
124 | 141 | ||
125 | #define __DELAYED_WORK_INITIALIZER(n, f) { \ | 142 | #define __DELAYED_WORK_INITIALIZER(n, f) { \ |
diff --git a/include/litmus/litmus_softirq.h b/include/litmus/litmus_softirq.h index 712c8119ae15..e130a26685a2 100644 --- a/include/litmus/litmus_softirq.h +++ b/include/litmus/litmus_softirq.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __LITMUS_SOFTIRQ_H | 2 | #define __LITMUS_SOFTIRQ_H |
3 | 3 | ||
4 | #include <linux/interrupt.h> | 4 | #include <linux/interrupt.h> |
5 | #include <linux/workqueue.h> | ||
5 | 6 | ||
6 | /* | 7 | /* |
7 | Threaded tasklet handling for Litmus. Tasklets | 8 | Threaded tasklet handling for Litmus. Tasklets |
@@ -105,4 +106,25 @@ static inline void litmus_tasklet_hi_schedule_first( | |||
105 | __litmus_tasklet_hi_schedule_first(t, k_id); | 106 | __litmus_tasklet_hi_schedule_first(t, k_id); |
106 | } | 107 | } |
107 | 108 | ||
108 | #endif \ No newline at end of file | 109 | ////////////// |
110 | |||
111 | extern void __litmus_schedule_work( | ||
112 | struct work_struct* w, | ||
113 | unsigned int k_id); | ||
114 | |||
115 | static inline void litmus_schedule_work( | ||
116 | struct work_struct* w, | ||
117 | unsigned int k_id) | ||
118 | { | ||
119 | __litmus_schedule_work(w, k_id); | ||
120 | } | ||
121 | |||
122 | #endif | ||
123 | |||
124 | |||
125 | |||
126 | |||
127 | |||
128 | |||
129 | |||
130 | |||