[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Fri Mar 2 15:39:57 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/5d2e717af825
changeset: 399:5d2e717af825
user:      ray at terran.dlink.ua
date:      Fri Mar 02 17:16:32 2012 +0200
description:
Update to FreeBSD-HEAD @232391

diffstat:

 head/sys/compat/freebsd32/freebsd32_signal.h |   3 +-
 head/sys/compat/linprocfs/linprocfs.c        |   4 +-
 head/sys/compat/linsysfs/linsysfs.c          |   4 +-
 head/sys/compat/linux/linux_misc.c           |  36 ++++++++++-----------------
 head/sys/compat/linux/linux_stats.c          |   8 +++---
 head/sys/compat/linux/linux_util.c           |   4 +-
 head/sys/compat/linux/linux_util.h           |   4 +-
 head/sys/compat/ndis/subr_ndis.c             |   5 ++-
 head/sys/compat/svr4/imgact_svr4.c           |  28 ++++++++-------------
 9 files changed, 41 insertions(+), 55 deletions(-)

diffs (294 lines):

diff -r 8bf40f27aa20 -r 5d2e717af825 head/sys/compat/freebsd32/freebsd32_signal.h
--- a/head/sys/compat/freebsd32/freebsd32_signal.h	Fri Mar 02 17:16:20 2012 +0200
+++ b/head/sys/compat/freebsd32/freebsd32_signal.h	Fri Mar 02 17:16:32 2012 +0200
@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD$
+ * $FreeBSD: head/sys/compat/freebsd32/freebsd32_signal.h 231006 2012-02-05 04:49:31Z davidxu $
  */
 
 #ifndef _COMPAT_FREEBSD32_SIGNAL_H_
@@ -92,6 +92,7 @@
 			uint32_t _function;
 			uint32_t _attribute;
 		} _sigev_thread;
+		unsigned short	_kevent_flags;
 		uint32_t __spare__[8];
 	} _sigev_un;
 };
diff -r 8bf40f27aa20 -r 5d2e717af825 head/sys/compat/linprocfs/linprocfs.c
--- a/head/sys/compat/linprocfs/linprocfs.c	Fri Mar 02 17:16:20 2012 +0200
+++ b/head/sys/compat/linprocfs/linprocfs.c	Fri Mar 02 17:16:32 2012 +0200
@@ -42,7 +42,7 @@
 #include "opt_compat.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/compat/linprocfs/linprocfs.c 230145 2012-01-15 18:47:24Z trociny $");
+__FBSDID("$FreeBSD: head/sys/compat/linprocfs/linprocfs.c 232278 2012-02-29 00:30:18Z mm $");
 
 #include <sys/param.h>
 #include <sys/queue.h>
@@ -1460,7 +1460,7 @@
 	return (0);
 }
 
-PSEUDOFS(linprocfs, 1);
+PSEUDOFS(linprocfs, 1, 0);
 MODULE_DEPEND(linprocfs, linux, 1, 1, 1);
 MODULE_DEPEND(linprocfs, procfs, 1, 1, 1);
 MODULE_DEPEND(linprocfs, sysvmsg, 1, 1, 1);
diff -r 8bf40f27aa20 -r 5d2e717af825 head/sys/compat/linsysfs/linsysfs.c
--- a/head/sys/compat/linsysfs/linsysfs.c	Fri Mar 02 17:16:20 2012 +0200
+++ b/head/sys/compat/linsysfs/linsysfs.c	Fri Mar 02 17:16:32 2012 +0200
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/sys/compat/linsysfs/linsysfs.c 232278 2012-02-29 00:30:18Z mm $");
 
 #include <sys/param.h>
 #include <sys/queue.h>
@@ -280,5 +280,5 @@
 	return (0);
 }
 
-PSEUDOFS(linsysfs, 1);
+PSEUDOFS(linsysfs, 1, 0);
 MODULE_DEPEND(linsysfs, linux, 1, 1, 1);
diff -r 8bf40f27aa20 -r 5d2e717af825 head/sys/compat/linux/linux_misc.c
--- a/head/sys/compat/linux/linux_misc.c	Fri Mar 02 17:16:20 2012 +0200
+++ b/head/sys/compat/linux/linux_misc.c	Fri Mar 02 17:16:32 2012 +0200
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 230132 2012-01-15 13:23:18Z uqs $");
+__FBSDID("$FreeBSD: head/sys/compat/linux/linux_misc.c 231885 2012-02-17 23:47:16Z kib $");
 
 #include "opt_compat.h"
 
@@ -229,9 +229,9 @@
 	struct vattr attr;
 	vm_offset_t vmaddr;
 	unsigned long file_offset;
