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 DIOCGSTRATEGY and DIOCSS...



details:   https://anonhg.NetBSD.org/src/rev/165604d46897
branches:  trunk
changeset: 836065:165604d46897
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Sep 24 21:08:08 2018 +0000

description:
add support for DIOCGSTRATEGY and DIOCSSTRATEGY

diffstat:

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

diffs (86 lines):

diff -r cf04e95be589 -r 165604d46897 sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Mon Sep 24 20:36:51 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Mon Sep 24 21:08:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.c,v 1.93 2018/09/03 16:29:29 riastradh Exp $    */
+/*     $NetBSD: netbsd32_ioctl.c,v 1.94 2018/09/24 21:08:08 jdolecek 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.93 2018/09/03 16:29:29 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.94 2018/09/24 21:08:08 jdolecek Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -536,6 +536,17 @@
 }
 
 static inline void
+netbsd32_to_disk_strategy(
+    const struct netbsd32_disk_strategy *s32p,
+    struct disk_strategy *p,
+    u_long cmd)
+{
+       memcpy(p->dks_name, s32p->dks_name, sizeof(p->dks_name));
+       p->dks_param = NETBSD32PTR64(s32p->dks_param);
+       p->dks_paramlen = s32p->dks_paramlen;
+}
+
+static inline void
 netbsd32_to_dkwedge_list(
     const struct netbsd32_dkwedge_list *s32p,
     struct dkwedge_list *p,
@@ -990,6 +1001,17 @@
 }
 
 static inline void
+netbsd32_from_disk_strategy(
+    const struct disk_strategy *p,
+    struct netbsd32_disk_strategy *s32p,
+    u_long cmd)
+{
+       memcpy(s32p->dks_name, p->dks_name, sizeof(p->dks_name));
+       NETBSD32PTR32(s32p->dks_param, p->dks_param);
+       s32p->dks_paramlen = p->dks_paramlen;
+}
+
+static inline void
 netbsd32_from_dkwedge_list(
     const struct dkwedge_list *p,
     struct netbsd32_dkwedge_list *s32p,
@@ -1457,6 +1479,10 @@
        case DRVGETEVENT32:
                IOCTL_STRUCT_CONV_TO(DRVGETEVENT, plistref);
 
+       case DIOCGSTRATEGY32:
+               IOCTL_STRUCT_CONV_TO(DIOCGSTRATEGY, disk_strategy);
+       case DIOCSSTRATEGY32:
+               IOCTL_STRUCT_CONV_TO(DIOCSSTRATEGY, disk_strategy);
        case DIOCLWEDGES32:
                IOCTL_STRUCT_CONV_TO(DIOCLWEDGES, dkwedge_list);
 
diff -r cf04e95be589 -r 165604d46897 sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h      Mon Sep 24 20:36:51 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h      Mon Sep 24 21:08:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.h,v 1.61 2018/09/06 06:41:59 maxv Exp $ */
+/*     $NetBSD: netbsd32_ioctl.h,v 1.62 2018/09/24 21:08:08 jdolecek Exp $     */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -612,3 +612,11 @@
 
 #define DIOCLWEDGES32          _IOWR('d', 124, struct netbsd32_dkwedge_list)
 
+struct netbsd32_disk_strategy {
+       char dks_name[DK_STRATEGYNAMELEN];      /* name of strategy */
+       netbsd32_charp dks_param;               /* notyet; should be NULL */
+       netbsd32_size_t dks_paramlen;           /* notyet; should be 0 */
+} __packed;
+
+#define DIOCGSTRATEGY32                _IOR('d', 125, struct netbsd32_disk_strategy)
+#define DIOCSSTRATEGY32                _IOW('d', 126, struct netbsd32_disk_strategy)



Home | Main Index | Thread Index | Old Index