Source-Changes-HG archive

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

[src/netbsd-6]: src/sys/compat/netbsd32 Pull up following revision(s) (reques...



details:   https://anonhg.NetBSD.org/src/rev/6ef39bea2303
branches:  netbsd-6
changeset: 776582:6ef39bea2303
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Mar 18 07:18:22 2014 +0000

description:
Pull up following revision(s) (requested by manu in ticket #1022):
        sys/compat/netbsd32/netbsd32_ioctl.h: revision 1.44
        sys/compat/netbsd32/netbsd32_ioctl.c: revision 1.68
Add ATAIOCCOMMAND ioctl form COMPAT_NETBSD32
This enables SMART monitoring by a netbsd32 binary.

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  42 ++++++++++++++++++++++++++++++++++-
 sys/compat/netbsd32/netbsd32_ioctl.h |  20 ++++++++++++++++-
 2 files changed, 59 insertions(+), 3 deletions(-)

diffs (118 lines):

diff -r 172ba9c4f00b -r 6ef39bea2303 sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Fri Feb 21 12:01:31 2014 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Tue Mar 18 07:18:22 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.c,v 1.64 2011/10/06 03:19:32 macallan Exp $     */
+/*     $NetBSD: netbsd32_ioctl.c,v 1.64.8.1 2014/03/18 07:18:22 msaitoh 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.64 2011/10/06 03:19:32 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.64.8.1 2014/03/18 07:18:22 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -43,6 +43,7 @@
 #include <sys/audioio.h>
 #include <sys/disklabel.h>
 #include <sys/dkio.h>
+#include <sys/ataio.h>
 #include <sys/sockio.h>
 #include <sys/socket.h>
 #include <sys/ttycom.h>
@@ -243,6 +244,23 @@
 }
 
 static inline void
+netbsd32_to_atareq(struct netbsd32_atareq *s32p, struct atareq *p, u_long cmd)
+{
+       p->flags = (u_long)s32p->flags;
+       p->command = s32p->command;
+       p->features = s32p->features;
+       p->sec_count = s32p->sec_count;
+       p->sec_num = s32p->sec_num;
+       p->head = s32p->head;
+       p->cylinder = s32p->cylinder;
+       p->databuf =  (char *)NETBSD32PTR64(s32p->databuf);
+       p->datalen = (u_long)s32p->datalen;
+       p->timeout = s32p->timeout;
+       p->retsts = s32p->retsts;
+       p->error = s32p->error;
+}
+
+static inline void
 netbsd32_to_vnd_ioctl(struct netbsd32_vnd_ioctl *s32p, struct vnd_ioctl *p, u_long cmd)
 {
 
@@ -482,6 +500,23 @@
 }
 
 static inline void
+netbsd32_from_atareq(struct atareq *p, struct netbsd32_atareq *s32p, u_long cmd)
+{
+       s32p->flags = (netbsd32_u_long)p->flags;
+       s32p->command = p->command;
+       s32p->features = p->features;
+       s32p->sec_count = p->sec_count;
+       s32p->sec_num = p->sec_num;
+       s32p->head = p->head;
+       s32p->cylinder = p->cylinder;
+       NETBSD32PTR32(s32p->databuf, p->databuf);
+       s32p->datalen = (netbsd32_u_long)p->datalen;
+       s32p->timeout = p->timeout;
+       s32p->retsts = p->retsts;
+       s32p->error = p->error;
+}
+
+static inline void
 netbsd32_from_vnd_ioctl(struct vnd_ioctl *p, struct netbsd32_vnd_ioctl *s32p, u_long cmd)
 {
 
@@ -783,6 +818,9 @@
                IOCTL_STRUCT_CONV_TO(DIOCWFORMAT, format_op);
 #endif
 
+       case ATAIOCCOMMAND32:
+               IOCTL_STRUCT_CONV_TO(ATAIOCCOMMAND, atareq);
+
 /*
  * only a few ifreq syscalls need conversion and those are
  * all driver specific... XXX
diff -r 172ba9c4f00b -r 6ef39bea2303 sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h      Fri Feb 21 12:01:31 2014 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h      Tue Mar 18 07:18:22 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_ioctl.h,v 1.41 2011/09/28 01:46:39 macallan Exp $     */
+/*     $NetBSD: netbsd32_ioctl.h,v 1.41.8.1 2014/03/18 07:18:22 msaitoh Exp $  */
 
 /*
  * Copyright (c) 1998, 2001 Matthew R. Green
@@ -90,6 +90,24 @@
 #define DIOCWFORMAT32  _IOWR('d', 106, struct netbsd32_format_op)
 #endif
 
+/* from <sys/ataio.h> */
+struct netbsd32_atareq {
+       netbsd32_u_long         flags;
+       u_char                  command;
+       u_char                  features;
+       u_char                  sec_count;
+       u_char                  sec_num;
+       u_char                  head;
+       u_short                 cylinder;
+       netbsd32_voidp          databuf;
+       netbsd32_u_long         datalen;
+       int                     timeout;
+       u_char                  retsts;
+       u_char                  error;
+};
+#define ATAIOCCOMMAND32                _IOWR('Q', 8, struct netbsd32_atareq)
+
+
 /* from <net/bpf.h> */
 struct netbsd32_bpf_program {
        u_int bf_len;



Home | Main Index | Thread Index | Old Index