Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/netbsd32 support WSDISPLAYIO_GCURSOR and WSDISPLA...



details:   https://anonhg.NetBSD.org/src/rev/f4c68c59b5a6
branches:  trunk
changeset: 769963:f4c68c59b5a6
user:      macallan <macallan%NetBSD.org@localhost>
date:      Wed Sep 28 01:46:39 2011 +0000

description:
support WSDISPLAYIO_GCURSOR and WSDISPLAYIO_SCURSOR

diffstat:

 sys/compat/netbsd32/netbsd32_ioctl.c |  53 ++++++++++++++++++++++++++++++++++-
 sys/compat/netbsd32/netbsd32_ioctl.h |  32 +++++++++++++++++++--
 2 files changed, 79 insertions(+), 6 deletions(-)

diffs (141 lines):

diff -r 135b80f794dd -r f4c68c59b5a6 sys/compat/netbsd32/netbsd32_ioctl.c
--- a/sys/compat/netbsd32/netbsd32_ioctl.c      Wed Sep 28 01:45:49 2011 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.c      Wed Sep 28 01:46:39 2011 +0000
@@ -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 @@
        }
 }
 
+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
  */
@@ -515,6 +537,28 @@
 }
 
 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,
                                u_long cmd)
@@ -870,6 +914,11 @@
        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);
 
diff -r 135b80f794dd -r f4c68c59b5a6 sys/compat/netbsd32/netbsd32_ioctl.h
--- a/sys/compat/netbsd32/netbsd32_ioctl.h      Wed Sep 28 01:45:49 2011 +0000
+++ b/sys/compat/netbsd32/netbsd32_ioctl.h      Wed Sep 28 01:46:39 2011 +0000
@@ -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 @@
 /* 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: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 */



Home | Main Index | Thread Index | Old Index