From owner-svn-src-all@FreeBSD.ORG Sat Mar 7 18:23:34 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5F49FF26; Sat, 7 Mar 2015 18:23:34 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F9B71F5; Sat, 7 Mar 2015 18:23:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t27INYWA087222; Sat, 7 Mar 2015 18:23:34 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t27INXST087219; Sat, 7 Mar 2015 18:23:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201503071823.t27INXST087219@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 7 Mar 2015 18:23:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279728 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Mar 2015 18:23:34 -0000 Author: hselasky Date: Sat Mar 7 18:23:32 2015 New Revision: 279728 URL: https://svnweb.freebsd.org/changeset/base/279728 Log: Add mutex support to the pps_ioctl() API in the kernel. Bump kernel version to reflect structure change. PR: 196897 MFC after: 1 week Modified: head/sys/kern/kern_tc.c head/sys/sys/param.h head/sys/sys/timepps.h Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Sat Mar 7 18:17:15 2015 (r279727) +++ head/sys/kern/kern_tc.c Sat Mar 7 18:23:32 2015 (r279728) @@ -23,10 +23,8 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef FFCLOCK #include #include -#endif #include #include #include @@ -1498,7 +1496,10 @@ pps_fetch(struct pps_fetch_args *fapi, s cseq = pps->ppsinfo.clear_sequence; while (aseq == pps->ppsinfo.assert_sequence && cseq == pps->ppsinfo.clear_sequence) { - err = tsleep(pps, PCATCH, "ppsfch", timo); + if (pps->mtx != NULL) + err = msleep(pps, pps->mtx, PCATCH, "ppsfch", timo); + else + err = tsleep(pps, PCATCH, "ppsfch", timo); if (err == EWOULDBLOCK && fapi->timeout.tv_sec == -1) { continue; } else if (err != 0) { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Mar 7 18:17:15 2015 (r279727) +++ head/sys/sys/param.h Sat Mar 7 18:23:32 2015 (r279728) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100062 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100063 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/timepps.h ============================================================================== --- head/sys/sys/timepps.h Sat Mar 7 18:17:15 2015 (r279727) +++ head/sys/sys/timepps.h Sat Mar 7 18:23:32 2015 (r279728) @@ -133,6 +133,8 @@ struct pps_kcbind_args { #ifdef _KERNEL +struct mtx; + struct pps_state { /* Capture information. */ struct timehands *capth; @@ -140,6 +142,9 @@ struct pps_state { unsigned capgen; unsigned capcount; + /* pointer to mutex protecting this state, if any */ + struct mtx *mtx; + /* State information. */ pps_params_t ppsparam; pps_info_t ppsinfo;