Module Name: src Committed By: msaitoh Date: Tue Mar 18 07:18:22 UTC 2014
Modified Files: src/sys/compat/netbsd32 [netbsd-6]: netbsd32_ioctl.c netbsd32_ioctl.h Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.64 -r1.64.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.c cvs rdiff -u -r1.41 -r1.41.8.1 src/sys/compat/netbsd32/netbsd32_ioctl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/compat/netbsd32/netbsd32_ioctl.c diff -u src/sys/compat/netbsd32/netbsd32_ioctl.c:1.64 src/sys/compat/netbsd32/netbsd32_ioctl.c:1.64.8.1 --- src/sys/compat/netbsd32/netbsd32_ioctl.c:1.64 Thu Oct 6 03:19:32 2011 +++ src/sys/compat/netbsd32/netbsd32_ioctl.c Tue Mar 18 07:18:22 2014 @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_ioc #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 @@ netbsd32_to_sioc_sg_req(struct netbsd32_ } 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 @@ netbsd32_from_sioc_sg_req(struct sioc_sg } 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 @@ netbsd32_ioctl(struct lwp *l, const stru 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 Index: src/sys/compat/netbsd32/netbsd32_ioctl.h diff -u src/sys/compat/netbsd32/netbsd32_ioctl.h:1.41 src/sys/compat/netbsd32/netbsd32_ioctl.h:1.41.8.1 --- src/sys/compat/netbsd32/netbsd32_ioctl.h:1.41 Wed Sep 28 01:46:39 2011 +++ src/sys/compat/netbsd32/netbsd32_ioctl.h Tue Mar 18 07:18:22 2014 @@ -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 @@ struct netbsd32_format_op { #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;