diff options
Diffstat (limited to 'include/linux/wait.h')
-rw-r--r-- | include/linux/wait.h | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/include/linux/wait.h b/include/linux/wait.h index 90ffe7b3b..be24fa242 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -8,18 +8,25 @@ #ifdef __KERNEL__ +#include <asm/page.h> + struct wait_queue { struct task_struct * task; struct wait_queue * next; }; -struct semaphore { - int count; - struct wait_queue * wait; -}; +#define WAIT_QUEUE_HEAD(x) ((struct wait_queue *)((x)-1)) + +static inline void init_waitqueue(struct wait_queue **q) +{ + *q = WAIT_QUEUE_HEAD(q); +} -#define MUTEX ((struct semaphore) { 1, NULL }) -#define MUTEX_LOCKED ((struct semaphore) { 0, NULL }) +static inline int waitqueue_active(struct wait_queue **q) +{ + struct wait_queue *head = *q; + return head && head != WAIT_QUEUE_HEAD(q); +} struct select_table_entry { struct wait_queue wait; @@ -27,11 +34,11 @@ struct select_table_entry { }; typedef struct select_table_struct { - int nr; + unsigned int nr; struct select_table_entry * entry; } select_table; -#define __MAX_SELECT_TABLE_ENTRIES (4096 / sizeof (struct select_table_entry)) +#define __MAX_SELECT_TABLE_ENTRIES (PAGE_SIZE / sizeof (struct select_table_entry)) #endif /* __KERNEL__ */ |