summaryrefslogtreecommitdiff
path: root/sys/dev/sun
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2009-01-11 23:36:39 +0000
committerchristos <christos@NetBSD.org>2009-01-11 23:36:39 +0000
commitced9088db5a7147fd240df17fd05c8dffc6b18a9 (patch)
tree3600aa0d7ff8c04762f8838dc82ab4b68fad1cf5 /sys/dev/sun
parent9273b33558eb366dc88f06d42528df5f2b95b08c (diff)
retain compatibility with old firm_event. Perhaps we should bump the protocol
version with an ioctl?
Diffstat (limited to 'sys/dev/sun')
-rw-r--r--sys/dev/sun/kbd.c6
-rw-r--r--sys/dev/sun/ms.c10
-rw-r--r--sys/dev/sun/vuid_event.h19
3 files changed, 25 insertions, 10 deletions
diff --git a/sys/dev/sun/kbd.c b/sys/dev/sun/kbd.c
index b03aace7ecb..67ab165fee5 100644
--- a/sys/dev/sun/kbd.c
+++ b/sys/dev/sun/kbd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: kbd.c,v 1.61 2008/04/20 03:05:55 tsutsui Exp $ */
+/* $NetBSD: kbd.c,v 1.62 2009/01/11 23:36:39 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -47,7 +47,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.61 2008/04/20 03:05:55 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kbd.c,v 1.62 2009/01/11 23:36:39 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -790,7 +790,7 @@ kbd_input_event(struct kbd_softc *k, int code)
fe->id = KEY_CODE(code);
fe->value = KEY_UP(code) ? VKEY_UP : VKEY_DOWN;
- getmicrotime(&fe->time);
+ firm_gettime(fe);
k->k_events.ev_put = put;
EV_WAKEUP(&k->k_events);
}
diff --git a/sys/dev/sun/ms.c b/sys/dev/sun/ms.c
index 1b647db41f0..87c38d0054a 100644
--- a/sys/dev/sun/ms.c
+++ b/sys/dev/sun/ms.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ms.c,v 1.37 2008/04/20 03:05:55 tsutsui Exp $ */
+/* $NetBSD: ms.c,v 1.38 2009/01/11 23:36:39 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ms.c,v 1.37 2008/04/20 03:05:55 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ms.c,v 1.38 2009/01/11 23:36:39 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -347,7 +347,7 @@ ms_input(struct ms_softc *ms, int c)
d = to_one[d - 1]; /* from 1..7 to {1,2,4} */
fe->id = to_id[d - 1]; /* from {1,2,4} to ID */
fe->value = mb & d ? VKEY_DOWN : VKEY_UP;
- getmicrotime(&fe->time);
+ firm_gettime(fe);
ADVANCE;
ub ^= d;
}
@@ -355,7 +355,7 @@ ms_input(struct ms_softc *ms, int c)
NEXT;
fe->id = LOC_X_DELTA;
fe->value = ms->ms_dx;
- getmicrotime(&fe->time);
+ firm_gettime(fe);
ADVANCE;
ms->ms_dx = 0;
}
@@ -363,7 +363,7 @@ ms_input(struct ms_softc *ms, int c)
NEXT;
fe->id = LOC_Y_DELTA;
fe->value = ms->ms_dy;
- getmicrotime(&fe->time);
+ firm_gettime(fe);
ADVANCE;
ms->ms_dy = 0;
}
diff --git a/sys/dev/sun/vuid_event.h b/sys/dev/sun/vuid_event.h
index eccca5e5e06..e5907670353 100644
--- a/sys/dev/sun/vuid_event.h
+++ b/sys/dev/sun/vuid_event.h
@@ -1,4 +1,4 @@
-/* $NetBSD: vuid_event.h,v 1.4 2006/08/28 16:41:04 he Exp $ */
+/* $NetBSD: vuid_event.h,v 1.5 2009/01/11 23:36:39 christos Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -43,6 +43,11 @@
#ifndef _SUN_VUID_EVENT_H_
#define _SUN_VUID_EVENT_H_
+struct firm_timeval {
+ long tv_sec;
+ long tv_usec;
+};
+
/*
* The following is a minimal emulation of Sun's `Firm_event' structures
* and related operations necessary to make X11 happy (i.e., make it
@@ -52,9 +57,19 @@ typedef struct firm_event {
u_short id; /* key or MS_* or LOC_[XY]_DELTA */
u_short pad; /* unused, at least by X11 */
int value; /* VKEY_{UP,DOWN} or locator delta */
- struct timeval time;
+ struct firm_timeval time;
} Firm_event;
+__BEGIN_DECLS
+static __inline void firm_settime(Firm_event *fev)
+{
+ struct timeval tv;
+ getmicrotime(&tv);
+ fev->time.tv_sec = (long)tv.tv_sec;
+ fev->time.tv_usec = (long)tv.tv_usec;
+}
+__END_DECLS
+
/*
* Special `id' fields. These weird numbers simply match the old binaries.
* Others are in 0..0x7f and are keyboard key numbers (keyboard dependent!).