Add DIOCLWEDGES

This commit is contained in:
mlelstv 2018-03-06 07:59:59 +00:00
parent 92e3f65502
commit 1261ded27d
2 changed files with 42 additions and 3 deletions

View File

@ -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 @@ netbsd32_to_devrescanargs(
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 @@ netbsd32_from_devrescanargs(
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 @@ netbsd32_ioctl(struct lwp *l, const struct netbsd32_ioctl_args *uap, register_t
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);

View File

@ -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 @@ struct netbsd32_devrescanargs {
#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)