Add support for envsys(4) version 2 ioctls.

This commit is contained in:
njoly 2010-09-24 13:12:53 +00:00
parent 8f77c5159b
commit 6795d62e0d
2 changed files with 37 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_ioctl.c,v 1.50 2010/09/19 10:33:31 mrg Exp $ */
/* $NetBSD: netbsd32_ioctl.c,v 1.51 2010/09/24 13:12:53 njoly 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.50 2010/09/19 10:33:31 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.51 2010/09/24 13:12:53 njoly Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.50 2010/09/19 10:33:31 mrg Exp
#include <sys/syscallargs.h>
#include <sys/ktrace.h>
#include <sys/kmem.h>
#include <sys/envsys.h>
#ifdef __sparc__
#include <dev/sun/fbio.h>
@ -248,6 +249,14 @@ netbsd32_to_vnd_ioctl50(struct netbsd32_vnd_ioctl50 *s32p, struct vnd_ioctl50 *p
p->vnd_size = s32p->vnd_size;
}
static inline void
netbsd32_to_plistref(struct netbsd32_plistref *s32p, struct plistref *p, u_long cmd)
{
p->pref_plist = NETBSD32PTR64(s32p->pref_plist);
p->pref_len = s32p->pref_len;
}
static inline void
netbsd32_to_u_long(netbsd32_u_long *s32p, u_long *p, u_long cmd)
{
@ -393,6 +402,14 @@ netbsd32_from_vnd_ioctl50(struct vnd_ioctl50 *p, struct netbsd32_vnd_ioctl50 *s3
s32p->vnd_size = p->vnd_size;
}
static inline void
netbsd32_from_plistref(struct plistref *p, struct netbsd32_plistref *s32p, u_long cmd)
{
NETBSD32PTR32(s32p->pref_plist, p->pref_plist);
s32p->pref_len = p->pref_len;
}
static inline void
netbsd32_from_u_long(u_long *p, netbsd32_u_long *s32p, u_long cmd)
{
@ -644,6 +661,13 @@ printf("netbsd32_ioctl(%d, %x, %x): %s group %c base %d len %d\n",
case VNDIOCCLR5032:
IOCTL_STRUCT_CONV_TO(VNDIOCCLR50, vnd_ioctl50);
case ENVSYS_GETDICTIONARY32:
IOCTL_STRUCT_CONV_TO(ENVSYS_GETDICTIONARY, plistref);
case ENVSYS_SETDICTIONARY32:
IOCTL_STRUCT_CONV_TO(ENVSYS_SETDICTIONARY, plistref);
case ENVSYS_REMOVEPROPS32:
IOCTL_STRUCT_CONV_TO(ENVSYS_REMOVEPROPS, plistref);
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.28 2010/09/19 10:33:31 mrg Exp $ */
/* $NetBSD: netbsd32_ioctl.h,v 1.29 2010/09/24 13:12:53 njoly Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -372,3 +372,13 @@ struct netbsd32_vnd_ioctl50 {
/* from <dev/vnd.c> */
#define VNDIOCSET5032 _IOWR('F', 0, struct netbsd32_vnd_ioctl50)
#define VNDIOCCLR5032 _IOW('F', 1, struct netbsd32_vnd_ioctl50)
struct netbsd32_plistref {
netbsd32_voidp pref_plist; /* plist data */
netbsd32_size_t pref_len; /* total length of plist data */
};
#define ENVSYS_GETDICTIONARY32 _IOWR('E', 0, struct netbsd32_plistref)
#define ENVSYS_SETDICTIONARY32 _IOWR('E', 1, struct netbsd32_plistref)
#define ENVSYS_REMOVEPROPS32 _IOWR('E', 2, struct netbsd32_plistref)