From owner-svn-src-stable-11@freebsd.org Tue Mar 13 16:30:02 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED66EF2F548; Tue, 13 Mar 2018 16:30:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A66F86F44; Tue, 13 Mar 2018 16:30:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 955AD1C2F4; Tue, 13 Mar 2018 16:30:01 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2DGU1Wl005715; Tue, 13 Mar 2018 16:30:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2DGU1Rn005713; Tue, 13 Mar 2018 16:30:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803131630.w2DGU1Rn005713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 13 Mar 2018 16:30:01 +0000 (UTC) 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 X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 330861 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Mar 2018 16:30:02 -0000 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 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) {