Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jun 2018 06:47:49 +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: r335423 - in stable/11/sys/compat/linuxkpi/common: include/linux src
Message-ID:  <201806200647.w5K6lnt4026282@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Wed Jun 20 06:47:49 2018
New Revision: 335423
URL: https://svnweb.freebsd.org/changeset/base/335423

Log:
  MFC r334713:
  Implement the init_wait_entry() function macro 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	Wed Jun 20 06:46:54 2018	(r335422)
+++ stable/11/sys/compat/linuxkpi/common/include/linux/wait.h	Wed Jun 20 06:47:49 2018	(r335423)
@@ -106,8 +106,11 @@ extern wait_queue_func_t default_wake_function;
 	INIT_LIST_HEAD(&(wqh)->task_list);				\
 } while (0)
 
+void linux_init_wait_entry(wait_queue_t *, int);
 void linux_wake_up(wait_queue_head_t *, unsigned int, int, bool);
 
+#define	init_wait_entry(wq, flags)					\
+        linux_init_wait_entry(wq, flags)
 #define	wake_up(wqh)							\
 	linux_wake_up(wqh, TASK_NORMAL, 1, false)
 #define	wake_up_all(wqh)						\

Modified: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c
==============================================================================
--- stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c	Wed Jun 20 06:46:54 2018	(r335422)
+++ stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c	Wed Jun 20 06:47:49 2018	(r335423)
@@ -188,6 +188,17 @@ default_wake_function(wait_queue_t *wq, unsigned int s
 }
 
 void
+linux_init_wait_entry(wait_queue_t *wq, int flags)
+{
+
+	memset(wq, 0, sizeof(*wq));
+	wq->flags = flags;
+	wq->private = current;
+	wq->func = autoremove_wake_function;
+	INIT_LIST_HEAD(&wq->task_list);
+}
+
+void
 linux_wake_up(wait_queue_head_t *wqh, unsigned int state, int nr, bool locked)
 {
 	wait_queue_t *pos, *next;



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