Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Mar 2018 16:30:01 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r330861 - in stable/11/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201803131630.w2DGU1Rn005713@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Tue Mar 13 16:30:01 2018
New Revision: 330861
URL: https://svnweb.freebsd.org/changeset/base/330861

Log:
  MFC r330395:
  Implement DEFINE_WAIT_FUNC() function macro and default_wake_function()
  in the LinuxKPI.
  
  Submitted by:	Johannes Lundberg <johalun0@gmail.com>
  Sponsored by:	Mellanox Technologies
  Sponsored by:	Limelight Networks

Modified:
  stable/11/sys/compat/linuxkpi/common/include/linux/wait.h
  stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/include/linux/wait.h	Tue Mar 13 16:29:02 2018	(r330860)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/wait.h	Tue Mar 13 16:30:01 2018	(r330861)
@@ -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: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c	Tue Mar 13 16:29:02 2018	(r330860)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c	Tue Mar 13 16:30:01 2018	(r330861)
@@ -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?201803131630.w2DGU1Rn005713>