-	vm_offset_t buffer;
 	unsigned long bss_size;
 	char *library;
+	ssize_t aresid;
 	int error;
 	int locked, vfslocked;
 
@@ -308,8 +308,8 @@
 	if (error)
 		goto cleanup;
 
-	/* Pull in executable header into kernel_map */
-	error = vm_mmap(kernel_map, (vm_offset_t *)&a_out, PAGE_SIZE,
+	/* Pull in executable header into exec_map */
+	error = vm_mmap(exec_map, (vm_offset_t *)&a_out, PAGE_SIZE,
 	    VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp, 0);
 	if (error)
 		goto cleanup;
@@ -402,24 +402,15 @@
 		if (error)
 			goto cleanup;
 
-		/* map file into kernel_map */
-		error = vm_mmap(kernel_map, &buffer,
-		    round_page(a_out->a_text + a_out->a_data + file_offset),
-		    VM_PROT_READ, VM_PROT_READ, 0, OBJT_VNODE, vp,
-		    trunc_page(file_offset));
-		if (error)
+		error = vn_rdwr(UIO_READ, vp, (void *)vmaddr, file_offset,
+		    a_out->a_text + a_out->a_data, UIO_USERSPACE, 0,
+		    td->td_ucred, NOCRED, &aresid, td);
+		if (error != 0)
 			goto cleanup;
-
-		/* copy from kernel VM space to user space */
-		error = copyout(PTRIN(buffer + file_offset),
-		    (void *)vmaddr, a_out->a_text + a_out->a_data);
-
-		/* release temporary kernel space */
-		vm_map_remove(kernel_map, buffer, buffer +
-		    round_page(a_out->a_text + a_out->a_data + file_offset));
-
-		if (error)
+		if (aresid != 0) {
+			error = ENOEXEC;
 			goto cleanup;
+		}
 	} else {
 #ifdef DEBUG
 		printf("uselib: Page aligned binary %lu\n", file_offset);
@@ -463,10 +454,9 @@
 		VFS_UNLOCK_GIANT(vfslocked);
 	}
 
-	/* Release the kernel mapping. */
+	/* Release the temporary mapping. */
 	if (a_out)
-		vm_map_remove(kernel_map, (vm_offset_t)a_out,
-		    (vm_offset_t)a_out + PAGE_SIZE);
+		kmem_free_wakeup(exec_map, (vm_offset_t)a_out, PAGE_SIZE);
 
 	return (error);
 }
diff -r 8bf40f27aa20 -r 5d2e717af825 head/sys/compat/linux/linux_stats.c
--- a/head/sys/compat/linux/linux_stats.c	Fri Mar 02 17:16:20 2012 +0200
+++ b/head/sys/compat/linux/linux_stats.c	Fri Mar 02 17:16:32 2012 +0200
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/compat/linux/linux_stats.c 230132 2012-01-15 13:23:18Z uqs $");
+__FBSDID("$FreeBSD: head/sys/compat/linux/linux_stats.c 231378 2012-02-10 12:35:57Z ed $");
 
 #include "opt_compat.h"
 
