Compare commits

..

5 Commits

Author SHA1 Message Date
Adam Jackson
4645247d45 MIPS support. (Joshua Kinard) 2006-06-22 21:16:44 +00:00
Adam Jackson
57a7f28441 Fix an obvious bogon to avoid crashing on absolute axis setup. 2006-06-02 19:39:52 +00:00
Zephaniah E. Hull
1b03250797 Hopefully fix the bitops stuff to actually _work_. 2006-05-15 22:47:23 +00:00
Zephaniah E. Hull
e9c60da89a Tweak credits and references.
Change the longs to unsigned longs in the bitfields.
Cleanup our includes.
Stop pulling in asm/types.h and asm/bitops.h.
Conditionally define the stuff that used to come from the above, including
    our own test_bit, set_bit and clear_bit.
Change the longs to unsigned longs in the bitfields.
Change the longs to unsigned longs in the bitfields.
Use the bitop defines in evdev.h properly.
Change the longs to unsigned longs in the bitfields.
Change the longs to unsigned longs in the bitfields.
Use the bitop defines in evdev.h properly.
Change the longs to unsigned longs in the bitfields.
Use the bitop defines in evdev.h properly.
Add HPPA/HPPA64 entries. (Thanks to Fabio M. Di Nitto
    <fabbione@ubuntu.com>)
2006-05-14 11:55:50 +00:00
Zephaniah E. Hull
eca922bd95 xf86-input-evdev v1.1.2
Bugzilla #6734 <https://bugs.freedesktop.org/show_bug.cgi=6734> Apply patch
    from Philip Langdale which causes us to make sure that O_NONBLOCK is
    set on the inotify device.
2006-04-30 21:39:08 +00:00
10 changed files with 134 additions and 64 deletions

View File

@@ -1,3 +1,61 @@
2006-06-22 Adam Jackson <ajax@freedesktop.org>
* src/inotify-syscalls.h:
MIPS support. (Joshua Kinard)
2006-06-02 Adam Jackson <ajax@freedesktop.org>
* src/evdev_axes.c:
Fix an obvious bogon to avoid crashing on absolute axis setup.
2006-05-15 Zephaniah E. Hull,,, <warp@aehallh.com>
* src/evdev.h:
Hopefully fix the bitops stuff to actually _work_.
2006-05-14 Zephaniah E. Hull <warp@aehallh.com>
* man/evdev.man:
Tweak credits and references.
* src/evdev.c: (EvdevParseBits), (EvdevParseBitOption),
(EvdevCorePreInit):
Change the longs to unsigned longs in the bitfields.
Cleanup our includes.
* src/evdev.h:
Stop pulling in asm/types.h and asm/bitops.h.
Conditionally define the stuff that used to come from
the above, including our own test_bit, set_bit and clear_bit.
Change the longs to unsigned longs in the bitfields.
* src/evdev_axes.c: (EvdevAxisAbsNew), (EvdevAxisRelNew):
Change the longs to unsigned longs in the bitfields.
Use the bitop defines in evdev.h properly.
* src/evdev_brain.c: (MatchAll), (MatchNot), (MatchAny):
Change the longs to unsigned longs in the bitfields.
* src/evdev_btn.c: (EvdevBtnNew):
Change the longs to unsigned longs in the bitfields.
Use the bitop defines in evdev.h properly.
* src/evdev_key.c: (EvdevKeyNew):
Change the longs to unsigned longs in the bitfields.
Use the bitop defines in evdev.h properly.
* src/inotify-syscalls.h:
Add HPPA/HPPA64 entries. (Thanks to Fabio M. Di Nitto
<fabbione@ubuntu.com>)
2006-04-30 Zephaniah E. Hull <warp@aehallh.com>
* configure.ac:
xf86-input-evdev v1.1.2
* src/evdev_brain.c: (evdevControl):
Bugzilla #6734 <https://bugs.freedesktop.org/show_bug.cgi=6734>
Apply patch from Philip Langdale which causes us to make sure that
O_NONBLOCK is set on the inotify device.
2006-04-15 Zephaniah E. Hull <warp@aehallh.com>
* configure.ac:

View File

