Rev 6102 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6102 | Rev 6125 | ||
---|---|---|---|
Line 246... | Line 246... | ||
246 | { |
246 | { |
247 | wait_queue_t *curr; |
247 | wait_queue_t *curr; |
248 | unsigned long flags; |
248 | unsigned long flags; |
Line 249... | Line 249... | ||
249 | 249 | ||
250 | spin_lock_irqsave(&q->lock, flags); |
250 | spin_lock_irqsave(&q->lock, flags); |
- | 251 | curr = list_first_entry_or_null(&q->task_list, typeof(*curr), task_list); |
|
251 | curr = list_first_entry(&q->task_list, typeof(*curr), task_list); |
252 | if(curr != NULL) |
252 | { |
253 | { |
- | 254 | if(!WARN_ON(curr->evnt.handle == 0)) |
|
253 | // printf("raise event \n"); |
255 | { |
254 | kevent_t event; |
256 | kevent_t event = {0}; |
255 | event.code = -1; |
257 | event.code = -1; |
256 | RaiseEvent(curr->evnt, 0, &event); |
258 | RaiseEvent(curr->evnt, 0, &event); |
- | 259 | } |
|
257 | } |
260 | } |
258 | spin_unlock_irqrestore(&q->lock, flags); |
261 | spin_unlock_irqrestore(&q->lock, flags); |
Line 259... | Line 262... | ||
259 | } |
262 | } |
260 | 263 | ||
261 | static inline |
264 | static inline |
262 | void wake_up_interruptible(wait_queue_head_t *q) |
265 | void wake_up_interruptible(wait_queue_head_t *q) |
263 | { |
266 | { |
Line 264... | Line 267... | ||
264 | wait_queue_t *curr; |
267 | wait_queue_t *curr; |
265 | unsigned long flags; |
268 | unsigned long flags; |
- | 269 | ||
- | 270 | spin_lock_irqsave(&q->lock, flags); |
|
- | 271 | curr = list_first_entry_or_null(&q->task_list, typeof(*curr), task_list); |
|
266 | 272 | if(curr != NULL) |
|
267 | spin_lock_irqsave(&q->lock, flags); |
- | |
268 | curr = list_first_entry(&q->task_list, typeof(*curr), task_list); |
273 | { |
269 | { |
274 | if(!WARN_ON(curr->evnt.handle == 0)) |
270 | // printf("raise event \n"); |
275 | { |
271 | kevent_t event; |
276 | kevent_t event = {0}; |
- | 277 | event.code = -1; |
|
272 | event.code = -1; |
278 | RaiseEvent(curr->evnt, 0, &event); |
273 | RaiseEvent(curr->evnt, 0, &event); |
279 | } |
Line 274... | Line 280... | ||
274 | } |
280 | } |
275 | spin_unlock_irqrestore(&q->lock, flags); |
281 | spin_unlock_irqrestore(&q->lock, flags); |
276 | } |
282 | } |
277 | 283 | ||
278 | static inline |
284 | static inline |
279 | void wake_up_all(wait_queue_head_t *q) |
- | |
280 | { |
285 | void wake_up_all(wait_queue_head_t *q) |
281 | wait_queue_t *curr; |
286 | { |
282 | unsigned long flags; |
287 | wait_queue_t *curr; |
- | 288 | unsigned long flags; |
|
283 | 289 | spin_lock_irqsave(&q->lock, flags); |
|
284 | spin_lock_irqsave(&q->lock, flags); |
290 | list_for_each_entry(curr, &q->task_list, task_list) |
285 | list_for_each_entry(curr, &q->task_list, task_list) |
291 | { |
286 | { |
292 | if(WARN_ON(curr->evnt.handle == 0)) |
287 | // printf("raise event \n"); |
293 | continue; |
288 | kevent_t event; |
294 | kevent_t event = {0}; |
289 | event.code = -1; |
295 | event.code = -1; |