Implement DEFINE_WAIT_FUNC() function macro and default_wake_function()

in the LinuxKPI.

MFC after:	1 week
Submitted by:	Johannes Lundberg <johalun0@gmail.com>
Sponsored by:	Mellanox Technologies
Sponsored by:	Limelight Networks
This commit is contained in:
Hans Petter Selasky 2018-03-04 18:51:43 +00:00
parent ab7da72090
commit 8f368d485d
2 changed files with 13 additions and 2 deletions

View file

@ -76,14 +76,18 @@ struct wait_queue_head {
* renamed and furthermore must be the default wait queue callback.
*/
extern wait_queue_func_t autoremove_wake_function;
extern wait_queue_func_t default_wake_function;
#define DEFINE_WAIT(name) \
#define DEFINE_WAIT_FUNC(name, function) \
wait_queue_t name = { \
.private = current, \
.func = autoremove_wake_function, \
.func = function, \
.task_list = LINUX_LIST_HEAD_INIT(name.task_list) \
}
#define DEFINE_WAIT(name) \
DEFINE_WAIT_FUNC(name, autoremove_wake_function)
#define DECLARE_WAITQUEUE(name, task) \
wait_queue_t name = { \
.private = task, \

View file

@ -176,6 +176,13 @@ autoremove_wake_function(wait_queue_t *wq, unsigned int state, int flags,
return (ret);
}
int
default_wake_function(wait_queue_t *wq, unsigned int state, int flags,
void *key __unused)
{
return (wake_up_task(wq->private, state));
}
void
linux_wake_up(wait_queue_head_t *wqh, unsigned int state, int nr, bool locked)
{