@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-input-evdev],
1.1.1,
1.1.2,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-input-evdev)

View File

@@ -312,16 +312,11 @@ enhance the keyboard layout details. Default: not set.
.BI "Option \*qXkbOptions\*q \*q" options \*q
specifies the XKB keyboard option components. These can be used to
enhance the keyboard behaviour. Default: not set.
.PP
Some other XKB-related options are available, but they are incompatible
with the ones listed above and are not recommended, so they are not
documented here.
.TP 7
.PP
.SH AUTHORS
Kristian Høgsberg.
.fi
Zephaniah E. Hull.
.fi
Kristian Høgsberg.
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__),
README.mouse.
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__).

View File

@@ -61,8 +61,6 @@
#include <X11/XF86keysym.h>
#include <X11/extensions/XIproto.h>
#include <string.h>
#include "evdev.h"
#include <xf86.h>
@@ -328,7 +326,7 @@ EvdevNew(evdevDriverPtr driver, evdevDevicePtr device)
}
static void
EvdevParseBits (char *in, long *out, int len)
EvdevParseBits (char *in, unsigned long *out, int len)
{
unsigned long v[2];
int n, i, max_bits = len * BITS_PER_LONG;
@@ -351,7 +349,7 @@ EvdevParseBits (char *in, long *out, int len)
}
static void
EvdevParseBitOption (char *opt, long *all, long *not, long *any, int len)
EvdevParseBitOption (char *opt, unsigned long *all, unsigned long *not, unsigned long *any, int len)
{
char *cur, *next;
@@ -395,7 +393,7 @@ EvdevCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
EvdevParseBitOption (tmp, pEvdev->all_bits.field, \
pEvdev->not_bits.field, \
pEvdev->any_bits.field, \
sizeof(pEvdev->not_bits.field) / sizeof (long)); \
sizeof(pEvdev->not_bits.field) / sizeof (unsigned long)); \
free (tmp); \
}
bitoption(ev);

View File

