From owner-svn-src-head@freebsd.org Sat Mar 25 15:47:31 2017 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 BF7DFD1D0FB; Sat, 25 Mar 2017 15:47:31 +0000 (UTC) (envelope-from dchagin@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 7206C1481; Sat, 25 Mar 2017 15:47:31 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2PFlUjJ056928; Sat, 25 Mar 2017 15:47:30 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2PFlUpf056924; Sat, 25 Mar 2017 15:47:30 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201703251547.v2PFlUpf056924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sat, 25 Mar 2017 15:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r315957 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/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.23 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: Sat, 25 Mar 2017 15:47:31 -0000 Author: dchagin Date: Sat Mar 25 15:47:29 2017 New Revision: 315957 URL: https://svnweb.freebsd.org/changeset/base/315957 Log: Implement Linux mincore() system call. This is necessary for the upcoming drm-next. Suggested by: hselasky@ MFC after: 1 month Modified: head/sys/amd64/linux/linux_dummy.c head/sys/amd64/linux32/linux32_dummy.c head/sys/compat/linux/linux_misc.c head/sys/i386/linux/linux_dummy.c Modified: head/sys/amd64/linux/linux_dummy.c ============================================================================== --- head/sys/amd64/linux/linux_dummy.c Sat Mar 25 15:06:28 2017 (r315956) +++ head/sys/amd64/linux/linux_dummy.c Sat Mar 25 15:47:29 2017 (r315957) @@ -59,7 +59,6 @@ UNIMPLEMENTED(tuxcall); UNIMPLEMENTED(uselib); UNIMPLEMENTED(vserver); -DUMMY(mincore); DUMMY(sendfile); DUMMY(syslog); DUMMY(setfsuid); Modified: head/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- head/sys/amd64/linux32/linux32_dummy.c Sat Mar 25 15:06:28 2017 (r315956) +++ head/sys/amd64/linux32/linux32_dummy.c Sat Mar 25 15:47:29 2017 (r315957) @@ -79,7 +79,6 @@ DUMMY(sendfile); DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); -DUMMY(mincore); DUMMY(ptrace); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sat Mar 25 15:06:28 2017 (r315956) +++ head/sys/compat/linux/linux_misc.c Sat Mar 25 15:47:29 2017 (r315957) @@ -2534,3 +2534,17 @@ linux_getrandom(struct thread *td, struc return (read_random_uio(&uio, args->flags & LINUX_GRND_NONBLOCK)); } + +int +linux_mincore(struct thread *td, struct linux_mincore_args *args) +{ + struct mincore_args bsd_args; + + /* Needs to be page-aligned */ + if (args->start & PAGE_MASK) + return (EINVAL); + bsd_args.addr = PTRIN(args->start); + bsd_args.len = args->len; + bsd_args.vec = args->vec; + return (sys_mincore(td, &bsd_args)); +} Modified: head/sys/i386/linux/linux_dummy.c ============================================================================== --- head/sys/i386/linux/linux_dummy.c Sat Mar 25 15:06:28 2017 (r315956) +++ head/sys/i386/linux/linux_dummy.c Sat Mar 25 15:47:29 2017 (r315957) @@ -82,7 +82,6 @@ DUMMY(sendfile); /* different semantics DUMMY(setfsuid); DUMMY(setfsgid); DUMMY(pivot_root); -DUMMY(mincore); DUMMY(lookup_dcookie); DUMMY(remap_file_pages); DUMMY(mbind);