@@ -66,7 +66,7 @@
 	int major, minor;
 
 	if (vp->v_type == VCHR && vp->v_rdev != NULL &&
-	    linux_driver_get_major_minor(vp->v_rdev->si_name,
+	    linux_driver_get_major_minor(devtoname(vp->v_rdev),
 	    &major, &minor) == 0) {
 		sb->st_rdev = (major << 8 | minor);
 	}
@@ -149,14 +149,14 @@
 		return;
 	vp = fp->f_vnode;
 	if (vp != NULL && vp->v_rdev != NULL &&
-	    linux_driver_get_major_minor(vp->v_rdev->si_name,
+	    linux_driver_get_major_minor(devtoname(vp->v_rdev),
 					 &major, &minor) == 0) {
 		buf->st_rdev = (major << 8 | minor);
 	} else if (fp->f_type == DTYPE_PTS) {
 		struct tty *tp = fp->f_data;
 
 		/* Convert the numbers for the slave device. */
-		if (linux_driver_get_major_minor(tp->t_dev->si_name,
+		if (linux_driver_get_major_minor(devtoname(tp->t_dev),
 					 &major, &minor) == 0) {
 			buf->st_rdev = (major << 8 | minor);
 		}
diff -r 8bf40f27aa20 -r 5d2e717af825 head/sys/compat/linux/linux_util.c
--- a/head/sys/compat/linux/linux_util.c	Fri Mar 02 17:16:20 2012 +0200
+++ b/head/sys/compat/linux/linux_util.c	Fri Mar 02 17:16:32 2012 +0200
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/sys/compat/linux/linux_util.c 231378 2012-02-10 12:35:57Z ed $");
 
 #include "opt_compat.h"
 
@@ -124,7 +124,7 @@
 }
 
 int
-linux_driver_get_major_minor(char *node, int *major, int *minor)
+linux_driver_get_major_minor(const char *node, int *major, int *minor)
 {
 	struct device_element *de;
 
diff -r 8bf40f27aa20 -r 5d2e717af825 head/sys/compat/linux/linux_util.h
--- a/head/sys/compat/linux/linux_util.h	Fri Mar 02 17:16:20 2012 +0200
+++ b/head/sys/compat/linux/linux_util.h	Fri Mar 02 17:16:32 2012 +0200
@@ -28,7 +28,7 @@
  *
  * from: svr4_util.h,v 1.5 1994/11/18 02:54:31 christos Exp
  * from: linux_util.h,v 1.2 1995/03/05 23:23:50 fvdl Exp
- * $FreeBSD$
+ * $FreeBSD: head/sys/compat/linux/linux_util.h 231378 2012-02-10 12:35:57Z ed $
  */
 
 #ifndef	_LINUX_UTIL_H_
@@ -97,7 +97,7 @@
 int	linux_device_register_handler(struct linux_device_handler *h);
 int	linux_device_unregister_handler(struct linux_device_handler *h);
 char	*linux_driver_get_name_dev(device_t dev);
-int	linux_driver_get_major_minor(char *node, int *major, int *minor);
+int	linux_driver_get_major_minor(const char *node, int *major, int *minor);
 char	*linux_get_char_devices(void);
 void	linux_free_get_char_devices(char *string);
 
diff -r 8bf40f27aa20 -r 5d2e717af825 head/sys/compat/ndis/subr_ndis.c
--- a/head/sys/compat/ndis/subr_ndis.c	Fri Mar 02 17:16:20 2012 +0200
+++ b/head/sys/compat/ndis/subr_ndis.c	Fri Mar 02 17:16:32 2012 +0200
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
+__FBSDID("$FreeBSD: head/sys/compat/ndis/subr_ndis.c 231949 2012-02-21 01:05:12Z kib $");
 
 /*
  * This file implements a translation layer between the BSD networking
@@ -2862,7 +2862,8 @@
 	struct thread		*td = curthread;
 	linker_file_t		lf;
 	caddr_t			kldstart;
-	int			error, resid, vfslocked;
+	int			error, vfslocked;
+	ssize_t			resid;
 	struct vnode		*vp;
 
 	if (filehandle == NULL) {
diff -r 8bf40f27aa20 -r 5d2e717af825 head/sys/compat/svr4/imgact_svr4.c
--- a/head/sys/compat/svr4/imgact_svr4.c	Fri Mar 02 17:16:20 2012 +0200
+++ b/head/sys/compat/svr4/imgact_svr4.c	Fri Mar 02 17:16:32 2012 +0200
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/compat/svr4/imgact_svr4.c 230132 2012-01-15 13:23:18Z uqs $");
+__FBSDID("$FreeBSD: head/sys/compat/svr4/imgact_svr4.c 231885 2012-02-17 23:47:16Z kib $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,8 +66,8 @@
     struct vmspace *vmspace;
     vm_offset_t vmaddr;
     unsigned long virtual_offset, file_offset;
-    vm_offset_t buffer;
     unsigned long bss_size;
+    ssize_t aresid;
     int error;
 
     if (((a_out->a_magic >> 16) & 0xff) != 0x64)
@@ -145,21 +145,15 @@
 	if (error)
 	    goto fail;
 
-	error = vm_mmap(kernel_map, &buffer,
-			round_page(a_out->a_text + a_out->a_data + file_offset),
-			VM_PROT_READ, VM_PROT_READ, 0,
-			OBJT_VNODE, imgp->vp, trunc_page(file_offset));
-	if (error)
-	    goto fail;
-
-	error = copyout((caddr_t)(buffer + file_offset), (caddr_t)vmaddr, 
-			a_out->a_text + a_out->a_data);
-
-	vm_map_remove(kernel_map, buffer,
-		      buffer + round_page(a_out->a_text + a_out->a_data + file_offset));
-
-	if (error)
-	    goto fail;
+	error = vn_rdwr(UIO_READ, imgp->vp, (void *)vmaddr, file_offset,
+	    a_out->a_text + a_out->a_data, UIO_USERSPACE, 0,
+	    curthread->td_ucred, NOCRED, &aresid, curthread);
+	if (error != 0)
+		goto fail;
+	if (aresid != 0) {
+		error = ENOEXEC;
+		goto fail;
+	}
 
 	/*
 	 * remove write enable on the 'text' part


More information about the Zrouter-src-freebsd mailing list