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 envsys(4) version 2 ioctls.



details:   https://anonhg.NetBSD.org/src/rev/14f2e2333001
branches:  trunk
changeset: 757807:14f2e2333001
user:      njoly <njoly%NetBSD.org@localhost>
date:      Fri Sep 24 13:12:53 2010 +0000

description:
Add support for envsys(4) version 2 ioctls.

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  28 ++++++++++++++++++++++++++--
 sys/compat/netbsd32/netbsd32_ioctl.h |  12 +++++++++++-
 2 files changed, 37 insertions(+), 3 deletions(-)

diffs (93 lines):

diff -r 0f7c6024a4e0 -r 14f2e2333001 sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Fri Sep 24 12:00:10 2010 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Fri Sep 24 13:12:53 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.c,v 1.50 2010/09/19 10:33:31 mrg Exp $  */
+/*     $NetBSD: netbsd32_ioctl.c,v 1.51 2010/09/24 13:12:53 njoly 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.50 2010/09/19 10:33:31 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.51 2010/09/24 13:12:53 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -50,6 +50,7 @@
 #include <sys/syscallargs.h>
 #include <sys/ktrace.h>
 #include <sys/kmem.h>
+#include <sys/envsys.h>
 
 #ifdef __sparc__
 #include <dev/sun/fbio.h>
@@ -249,6 +250,14 @@
 }
 
 static inline void
+netbsd32_to_plistref(struct netbsd32_plistref *s32p, struct plistref *p, u_long cmd)
+{
+
+       p->pref_plist = NETBSD32PTR64(s32p->pref_plist);
+       p->pref_len = s32p->pref_len;
+}
+
+static inline void
 netbsd32_to_u_long(netbsd32_u_long *s32p, u_long *p, u_long cmd)
 {
 
@@ -394,6 +403,14 @@
 }
 
 static inline void
+netbsd32_from_plistref(struct plistref *p, struct netbsd32_plistref *s32p, u_long cmd)
+{
+
+       NETBSD32PTR32(s32p->pref_plist, p->pref_plist);
+       s32p->pref_len = p->pref_len;
+}
+
+static inline void
 netbsd32_from_u_long(u_long *p, netbsd32_u_long *s32p, u_long cmd)
 {
 
@@ -644,6 +661,13 @@
        case VNDIOCCLR5032:
                IOCTL_STRUCT_CONV_TO(VNDIOCCLR50, vnd_ioctl50);
 
+       case ENVSYS_GETDICTIONARY32:
+               IOCTL_STRUCT_CONV_TO(ENVSYS_GETDICTIONARY, plistref);
+       case ENVSYS_SETDICTIONARY32:
+               IOCTL_STRUCT_CONV_TO(ENVSYS_SETDICTIONARY, plistref);
+       case ENVSYS_REMOVEPROPS32:
+               IOCTL_STRUCT_CONV_TO(ENVSYS_REMOVEPROPS, plistref);
+
        default:
 #ifdef NETBSD32_MD_IOCTL
                error = netbsd32_md_ioctl(fp, com, data32, l);
diff -r 0f7c6024a4e0 -r 14f2e2333001 sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h      Fri Sep 24 12:00:10 2010 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h      Fri Sep 24 13:12:53 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.h,v 1.28 2010/09/19 10:33:31 mrg Exp $  */
+/*     $NetBSD: netbsd32_ioctl.h,v 1.29 2010/09/24 13:12:53 njoly Exp $        */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -372,3 +372,13 @@
 /* from <dev/vnd.c> */
 #define VNDIOCSET5032  _IOWR('F', 0, struct netbsd32_vnd_ioctl50)
 #define VNDIOCCLR5032  _IOW('F', 1, struct netbsd32_vnd_ioctl50)
+
+struct netbsd32_plistref {
+       netbsd32_voidp  pref_plist;     /* plist data */
+       netbsd32_size_t pref_len;       /* total length of plist data */
+};
+
+#define ENVSYS_GETDICTIONARY32 _IOWR('E', 0, struct netbsd32_plistref)
+#define ENVSYS_SETDICTIONARY32 _IOWR('E', 1, struct netbsd32_plistref)
+#define ENVSYS_REMOVEPROPS32   _IOWR('E', 2, struct netbsd32_plistref)
+



Home | Main Index | Thread Index | Old Index