XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions
wait.h File Reference
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/poll.h>
#include <linux/sched.h>
Include dependency graph for wait.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wait_queue_entry
 
struct  wait_queue_head
 

Macros

#define WQ_FLAG_EXCLUSIVE   0x01
 
#define WQ_FLAG_WOKEN   0x02
 
#define DCL_WAIT_EVENT_MS   5000
 
#define DECLARE_WAIT_QUEUE_HEAD(name)    struct wait_queue_head name = { 0, LIST_HEAD_INIT(name.head) }
 
#define INIT_WAIT_QUEUE_HEAD(name)   init_waitqueue_head(&(name))
 
#define __WAITQUEUE_INITIALIZER(name, tsk)
 
#define DECLARE_WAITQUEUE(name, tsk)    struct wait_queue_entry name = __WAITQUEUE_INITIALIZER(name, tsk)
 
#define DEFINE_WAIT_FUNC(name, function)
 
#define wake_up(x)   __wake_up((x), TASK_NORMAL, 1, 0)
 
#define wake_up_all(x)   __wake_up((x), TASK_NORMAL, 0, 0)
 
#define wake_up_interruptible(x)   __wake_up((x), TASK_INTERRUPTIBLE, 1, 0)
 
#define wake_up_interruptible_all(x)   __wake_up((x), TASK_INTERRUPTIBLE, 0, 0)
 
#define wake_up_interruptible_sync(x)   __wake_up((x), TASK_INTERRUPTIBLE, 1, 0)
 
#define wake_up_poll(x, m)    __wake_up((x), TASK_NORMAL, 1, (void*)(uintptr_t)(m))
 
#define wake_up_interruptible_poll(x, m)    __wake_up((x), TASK_INTERRUPTIBLE, 1, (void*)(uintptr_t)(m))
 
#define wake_up_interruptible_sync_poll(x, m)    __wake_up((x), TASK_INTERRUPTIBLE, 1, (void*)(uintptr_t)(m))
 
#define _dcl_wait_core(wq_head, condition)
 
#define wait_event(wq_head, condition)
 
#define wait_event_interruptible(wq_head, condition)
 
#define wait_event_interruptible_timeout(wq_head, condition, timeout)
 
#define wait_event_timeout(wq_head, condition, timeout)
 
#define wait_event_lock_irq(wq_head, condition, lock)
 
#define DEFINE_WAIT(name)    struct wait_queue_entry name = __WAITQUEUE_INITIALIZER(name, current)
 
#define wait_event_freezable(wq_head, condition)
 

Typedefs

typedef int(* wait_queue_func_t) (struct wait_queue_entry *wq_entry, unsigned mode, int flags, void *key)
 
typedef struct wait_queue_head wait_queue_head_t
 

Functions

int default_wake_function (struct wait_queue_entry *wq_entry, unsigned mode, int flags, void *key)
 
int woken_wake_function (struct wait_queue_entry *wq_entry, unsigned mode, int flags, void *key)
 
void add_wait_queue (struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
 
void remove_wait_queue (struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry)
 
void __wake_up (struct wait_queue_head *wq_head, unsigned int mode, int nr_exclusive, void *key)
 
unsigned int wait_woken (struct wait_queue_entry *wq_entry, unsigned int state, long timeout)
 
void dcl_wait_event_timeout (const char *func)
 
void dcl_wait_pump (void)
 

Macro Definition Documentation

◆ __WAITQUEUE_INITIALIZER

#define __WAITQUEUE_INITIALIZER (   name,
  tsk 
)
Value:
{ \
.private = (tsk), \
.entry = LIST_HEAD_INIT((name).entry), \
}
#define LIST_HEAD_INIT(name)
Definition list.h:15
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition drm_crtc.h:1242
void(* entry)(void *)
Definition process.h:101
int default_wake_function(struct wait_queue_entry *wq_entry, unsigned mode, int flags, void *key)

◆ _dcl_wait_core

#define _dcl_wait_core (   wq_head,
  condition 
)
Value:
({ \
unsigned int _dcl_i = DCL_WAIT_EVENT_MS; \
int _dcl_ok; \
(void)(wq_head); \
while (!(condition) && _dcl_i) { \
_dcl_i--; \
dcl_wait_pump(); \
mdelay(1); \
} \
_dcl_ok = !!(condition); \
if (!_dcl_ok) \
dcl_wait_event_timeout(__func__); \
_dcl_ok; \
})
#define DCL_WAIT_EVENT_MS
Definition wait.h:93

◆ DCL_WAIT_EVENT_MS

#define DCL_WAIT_EVENT_MS   5000

◆ DECLARE_WAIT_QUEUE_HEAD

#define DECLARE_WAIT_QUEUE_HEAD (   name)     struct wait_queue_head name = { 0, LIST_HEAD_INIT(name.head) }

◆ DECLARE_WAITQUEUE

#define DECLARE_WAITQUEUE (   name,
  tsk 
)     struct wait_queue_entry name = __WAITQUEUE_INITIALIZER(name, tsk)

