summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-06-22 15:18:53 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-07-03 15:56:35 +1000
commitd04dfe3f754ad3a5f158057175cbd44319c1ae51 (patch)
tree72870ad8bca4e61da32c8bfb144c05f939a23431
parent5d309af2ed93e91c7d72f548a11052051efbb40f (diff)
Drop custom sigio block/unblock functions from kdrive, ephyr and dmx
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/dmx/input/dmxevents.c24
-rw-r--r--hw/dmx/input/dmxsigio.c22
-rw-r--r--hw/dmx/input/dmxsigio.h2
-rw-r--r--hw/kdrive/ephyr/ephyr.c24
-rw-r--r--hw/kdrive/src/kinput.c40
5 files changed, 24 insertions, 88 deletions
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index f73480824..28756203b 100644
--- a/hw/dmx/input/dmxevents.c
+++ b/hw/dmx/input/dmxevents.c
@@ -227,25 +227,25 @@ dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block)
&& pScreen->myNum == dmxScreen->index) {
/* Screen is old screen */
if (block)
- dmxSigioBlock();
+ OsBlockSIGIO();
if (pDev)
enqueueMotion(pDev, localX, localY);
if (block)
- dmxSigioUnblock();
+ OsReleaseSIGIO();
}
else {
/* Screen is new */
DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n",
pScreen->myNum, dmxScreen->index, localX, localY);
if (block)
- dmxSigioBlock();
+ OsBlockSIGIO();
mieqProcessInputEvents();
miPointerSetScreen(inputInfo.pointer, dmxScreen->index,
localX, localY);
if (pDev)
enqueueMotion(pDev, localX, localY);
if (block)
- dmxSigioUnblock();
+ OsReleaseSIGIO();
}
#if 00
miPointerGetPosition(inputInfo.pointer, &localX, &localY);
@@ -387,12 +387,12 @@ dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
}
if (block)
- dmxSigioBlock();
+ OsBlockSIGIO();
valuator_mask_set_range(&mask, firstAxis, axesCount, v);
QueuePointerEvents(pDevice, MotionNotify, 0, POINTER_ABSOLUTE, &mask);
if (block)
- dmxSigioUnblock();
+ OsReleaseSIGIO();
}
static int
@@ -492,10 +492,10 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
valuators);
if (block)
- dmxSigioBlock();
+ OsBlockSIGIO();
QueueKeyboardEvents(pDevice, event, ke->keycode, &mask);
if (block)
- dmxSigioUnblock();
+ OsReleaseSIGIO();
break;
case XI_DeviceButtonPress:
case XI_DeviceButtonRelease:
@@ -503,11 +503,11 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
valuators);
if (block)
- dmxSigioBlock();
+ OsBlockSIGIO();
QueuePointerEvents(pDevice, event, ke->keycode,
POINTER_ABSOLUTE, &mask);
if (block)
- dmxSigioUnblock();
+ OsReleaseSIGIO();
break;
case XI_ProximityIn:
case XI_ProximityOut:
@@ -515,10 +515,10 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count,
valuators);
if (block)
- dmxSigioBlock();
+ OsBlockSIGIO();
QueueProximityEvents(pDevice, event, &mask);
if (block)
- dmxSigioUnblock();
+ OsReleaseSIGIO();
break;
break;
diff --git a/hw/dmx/input/dmxsigio.c b/hw/dmx/input/dmxsigio.c
index 9b1b493b8..6ef543c8b 100644
--- a/hw/dmx/input/dmxsigio.c
+++ b/hw/dmx/input/dmxsigio.c
@@ -84,28 +84,6 @@ dmxSigioHandler(int sig)
}
}
-/** Block SIGIO handling. */
-void
-dmxSigioBlock(void)
-{
- sigset_t s;
-
- sigemptyset(&s);
- sigaddset(&s, SIGIO);
- sigprocmask(SIG_BLOCK, &s, 0);
-}
-
-/** Unblock SIGIO handling. */
-void
-dmxSigioUnblock(void)
-{
- sigset_t s;
-
- sigemptyset(&s);
- sigaddset(&s, SIGIO);
- sigprocmask(SIG_UNBLOCK, &s, 0);
-}
-
static void
dmxSigioHook(void)
{
diff --git a/hw/dmx/input/dmxsigio.h b/hw/dmx/input/dmxsigio.h
index 4e4874929..9f30662d1 100644
--- a/hw/dmx/input/dmxsigio.h
+++ b/hw/dmx/input/dmxsigio.h
@@ -36,8 +36,6 @@
#ifndef _DMXSIGIO_H_
#define _DMXSIGIO_H_
-extern void dmxSigioBlock(void);
-extern void dmxSigioUnblock(void);
extern void dmxSigioEnableInput(void);
extern void dmxSigioDisableInput(void);
extern void dmxSigioRegister(DMXInputInfo * dmxInput, int fd);
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 8eda539aa..fe3dae66e 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -772,26 +772,6 @@ ephyrUpdateModifierState(unsigned int state)
}
}
-static void
-ephyrBlockSigio(void)
-{
- sigset_t set;
-
- sigemptyset(&set);
- sigaddset(&set, SIGIO);
- sigprocmask(SIG_BLOCK, &set, 0);
-}
-
-static void
-ephyrUnblockSigio(void)
-{
- sigset_t set;
-
- sigemptyset(&set);
- sigaddset(&set, SIGIO);
- sigprocmask(SIG_UNBLOCK, &set, 0);
-}
-
static Bool
ephyrCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
{
@@ -808,11 +788,11 @@ int ephyrCurScreen; /*current event screen */
static void
ephyrWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
- ephyrBlockSigio();
+ OsBlockSIGIO();
ephyrCurScreen = pScreen->myNum;
miPointerWarpCursor(inputInfo.pointer, pScreen, x, y);
- ephyrUnblockSigio();
+ OsReleaseSIGIO();
}
miPointerScreenFuncRec ephyrPointerScreenFuncs = {
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 58ae55278..000bda9f2 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -102,26 +102,6 @@ KdSigio(int sig)
(*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure);
}
-static void
-KdBlockSigio(void)
-{
- sigset_t set;
-
- sigemptyset(&set);
- sigaddset(&set, SIGIO);
- sigprocmask(SIG_BLOCK, &set, 0);
-}
-
-static void
-KdUnblockSigio(void)
-{
- sigset_t set;
-
- sigemptyset(&set);
- sigaddset(&set, SIGIO);
- sigprocmask(SIG_UNBLOCK, &set, 0);
-}
-
#ifdef DEBUG_SIGIO
void
@@ -261,7 +241,7 @@ KdDisableInput(void)
KdPointerInfo *pi;
int found = 0, i = 0;
- KdBlockSigio();
+ OsBlockSIGIO();
for (ki = kdKeyboards; ki; ki = ki->next) {
if (ki->driver && ki->driver->Disable)
@@ -343,7 +323,7 @@ KdEnableInput(void)
NoticeEventTime(&ev, pi->dixdev);
NoticeEventTime(&ev, ki->dixdev);
- KdUnblockSigio();
+ OsReleaseSIGIO();
}
static KdKeyboardDriver *
@@ -1801,7 +1781,7 @@ KdReleaseAllKeys(void)
int key;
KdKeyboardInfo *ki;
- KdBlockSigio();
+ OsBlockSIGIO();
for (ki = kdKeyboards; ki; ki = ki->next) {
for (key = ki->keySyms.minKeyCode; key < ki->keySyms.maxKeyCode; key++) {
@@ -1812,7 +1792,7 @@ KdReleaseAllKeys(void)
}
}
- KdUnblockSigio();
+ OsReleaseSIGIO();
#endif
}
@@ -2009,18 +1989,18 @@ KdWakeupHandler(ScreenPtr pScreen,
if (kdInputEnabled && result > 0) {
for (i = 0; i < kdNumInputFds; i++)
if (FD_ISSET(kdInputFds[i].fd, pReadmask)) {
- KdBlockSigio();
+ OsBlockSIGIO();
(*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure);
- KdUnblockSigio();
+ OsReleaseSIGIO();
}
}
for (pi = kdPointers; pi; pi = pi->next) {
if (pi->timeoutPending) {
if ((long) (GetTimeInMillis() - pi->emulationTimeout) >= 0) {
pi->timeoutPending = FALSE;
- KdBlockSigio();
+ OsBlockSIGIO();
KdReceiveTimeout(pi);
- KdUnblockSigio();
+ OsReleaseSIGIO();
}
}
}
@@ -2117,10 +2097,10 @@ int KdCurScreen; /* current event screen */
static void
KdWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
- KdBlockSigio();
+ OsBlockSIGIO();
KdCurScreen = pScreen->myNum;
miPointerWarpCursor(pDev, pScreen, x, y);
- KdUnblockSigio();
+ OsReleaseSIGIO();
}
miPointerScreenFuncRec kdPointerScreenFuncs = {