From owner-svn-src-head@freebsd.org Mon Oct 19 10:56:33 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B81ABA18253; Mon, 19 Oct 2015 10:56:33 +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 mx1.freebsd.org (Postfix) with ESMTPS id 794401CC0; Mon, 19 Oct 2015 10:56:33 +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 t9JAuWvR052022; Mon, 19 Oct 2015 10:56:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9JAuWhF052021; Mon, 19 Oct 2015 10:56:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201510191056.t9JAuWhF052021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 19 Oct 2015 10:56:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r289565 - head/sys/ofed/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Oct 2015 10:56:33 -0000 Author: hselasky Date: Mon Oct 19 10:56:32 2015 New Revision: 289565 URL: https://svnweb.freebsd.org/changeset/base/289565 Log: Merge LinuxKPI changes from DragonflyBSD: - Implement pagefault_disable() and pagefault_enable(). Sponsored by: Mellanox Technologies Modified: head/sys/ofed/include/linux/uaccess.h Modified: head/sys/ofed/include/linux/uaccess.h ============================================================================== --- head/sys/ofed/include/linux/uaccess.h Mon Oct 19 10:54:24 2015 (r289564) +++ head/sys/ofed/include/linux/uaccess.h Mon Oct 19 10:56:32 2015 (r289565) @@ -2,7 +2,8 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2015 François Tigeot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,4 +33,14 @@ #define get_user(_x, _p) -copyin((_p), &(_x), sizeof(*(_p))) #define put_user(_x, _p) -copyout(&(_x), (_p), sizeof(*(_p))) +static inline void pagefault_disable(void) +{ + curthread_pflags_set(TDP_NOFAULTING | TDP_RESETSPUR); +} + +static inline void pagefault_enable(void) +{ + curthread_pflags_restore(~(TDP_NOFAULTING | TDP_RESETSPUR)); +} + #endif /* _LINUX_UACCESS_H_ */