◆ DEFINE_WAIT

#define DEFINE_WAIT (   name)     struct wait_queue_entry name = __WAITQUEUE_INITIALIZER(name, current)

◆ DEFINE_WAIT_FUNC

#define DEFINE_WAIT_FUNC (   name,
  function 
)
Value:
struct wait_queue_entry name = { \
.private = current, \
.func = (function), \
.entry = LIST_HEAD_INIT((name).entry), \
}
#define current
Definition mm.h:90
Definition wait.h:68

◆ INIT_WAIT_QUEUE_HEAD

#define INIT_WAIT_QUEUE_HEAD (   name)    init_waitqueue_head(&(name))

◆ wait_event

#define wait_event (   wq_head,
  condition 
)
Value:
do { \
(void)_dcl_wait_core(wq_head, condition); \
} while (0)
#define _dcl_wait_core(wq_head, condition)
Definition wait.h:219

◆ wait_event_freezable

#define wait_event_freezable (   wq_head,
  condition 
)
Value:
({ \
_dcl_wait_core(wq_head, condition) \
? 0 : -ERESTARTSYS; \
})
#define ERESTARTSYS
Definition kernel.h:302

◆ wait_event_interruptible

#define wait_event_interruptible (   wq_head,
  condition 
)
Value:
({ \
_dcl_wait_core(wq_head, condition) \
? 0 : -ERESTARTSYS; \
})

◆ wait_event_interruptible_timeout

#define wait_event_interruptible_timeout (   wq_head,
  condition,
  timeout 
)
Value:
({ \
long _dcl_t = (timeout); \
_dcl_wait_core(wq_head, condition) \
? _dcl_t : 0; \
})

◆ wait_event_lock_irq

#define wait_event_lock_irq (   wq_head,
  condition,
  lock 
)
Value:
do { \
(void)(lock); \
(void)_dcl_wait_core(wq_head, condition); \
} while (0)

◆ wait_event_timeout

#define wait_event_timeout (   wq_head,
  condition,
  timeout 
)
Value:
({ \
long _dcl_t = (timeout); \
_dcl_wait_core(wq_head, condition) \
? _dcl_t : 0; \
})

◆ wake_up

#define wake_up (   x)    __wake_up((x), TASK_NORMAL, 1, 0)

◆ wake_up_all

#define wake_up_all (   x)    __wake_up((x), TASK_NORMAL, 0, 0)

◆ wake_up_interruptible

#define wake_up_interruptible (   x)    __wake_up((x), TASK_INTERRUPTIBLE, 1, 0)

◆ wake_up_interruptible_all

#define wake_up_interruptible_all (   x)    __wake_up((x), TASK_INTERRUPTIBLE, 0, 0)

◆ wake_up_interruptible_poll

#define wake_up_interruptible_poll (   x,
  m 
)     __wake_up((x), TASK_INTERRUPTIBLE, 1, (void*)(uintptr_t)(m))

◆ wake_up_interruptible_sync

#define wake_up_interruptible_sync (   x)    __wake_up((x), TASK_INTERRUPTIBLE, 1, 0)

◆ wake_up_interruptible_sync_poll

#define wake_up_interruptible_sync_poll (   x,
  m 
)     __wake_up((x), TASK_INTERRUPTIBLE, 1, (void*)(uintptr_t)(m))

◆ wake_up_poll

#define wake_up_poll (   x,
  m 
)     __wake_up((x), TASK_NORMAL, 1, (void*)(uintptr_t)(m))

◆ WQ_FLAG_EXCLUSIVE

#define WQ_FLAG_EXCLUSIVE   0x01

◆ WQ_FLAG_WOKEN

#define WQ_FLAG_WOKEN   0x02

Typedef Documentation

◆ wait_queue_func_t

typedef int(* wait_queue_func_t) (struct wait_queue_entry *wq_entry, unsigned mode, int flags, void *key)

◆ wait_queue_head_t

Function Documentation

◆ __wake_up()

void __wake_up ( struct wait_queue_head *  wq_head,
unsigned int  mode,
int  nr_exclusive,
void *  key 
)

◆ add_wait_queue()

void add_wait_queue ( struct wait_queue_head *  wq_head,
struct wait_queue_entry *  wq_entry 
)

◆ dcl_wait_event_timeout()

void dcl_wait_event_timeout ( const char *  func)

◆ dcl_wait_pump()

void dcl_wait_pump ( void  )

◆ default_wake_function()

int default_wake_function ( struct wait_queue_entry *  wq_entry,
unsigned  mode,
int  flags,
void *  key 
)

◆ remove_wait_queue()

void remove_wait_queue ( struct wait_queue_head *  wq_head,
struct wait_queue_entry *  wq_entry 
)

◆ wait_woken()

unsigned int wait_woken ( struct wait_queue_entry *  wq_entry,
unsigned int  state,
long  timeout 
)

◆ woken_wake_function()

int woken_wake_function ( struct wait_queue_entry *  wq_entry,
unsigned  mode,
int  flags,
void *  key 
)