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 DIOCLWEDGES
details: https://anonhg.NetBSD.org/src/rev/ef9b6f639b3f
branches: trunk
changeset: 321202:ef9b6f639b3f
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Tue Mar 06 07:59:59 2018 +0000
description:
Add DIOCLWEDGES
diffstat:
sys/compat/netbsd32/netbsd32_ioctl.c | 31 +++++++++++++++++++++++++++++--
sys/compat/netbsd32/netbsd32_ioctl.h | 14 +++++++++++++-
2 files changed, 42 insertions(+), 3 deletions(-)
diffs (91 lines):
diff -r eb5fc74721e3 -r ef9b6f639b3f sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c Tue Mar 06 07:49:36 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c Tue Mar 06 07:59:59 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_ioctl.c,v 1.91 2018/01/19 23:38:56 macallan Exp $ */
+/* $NetBSD: netbsd32_ioctl.c,v 1.92 2018/03/06 07:59:59 mlelstv 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.91 2018/01/19 23:38:56 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.92 2018/03/06 07:59:59 mlelstv Exp $");
#if defined(_KERNEL_OPT)
#include "opt_ntp.h"
@@ -535,6 +535,18 @@
p->locators = NETBSD32PTR64(s32p->locators);
}
+static inline void
+netbsd32_to_dkwedge_list(
+ const struct netbsd32_dkwedge_list *s32p,
+ struct dkwedge_list *p,
+ u_long cmd)
+{
+ p->dkwl_buf = s32p->dkwl_buf;
+ p->dkwl_bufsize = s32p->dkwl_bufsize;
+ p->dkwl_nwedges = s32p->dkwl_nwedges;
+ p->dkwl_ncopied = s32p->dkwl_ncopied;
+}
+
/*
* handle ioctl conversions from 64-bit kernel -> netbsd32
*/
@@ -977,6 +989,18 @@
NETBSD32PTR32(s32p->locators, p->locators);
}
+static inline void
+netbsd32_from_dkwedge_list(
+ const struct dkwedge_list *p,
+ struct netbsd32_dkwedge_list *s32p,
+ u_long cmd)
+{
+ s32p->dkwl_buf = p->dkwl_buf;
+ s32p->dkwl_bufsize = p->dkwl_bufsize;
+ s32p->dkwl_nwedges = p->dkwl_nwedges;
+ s32p->dkwl_ncopied = p->dkwl_ncopied;
+}
+
#ifdef NTP
static int
netbsd32_do_clockctl_ntp_adjtime(struct clockctl_ntp_adjtime *args)
@@ -1433,6 +1457,9 @@
case DRVGETEVENT32:
IOCTL_STRUCT_CONV_TO(DRVGETEVENT, plistref);
+ case DIOCLWEDGES32:
+ IOCTL_STRUCT_CONV_TO(DIOCLWEDGES, dkwedge_list);
+
default:
#ifdef NETBSD32_MD_IOCTL
error = netbsd32_md_ioctl(fp, com, data32, l);
diff -r eb5fc74721e3 -r ef9b6f639b3f sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h Tue Mar 06 07:49:36 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h Tue Mar 06 07:59:59 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_ioctl.h,v 1.58 2018/01/19 23:38:56 macallan Exp $ */
+/* $NetBSD: netbsd32_ioctl.h,v 1.59 2018/03/06 07:59:59 mlelstv Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@@ -633,3 +633,15 @@
#define DRVCTLCOMMAND32 _IOWR('D', 125, struct netbsd32_plistref)
#define DRVLISTDEV32 _IOWR('D', 127, struct netbsd32_devlistargs)
#define DRVGETEVENT32 _IOR('D', 128, struct netbsd32_plistref)
+
+/* From sys/disk.h, sys/dkio.h */
+
+struct netbsd32_dkwedge_list {
+ void *dkwl_buf; /* storage for dkwedge_info array */
+ netbsd32_size_t dkwl_bufsize; /* size of that buffer */
+ u_int dkwl_nwedges; /* total number of wedges */
+ u_int dkwl_ncopied; /* number actually copied */
+};
+
+#define DIOCLWEDGES32 _IOWR('d', 124, struct netbsd32_dkwedge_list)
+
Home |
Main Index |
Thread Index |
Old Index