@@ -72,20 +72,29 @@
#include <stdarg.h>
#include <xf86Xinput.h>
#define BITS_PER_LONG (sizeof(long) * 8)
#ifndef BITS_PER_LONG
#define BITS_PER_LONG (sizeof(unsigned long) * 8)
#endif
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
#define OFF(x) ((x)%BITS_PER_LONG)
#define LONG(x) ((x)/BITS_PER_LONG)
#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
#define test_bit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
#define MASK(x) (1UL << ((x) & (BITS_PER_LONG - 1)))
#ifndef test_bit
#define test_bit(bit, array) (!!(array[LONG(bit)] & MASK(bit)))
#endif
#ifndef set_bit
#define set_bit(bit, array) (array[LONG(bit)] |= MASK(bit))
#endif
#ifndef clear_bit
#define clear_bit(bit, array) (array[LONG(bit)] &= ~MASK(bit))
#endif
/* 2.4 compatibility */
#ifndef EVIOCGSW
#include <sys/time.h>
#include <sys/ioctl.h>
#include <asm/types.h>
#include <asm/bitops.h>
#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
@@ -128,14 +137,14 @@
#define EVDEV_MAXBUTTONS 96
typedef struct {
long ev[NBITS(EV_MAX)];
long key[NBITS(KEY_MAX)];
long rel[NBITS(REL_MAX)];
long abs[NBITS(ABS_MAX)];
long msc[NBITS(MSC_MAX)];
long led[NBITS(LED_MAX)];
long snd[NBITS(SND_MAX)];
long ff[NBITS(FF_MAX)];
unsigned long ev[NBITS(EV_MAX)];
unsigned long key[NBITS(KEY_MAX)];
unsigned long rel[NBITS(REL_MAX)];
unsigned long abs[NBITS(ABS_MAX)];
unsigned long msc[NBITS(MSC_MAX)];
unsigned long led[NBITS(LED_MAX)];
unsigned long snd[NBITS(SND_MAX)];
unsigned long ff[NBITS(FF_MAX)];
} evdevBitsRec, *evdevBitsPtr;
typedef struct {

View File

@@ -49,14 +49,6 @@
#include <xf86_OSproc.h>
#define ArrayLength(a) (sizeof(a) / (sizeof((a)[0])))
#define BITS_PER_LONG (sizeof(long) * 8)
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
#define OFF(x) ((x)%BITS_PER_LONG)
#define LONG(x) ((x)/BITS_PER_LONG)
#define TestBit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
static char *rel_axis_names[] = {
"X",
"Y",
@@ -328,7 +320,7 @@ EvdevAxisAbsNew(InputInfoPtr pInfo)
real_axes = 0;
for (i = 0; i < ABS_MAX; i++)
if (TestBit (i, pEvdev->bits.abs))
if (test_bit (i, pEvdev->bits.abs))
real_axes++;
if (!real_axes)
@@ -344,7 +336,7 @@ EvdevAxisAbsNew(InputInfoPtr pInfo)
pInfo->conversion_proc = EvdevConvert;
for (i = 0, j = 0; i < ABS_MAX; i++) {
if (!TestBit (i, pEvdev->bits.abs))
if (!test_bit (i, pEvdev->bits.abs))
continue;
snprintf(option, sizeof(option), "%sAbsoluteAxisMap", abs_axis_names[i]);
@@ -389,11 +381,11 @@ EvdevAxisAbsNew(InputInfoPtr pInfo)
xf86Msg(X_CONFIG, "%s: Unknown Mode: %s.\n", pInfo->name, s);
}
if (TestBit (ABS_X, pEvdev->bits.abs) && TestBit (ABS_Y, pEvdev->bits.abs))
if (test_bit (ABS_X, pEvdev->bits.abs) && test_bit (ABS_Y, pEvdev->bits.abs))
k = xf86SetIntOption(pInfo->options, "AbsoluteScreen", 0);
else
k = xf86SetIntOption(pInfo->options, "AbsoluteScreen", -1);
if (k < screenInfo.numScreens) {
if (k < screenInfo.numScreens && k >= 0) {
state->abs->screen = k;
xf86Msg(X_CONFIG, "%s: AbsoluteScreen: %d.\n", pInfo->name, k);
} else {
@@ -417,7 +409,7 @@ EvdevAxisRelNew(InputInfoPtr pInfo)
real_axes = 0;
for (i = 0; i < REL_MAX; i++)
if (TestBit (i, pEvdev->bits.rel))
if (test_bit (i, pEvdev->bits.rel))
real_axes++;
if (!real_axes && (!state->abs || state->abs->axes < 2))
@@ -434,7 +426,7 @@ EvdevAxisRelNew(InputInfoPtr pInfo)
pInfo->conversion_proc = EvdevConvert;
for (i = 0, j = 0; i < REL_MAX; i++) {
if (!TestBit (i, pEvdev->bits.rel))
if (!test_bit (i, pEvdev->bits.rel))
continue;
snprintf(option, sizeof(option), "%sRelativeAxisMap", rel_axis_names[i]);

View File

@@ -39,6 +39,7 @@
#include <xf86.h>
#include <fnmatch.h>
#include <sys/poll.h>
#include "inotify.h"
#include "inotify-syscalls.h"
@@ -85,7 +86,7 @@ typedef struct {
} evdevDevInfoRec, *evdevDevInfoPtr;
static Bool
MatchAll (long *dev, long *match, int len)
MatchAll (unsigned long *dev, unsigned long *match, int len)
{
int i;
@@ -97,7 +98,7 @@ MatchAll (long *dev, long *match, int len)
}
static Bool
MatchNot (long *dev, long *match, int len)
MatchNot (unsigned long *dev, unsigned long *match, int len)
{
int i;
@@ -109,7 +110,7 @@ MatchNot (long *dev, long *match, int len)
}
static Bool
MatchAny (long *dev, long *match, int len)
MatchAny (unsigned long *dev, unsigned long *match, int len)
{
int i, found = 0;
@@ -347,7 +348,7 @@ static int
evdevControl(DeviceIntPtr pPointer, int what)
{
InputInfoPtr pInfo;
int i;
int i, flags;
pInfo = pPointer->public.devicePrivate;
@@ -376,6 +377,19 @@ evdevControl(DeviceIntPtr pPointer, int what)
SYSCALL (close (pInfo->fd));
pInfo->fd = -1;
}
if ((flags = fcntl(pInfo->fd, F_GETFL)) < 0) {
xf86Msg(X_ERROR, "%s: Unable to NONBLOCK inotify, using fallback. "
"(errno: %d)\n", pInfo->name, errno);
evdev_inotify = 0;
SYSCALL (close (pInfo->fd));
pInfo->fd = -1;
} else if (fcntl(pInfo->fd, F_SETFL, flags | O_NONBLOCK) < 0) {
xf86Msg(X_ERROR, "%s: Unable to NONBLOCK inotify, using fallback. "
"(errno: %d)\n", pInfo->name, errno);
evdev_inotify = 0;
SYSCALL (close (pInfo->fd));
pInfo->fd = -1;
}
if (!evdev_inotify) {
SYSCALL (pInfo->fd = open ("/proc/bus/usb/devices", O_RDONLY));

View File

@@ -51,15 +51,6 @@
#include <xf86Module.h>
#define ArrayLength(a) (sizeof(a) / (sizeof((a)[0])))
#define BITS_PER_LONG (sizeof(long) * 8)
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
#define OFF(x) ((x)%BITS_PER_LONG)
#define LONG(x) ((x)/BITS_PER_LONG)
#define TestBit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
void
EvdevBtnPostFakeClicks(InputInfoPtr pInfo, int button, int count)
{
@@ -186,7 +177,7 @@ EvdevBtnNew(InputInfoPtr pInfo)
state->btn = Xcalloc (sizeof (evdevBtnRec));
for (i = BTN_MISC; i < (KEY_OK - 1); i++)
if (TestBit (i, pEvdev->bits.key)) {
if (test_bit (i, pEvdev->bits.key)) {
bit = i;
if ((bit >= BTN_MOUSE) && (bit < BTN_JOYSTICK)) {
bit -= BTN_MOUSE - BTN_MISC;

View File

@@ -81,11 +81,6 @@
#define ArrayLength(a) (sizeof(a) / (sizeof((a)[0])))
#define BITS_PER_LONG (sizeof(long) * 8)
#define NBITS(x) ((((x)-1)/BITS_PER_LONG)+1)
#define OFF(x) ((x)%BITS_PER_LONG)
#define LONG(x) ((x)/BITS_PER_LONG)
#define TestBit(bit, array) ((array[LONG(bit)] >> OFF(bit)) & 1)
#define MIN_KEYCODE 8
#define GLYPHS_PER_KEY 2
@@ -356,13 +351,13 @@ EvdevKeyNew (InputInfoPtr pInfo)
int i, keys = 0;
for (i = 0; i <= KEY_UNKNOWN; i++)
if (TestBit (i, pEvdev->bits.key)) {
if (test_bit (i, pEvdev->bits.key)) {
keys = 1;
break;
}
if (!keys)
for (i = KEY_OK; i <= KEY_MAX; i++)
if (TestBit (i, pEvdev->bits.key)) {
if (test_bit (i, pEvdev->bits.key)) {
keys = 1;
break;
}

View File

@@ -39,6 +39,24 @@
# define __NR_inotify_init 290
# define __NR_inotify_add_watch 291
# define __NR_inotify_rm_watch 292
#elif defined (__hppa__) || defined (__hppa64__)
# define __NR_inotify_init 269
# define __NR_inotify_add_watch 270
# define __NR_inotify_rm_watch 271
#elif defined (__mips__)
# if _MIPS_SIM == _MIPS_SIM_ABI32
# define __NR_inotify_init 4284
# define __NR_inotify_add_watch 4285
# define __NR_inotify_rm_watch 4286
# elif _MIPS_SIM == _MIPS_SIM_NABI32
# define __NR_inotify_init 6247
# define __NR_inotify_add_watch 6248
# define __NR_inotify_rm_watch 6249
# elif _MIPS_SIM == _MIPS_SIM_ABI64
# define __NR_inotify_init 5243
# define __NR_inotify_add_watch 5244
# define __NR_inotify_rm_watch 5245
# endif
#else
# error "Unsupported architecture!"
#endif