Module Name:    src
Committed By:   mrg
Date:           Sun Sep 19 09:46:59 UTC 2010

Modified Files:
        src/sys/compat/netbsd32: netbsd32_ioctl.c netbsd32_ioctl.h

Log Message:
add support for the netbsd 5.0 versions of the VND* ioctls.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/compat/netbsd32/netbsd32_ioctl.c
cvs rdiff -u -r1.26 -r1.27 src/sys/compat/netbsd32/netbsd32_ioctl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/compat/netbsd32/netbsd32_ioctl.c
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.48 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.49
--- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.48	Sun Sep 19 09:09:30 2010
+++ src/sys/compat/netbsd32/netbsd32_ioctl.c	Sun Sep 19 09:46:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.c,v 1.48 2010/09/19 09:09:30 mrg Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.c,v 1.49 2010/09/19 09:46:59 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.48 2010/09/19 09:09:30 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.49 2010/09/19 09:46:59 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -71,6 +71,8 @@
 #include <compat/netbsd32/netbsd32_ioctl.h>
 #include <compat/netbsd32/netbsd32_syscallargs.h>
 
+#include <dev/vndvar.h>
+
 /* prototypes for the converters */
 static inline void netbsd32_to_partinfo(struct netbsd32_partinfo *,
 					  struct partinfo *, u_long);
@@ -236,6 +238,16 @@
 	p->vnu_ino = s32p->vnu_ino;
 }
 
+static inline void
+netbsd32_to_vnd_ioctl50(struct netbsd32_vnd_ioctl50 *s32p, struct vnd_ioctl50 *p, u_long cmd)
+{
+
+	p->vnd_file = (char *)NETBSD32PTR64(s32p->vnd_file);
+	p->vnd_flags = s32p->vnd_flags;
+	p->vnd_geom = s32p->vnd_geom;
+	p->vnd_size = s32p->vnd_size;
+}
+
 /*
  * handle ioctl conversions from 64-bit kernel -> netbsd32
  */
@@ -365,6 +377,15 @@
 	s32p->vnu_ino = p->vnu_ino;
 }
 
+static inline void
+netbsd32_from_vnd_ioctl50(struct vnd_ioctl50 *p, struct netbsd32_vnd_ioctl50 *s32p, u_long cmd)
+{
+
+	s32p->vnd_flags = p->vnd_flags;
+	s32p->vnd_geom = p->vnd_geom;
+	s32p->vnd_size = p->vnd_size;
+}
+
 
 /*
  * main ioctl syscall.
@@ -600,6 +621,12 @@
 	case VNDIOCGET32:
 		IOCTL_STRUCT_CONV_TO(VNDIOCGET, vnd_user);
 
+	case VNDIOCSET5032:
+		IOCTL_STRUCT_CONV_TO(VNDIOCSET50, vnd_ioctl50);
+
+	case VNDIOCCLR5032:
+		IOCTL_STRUCT_CONV_TO(VNDIOCCLR50, vnd_ioctl50);
+
 	default:
 #ifdef NETBSD32_MD_IOCTL
 		error = netbsd32_md_ioctl(fp, com, data32, l);

Index: src/sys/compat/netbsd32/netbsd32_ioctl.h
diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.26 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.27
--- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.26	Sun Sep 19 09:09:30 2010
+++ src/sys/compat/netbsd32/netbsd32_ioctl.h	Sun Sep 19 09:46:59 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_ioctl.h,v 1.26 2010/09/19 09:09:30 mrg Exp $	*/
+/*	$NetBSD: netbsd32_ioctl.h,v 1.27 2010/09/19 09:46:59 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -372,4 +372,15 @@
 #define VNDIOCSET32	_IOWR('F', 0, struct netbsd32_vnd_ioctl)	/* enable disk */
 #define VNDIOCCLR32	_IOW('F', 1, struct netbsd32_vnd_ioctl)	/* disable disk */
 #define VNDIOCGET32	_IOWR('F', 3, struct netbsd32_vnd_user)	/* get list */
+
+/* from <dev/vnd.c> */
+struct netbsd32_vnd_ioctl50 {
+	netbsd32_charp	vnd_file;	/* pathname of file to mount */
+	int		vnd_flags;	/* flags; see below */
+	struct vndgeom	vnd_geom;	/* geometry to emulate */
+	unsigned int	vnd_size;	/* (returned) size of disk */
+} __packed;
+#define VNDIOCSET5032	_IOWR('F', 0, struct netbsd32_vnd_ioctl50)
+#define VNDIOCCLR5032	_IOW('F', 1, struct netbsd32_vnd_ioctl50)
+
 #endif

Reply via email to