Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 Mar 2018 18:51:43 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r330395 - in head/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201803041851.w24IphJG006857@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sun Mar  4 18:51:43 2018
New Revision: 330395
URL: https://svnweb.freebsd.org/changeset/base/330395

Log:
  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

Modified:
  head/sys/compat/linuxkpi/common/include/linux/wait.h
  head/sys/compat/linuxkpi/common/src/linux_schedule.c

Modified: head/sys/compat/linuxkpi/common/include/linux/wait.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/wait.h	Sun Mar  4 18:27:50 2018	(r330394)
+++ head/sys/compat/linuxkpi/common/include/linux/wait.h	Sun Mar  4 18:51:43 2018	(r330395)
@@ -76,13 +76,17 @@ 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 = {						\

Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_schedule.c	Sun Mar  4 18:27:50 2018	(r330394)
+++ head/sys/compat/linuxkpi/common/src/linux_schedule.c	Sun Mar  4 18:51:43 2018	(r330395)
@@ -176,6 +176,13 @@ autoremove_wake_function(wait_queue_t *wq, unsigned in
 	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)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803041851.w24IphJG006857>