support WSDISPLAYIO_GCURSOR and WSDISPLAYIO_SCURSOR

This commit is contained in:
macallan 2011-09-28 01:46:39 +00:00
parent ffb96a7f74
commit f73964743d
2 changed files with 79 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_ioctl.c,v 1.61 2011/09/07 02:35:00 macallan Exp $ */
/* $NetBSD: netbsd32_ioctl.c,v 1.62 2011/09/28 01:46:39 macallan 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.61 2011/09/07 02:35:00 macallan Exp $");
__KERNEL_RCSID(0, "$NetBSD: netbsd32_ioctl.c,v 1.62 2011/09/28 01:46:39 macallan Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -339,6 +339,28 @@ netbsd32_to_ieee80211_nwkey(struct netbsd32_ieee80211_nwkey *nwk32,
}
}
static inline void
netbsd32_to_wsdisplay_cursor(struct netbsd32_wsdisplay_cursor *c32,
struct wsdisplay_cursor *c,
u_long cmd)
{
c->which = c32->which;
c->enable = c32->enable;
c->pos.x = c32->pos.x;
c->pos.y = c32->pos.y;
c->hot.x = c32->hot.x;
c->hot.y = c32->hot.y;
c->size.x = c32->size.x;
c->size.y = c32->size.y;
c->cmap.index = c32->cmap.index;
c->cmap.count = c32->cmap.count;
c->cmap.red = NETBSD32PTR64(c32->cmap.red);
c->cmap.green = NETBSD32PTR64(c32->cmap.green);
c->cmap.blue = NETBSD32PTR64(c32->cmap.blue);
c->image = NETBSD32PTR64(c32->image);
c->mask = NETBSD32PTR64(c32->mask);
}
/*
* handle ioctl conversions from 64-bit kernel -> netbsd32
*/
@ -514,6 +536,28 @@ netbsd32_from_wsdisplay_addscreendata(struct wsdisplay_addscreendata *asd,
asd32->idx = asd->idx;
}
static inline void
netbsd32_from_wsdisplay_cursor(struct wsdisplay_cursor *c,
struct netbsd32_wsdisplay_cursor *c32,
u_long cmd)
{
c32->which = c->which;
c32->enable = c->enable;
c32->pos.x = c->pos.x;
c32->pos.y = c->pos.y;
c32->hot.x = c->hot.x;
c32->hot.y = c->hot.y;
c32->size.x = c->size.x;
c32->size.y = c->size.y;
c32->cmap.index = c->cmap.index;
c32->cmap.count = c->cmap.count;
NETBSD32PTR32(c32->cmap.red, c->cmap.red);
NETBSD32PTR32(c32->cmap.green, c->cmap.green);
NETBSD32PTR32(c32->cmap.blue, c->cmap.blue);
NETBSD32PTR32(c32->image, c->image);
NETBSD32PTR32(c32->mask, c->mask);
}
static inline void
netbsd32_from_ieee80211_nwkey(struct ieee80211_nwkey *nwk,
struct netbsd32_ieee80211_nwkey *nwk32,
@ -870,6 +914,11 @@ netbsd32_ioctl(struct lwp *l, const struct netbsd32_ioctl_args *uap, register_t
case WSDISPLAYIO_ADDSCREEN32:
IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_ADDSCREEN, wsdisplay_addscreendata);
case WSDISPLAYIO_GCURSOR32:
IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_GCURSOR, wsdisplay_cursor);
case WSDISPLAYIO_SCURSOR32:
IOCTL_STRUCT_CONV_TO(WSDISPLAYIO_SCURSOR, wsdisplay_cursor);
case SIOCS80211NWKEY32:
IOCTL_STRUCT_CONV_TO(SIOCG80211NWKEY, ieee80211_nwkey);

View File

@ -1,4 +1,4 @@
/* $NetBSD: netbsd32_ioctl.h,v 1.40 2011/09/07 02:35:00 macallan Exp $ */
/* $NetBSD: netbsd32_ioctl.h,v 1.41 2011/09/28 01:46:39 macallan Exp $ */
/*
* Copyright (c) 1998, 2001 Matthew R. Green
@ -130,6 +130,33 @@ struct netbsd32_ieee80211_nwkey {
/* for powerd */
#define POWER_EVENT_RECVDICT32 _IOWR('P', 1, struct netbsd32_plistref)
/* Colormap operations. Not applicable to all display types. */
struct netbsd32_wsdisplay_cmap {
u_int index; /* first element (0 origin) */
u_int count; /* number of elements */
netbsd32_charp red; /* red color map elements */
netbsd32_charp green; /* green color map elements */
netbsd32_charp blue; /* blue color map elements */
};
#define WSDISPLAYIO_GETCMAP32 _IOW('W', 66, struct netbsd32_wsdisplay_cmap)
#define WSDISPLAYIO_PUTCMAP32 _IOW('W', 67, struct netbsd32_wsdisplay_cmap)
struct netbsd32_wsdisplay_cursor {
u_int which; /* values to get/set */
u_int enable; /* enable/disable */
struct wsdisplay_curpos pos; /* position */
struct wsdisplay_curpos hot; /* hot spot */
struct netbsd32_wsdisplay_cmap cmap; /* color map info */
struct wsdisplay_curpos size; /* bit map size */
netbsd32_charp image; /* image data */
netbsd32_charp mask; /* mask data */
};
/* Cursor control: get/set cursor attributes/shape */
#define WSDISPLAYIO_GCURSOR32 _IOWR('W', 73, struct netbsd32_wsdisplay_cursor)
#define WSDISPLAYIO_SCURSOR32 _IOW('W', 74, struct netbsd32_wsdisplay_cursor)
/* can wait! */
#if 0
dev/ccdvar.h:219:#define CCDIOCSET _IOWR('F', 16, struct ccd_ioctl) /* enable ccd */
@ -144,9 +171,6 @@ dev/wscons/wsconsio.h:134:#define WSKBDIO_SETMAP _IOW('W', 14, struct wskbd_map
dev/wscons/wsconsio.h:188:#define WSDISPLAYIO_GETCMAP _IOW('W', 66, struct wsdisplay_cmap)
dev/wscons/wsconsio.h:189:#define WSDISPLAYIO_PUTCMAP _IOW('W', 67, struct wsdisplay_cmap)
dev/wscons/wsconsio.h:227:#define WSDISPLAYIO_GCURSOR _IOWR('W', 73, struct wsdisplay_cursor)
dev/wscons/wsconsio.h:228:#define WSDISPLAYIO_SCURSOR _IOW('W', 74, struct wsdisplay_cursor)
dev/wscons/wsconsio.h:241:#define WSDISPLAYIO_SFONT _IOW('W', 77, struct wsdisplay_font)
net/if_ppp.h:110:#define PPPIOCSPASS _IOW('t', 71, struct bpf_program) /* set pass filter */