dde_linux: '__wait_event()' fix

Fixes #2054
This commit is contained in:
Christian Prochaska 2016-08-09 14:26:31 +02:00 committed by Christian Helmuth
parent 1776babbd1
commit 4949f3abba
3 changed files with 10 additions and 9 deletions

View File

@ -68,13 +68,13 @@ void wake_up_interruptible_sync_poll(wait_queue_head_t *wq, int)
}
void __wait_event(wait_queue_head_t wq)
void ___wait_event(wait_queue_head_t *wq)
{
Wait_list *list = static_cast<Wait_list *>(wq.list);
Wait_list *list = static_cast<Wait_list *>(wq->list);
if (!list) {
PWRN("__wait_event():dd empty list in wq: %p", &wq);
init_waitqueue_head(&wq);
list = static_cast<Wait_list *>(wq.list);
PWRN("__wait_event(): empty list in wq: %p", wq);
init_waitqueue_head(wq);
list = static_cast<Wait_list *>(wq->list);
}
Lx::Task *task = Lx::scheduler().current();

View File

@ -186,8 +186,9 @@ void add_wait_queue_exclusive(wait_queue_head_t *, wait_queue_t *);
void remove_wait_queue(wait_queue_head_t *, wait_queue_t *);
/* our wait event implementation - it's okay as value */
void __wait_event(wait_queue_head_t);
void ___wait_event(wait_queue_head_t*);
#define __wait_event(wq) ___wait_event(&wq)
#define _wait_event(wq, condition) while (!(condition)) { __wait_event(wq); }
#define wait_event(wq, condition) ({ _wait_event(wq, condition); })
#define wait_event_interruptible(wq, condition) ({ _wait_event(wq, condition); 0; })

View File

@ -287,7 +287,7 @@ struct Timeout : Genode::Signal_dispatcher<Timeout>
};
static void __wait_event(signed long timeout)
static void wait_for_timeout(signed long timeout)
{
static Timer::Connection timer;
Timeout to(timer, timeout);
@ -307,7 +307,7 @@ long schedule_timeout_uninterruptible(signed long timeout)
signed long schedule_timeout(signed long timeout)
{
long start = jiffies;
__wait_event(timeout);
wait_for_timeout(timeout);
timeout -= jiffies - start;
return timeout < 0 ? 0 : timeout;
}
@ -315,7 +315,7 @@ signed long schedule_timeout(signed long timeout)
void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)
{
__wait_event(0);
wait_for_timeout(0);
}