Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 fix DIOCLWEDGES to at least not fail wit...



details:   https://anonhg.NetBSD.org/src/rev/1560d68b1e13
branches:  trunk
changeset: 433630:1560d68b1e13
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Sep 24 21:15:39 2018 +0000

description:
fix DIOCLWEDGES to at least not fail with ENOTTY due to struct size difference,
but probably more needs to be done to work if any actual wedges are configured

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  8 ++++----
 sys/compat/netbsd32/netbsd32_ioctl.h |  6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (59 lines):

diff -r 61534fdfb613 -r 1560d68b1e13 sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Mon Sep 24 21:08:08 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Mon Sep 24 21:15:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.c,v 1.94 2018/09/24 21:08:08 jdolecek Exp $     */
+/*     $NetBSD: netbsd32_ioctl.c,v 1.95 2018/09/24 21:15:39 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.94 2018/09/24 21:08:08 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.95 2018/09/24 21:15:39 jdolecek Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ntp.h"
@@ -552,7 +552,7 @@
     struct dkwedge_list *p,
     u_long cmd)
 {
-       p->dkwl_buf = s32p->dkwl_buf;
+       p->dkwl_buf = NETBSD32PTR64(s32p->dkwl_buf);
        p->dkwl_bufsize = s32p->dkwl_bufsize;
        p->dkwl_nwedges = s32p->dkwl_nwedges;
        p->dkwl_ncopied = s32p->dkwl_ncopied;
@@ -1017,7 +1017,7 @@
     struct netbsd32_dkwedge_list *s32p,
     u_long cmd)
 {
-       s32p->dkwl_buf = p->dkwl_buf;
+       NETBSD32PTR32(s32p->dkwl_buf, p->dkwl_buf);
        s32p->dkwl_bufsize = p->dkwl_bufsize;
        s32p->dkwl_nwedges = p->dkwl_nwedges;
        s32p->dkwl_ncopied = p->dkwl_ncopied;
diff -r 61534fdfb613 -r 1560d68b1e13 sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h      Mon Sep 24 21:08:08 2018 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h      Mon Sep 24 21:15:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.h,v 1.62 2018/09/24 21:08:08 jdolecek Exp $     */
+/*     $NetBSD: netbsd32_ioctl.h,v 1.63 2018/09/24 21:15:39 jdolecek Exp $     */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -604,11 +604,11 @@
 /* From sys/disk.h, sys/dkio.h */
 
 struct netbsd32_dkwedge_list {
-       void                    *dkwl_buf;      /* storage for dkwedge_info array */
+       netbsd32_voidp          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 */
-};
+} __packed;
 
 #define DIOCLWEDGES32          _IOWR('d', 124, struct netbsd32_dkwedge_list)
 



Home | Main Index | Thread Index | Old Index