Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/netbsd32 add support for the netbsd 5.0 versions ...



details:   https://anonhg.NetBSD.org/src/rev/50b84a6d5965
branches:  trunk
changeset: 757726:50b84a6d5965
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sun Sep 19 09:46:59 2010 +0000

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

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  31 +++++++++++++++++++++++++++++--
 sys/compat/netbsd32/netbsd32_ioctl.h |  13 ++++++++++++-
 2 files changed, 41 insertions(+), 3 deletions(-)

diffs (98 lines):

diff -r 9396601bf650 -r 50b84a6d5965 sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Sun Sep 19 09:41:37 2010 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Sun Sep 19 09:46:59 2010 +0000
@@ -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);
diff -r 9396601bf650 -r 50b84a6d5965 sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h      Sun Sep 19 09:41:37 2010 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h      Sun Sep 19 09:46:59 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index