Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2017 15:47:30 +0000 (UTC)
From:      Dmitry Chagin <dchagin@FreeBSD.org>
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
Message-ID:  <201703251547.v2PFlUpf056924@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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