VSF Documented
Data Structures | Macros | Typedefs | Functions
wait.h File Reference
#include "kernel/vsf_kernel.h"
#include <linux/spinlock.h>
#include <linux/list.h>

Go to the source code of this file.

Data Structures

struct  wait_queue_entry
 
struct  wait_queue_head
 

Macros

#define WQ_FLAG_EXCLUSIVE   0x01
 
#define WQ_FLAG_WOKEN   0x02
 
#define WQ_FLAG_BOOKMARK   0x04
 
#define WQ_FLAG_CUSTOM   0x08
 
#define WQ_FLAG_DONE   0x10
 
#define WQ_FLAG_PRIORITY   0x20
 
#define __wait_event_timeout(__wqh, __cond, __timeout)
 
#define wait_event_timeout(__wqh, __cond, __timeout)
 
#define wait_event(__wqh, __cond)   wait_event_timeout(__wqh, __cond, -1)
 
#define wake_up(__wqh)   wake_up_nr((__wqh), 1)
 
#define wake_up_all(__wqh)   wake_up_nr((__wqh), -1)
 

Typedefs

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

Functions

void init_wait_entry (struct wait_queue_entry *wqe, int flags)
 
void prepare_to_wait (struct wait_queue_head *wqh, struct wait_queue_entry *wqe, int state)
 
bool prepare_to_wait_exclusive (struct wait_queue_head *wqh, struct wait_queue_entry *wqe, int state)
 
long prepare_to_wait_event (struct wait_queue_head *wqh, struct wait_queue_entry *wqe, int state)
 
void finish_wait (struct wait_queue_head *wqh, struct wait_queue_entry *wqe)
 
long wait_woken (struct wait_queue_entry *wqe, unsigned mode, long timeout)
 
int woken_wake_function (struct wait_queue_entry *wqe, unsigned mode, int sync, void *key)
 
int autoremove_wake_function (struct wait_queue_entry *wqe, unsigned mode, int sync, void *key)
 
void wake_up_nr (struct wait_queue_head *wqh, int nr)
 

Macro Definition Documentation

◆ WQ_FLAG_EXCLUSIVE

#define WQ_FLAG_EXCLUSIVE   0x01

◆ WQ_FLAG_WOKEN

#define WQ_FLAG_WOKEN   0x02

◆ WQ_FLAG_BOOKMARK

#define WQ_FLAG_BOOKMARK   0x04

◆ WQ_FLAG_CUSTOM

#define WQ_FLAG_CUSTOM   0x08

◆ WQ_FLAG_DONE

#define WQ_FLAG_DONE   0x10

◆ WQ_FLAG_PRIORITY

#define WQ_FLAG_PRIORITY   0x20

◆ __wait_event_timeout

#define __wait_event_timeout (   __wqh,
  __cond,
  __timeout 
)
Value:
({ \
struct wait_queue_entry __wqe; \
long local_timeout = (__timeout); \
vsf_trig_t trig; \
vsf_eda_trig_init(&trig, false, true); \
__wqe.__trig = &trig; \
init_wait_entry(&__wqe, 0); \
while (1) { \
prepare_to_wait_event(&__wqh, &__wqe, 0); \
if (__cond) { \
break; \
} \
vsf_thread_trig_pend(&trig, local_timeout); \
} \
finish_wait(&__wqh, &__wqe); \
local_timeout; \
})
Definition vsf_eda.h:864
Definition wait.h:22

◆ wait_event_timeout

#define wait_event_timeout (   __wqh,
  __cond,
  __timeout 
)
Value:
({ \
long local_timeout = (__timeout); \
bool local_cond = (__cond); \
if (local_cond && !local_timeout) { \
local_timeout = 1; \
} \
if (!(local_cond || !local_timeout)) { \
local_timeout = __wait_event_timeout(__wqh, __cond, __timeout); \
} \
local_timeout; \
})
#define __wait_event_timeout(__wqh, __cond, __timeout)
Definition wait.h:50

◆ wait_event

#define wait_event (   __wqh,
  __cond 
)    wait_event_timeout(__wqh, __cond, -1)

◆ wake_up

#define wake_up (   __wqh)    wake_up_nr((__wqh), 1)

◆ wake_up_all

#define wake_up_all (   __wqh)    wake_up_nr((__wqh), -1)

Typedef Documentation

◆ wait_queue_func_t

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

◆ wait_queue_entry_t

◆ wait_queue_head_t

Function Documentation

◆ init_wait_entry()

void init_wait_entry ( struct wait_queue_entry wqe,
int  flags 
)
extern

◆ prepare_to_wait()

void prepare_to_wait ( struct wait_queue_head wqh,
struct wait_queue_entry wqe,
int  state 
)
extern

◆ prepare_to_wait_exclusive()

bool prepare_to_wait_exclusive ( struct wait_queue_head wqh,
struct wait_queue_entry wqe,
int  state 
)
extern

◆ prepare_to_wait_event()

long prepare_to_wait_event ( struct wait_queue_head wqh,
struct wait_queue_entry wqe,
int  state 
)
extern

◆ finish_wait()

void finish_wait ( struct wait_queue_head wqh,
struct wait_queue_entry wqe 
)
extern

◆ wait_woken()

long wait_woken ( struct wait_queue_entry wqe,
unsigned  mode,
long  timeout 
)
extern

◆ woken_wake_function()

int woken_wake_function ( struct wait_queue_entry wqe,
unsigned  mode,
int  sync,
void *  key 
)
extern

◆ autoremove_wake_function()

int autoremove_wake_function ( struct wait_queue_entry wqe,
unsigned  mode,
int  sync,
void *  key 
)
extern

◆ wake_up_nr()

void wake_up_nr ( struct wait_queue_head wqh,
int  nr 
)
extern