Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/dev/sun pull up 1.5. approved by thorpej:



details:   https://anonhg.NetBSD.org/src/rev/605f294cd57a
branches:  netbsd-1-5
changeset: 489271:605f294cd57a
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Aug 26 01:10:16 2000 +0000

description:
pull up 1.5.  approved by thorpej:
>Add COMPAT_NETBSD32 support.

diffstat:

 sys/dev/sun/event.c |  42 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 41 insertions(+), 1 deletions(-)

diffs (77 lines):

diff -r 0966f6b5d072 -r 605f294cd57a sys/dev/sun/event.c
--- a/sys/dev/sun/event.c       Sat Aug 26 01:09:34 2000 +0000
+++ b/sys/dev/sun/event.c       Sat Aug 26 01:10:16 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: event.c,v 1.4 2000/03/30 12:45:42 augustss Exp $       */
+/*     $NetBSD: event.c,v 1.4.4.1 2000/08/26 01:10:16 mrg Exp $        */
 
 /*
  * Copyright (c) 1992, 1993
@@ -47,6 +47,7 @@
 /*
  * Internal `Firm_event' interface for the keyboard and mouse drivers.
  */
+#include "opt_compat_netbsd32.h"
 
 #include <sys/param.h>
 #include <sys/fcntl.h>
@@ -60,6 +61,35 @@
 #include <machine/vuid_event.h>
 #include <dev/sun/event_var.h>
 
+#ifdef COMPAT_NETBSD32
+#include <compat/netbsd32/netbsd32.h>
+
+int ev_out32 __P((struct firm_event *, int, struct uio *));
+
+/*
+ * Write out a series of 32-bit firm_events.
+ */
+int
+ev_out32(e, n, uio)
+       struct firm_event *e;
+       int n;
+       struct uio *uio;
+{
+       struct firm_event32 e32;
+       int error = 0;
+
+       while (n-- && error == 0) {
+               e32.id = e->id;
+               e32.value = e->value;
+               e32.time.tv_sec = e->time.tv_sec;
+               e32.time.tv_usec = e->time.tv_usec;
+               error = uiomove((caddr_t)&e32, sizeof(e32), uio);
+               e++;
+       }
+       return (error);
+}
+#endif
+
 /*
  * Initialize a firm_event queue.
  */
@@ -127,6 +157,11 @@
        n = howmany(uio->uio_resid, sizeof(struct firm_event));
        if (cnt > n)
                cnt = n;
+#ifdef COMPAT_NETBSD32
+       if (curproc->p_flag & P_32) 
+               error = ev_out32(&ev->ev_q[ev->ev_get], cnt, uio);
+       else
+#endif
        error = uiomove((caddr_t)&ev->ev_q[ev->ev_get],
            cnt * sizeof(struct firm_event), uio);
        n -= cnt;
@@ -140,6 +175,11 @@
                return (error);
        if (cnt > n)
                cnt = n;
+#ifdef COMPAT_NETBSD32
+       if (curproc->p_flag & P_32) 
+               error = ev_out32(&ev->ev_q[0], cnt, uio);
+       else
+#endif
        error = uiomove((caddr_t)&ev->ev_q[0],
            cnt * sizeof(struct firm_event), uio);
        ev->ev_get = cnt;



Home | Main Index | Thread Index | Old Index