[PATCH 5/5] Drop custom sigio block/unblock functions from kdrive, ephyr and dmx

Peter Hutterer peter.hutterer at who-t.net
Mon Jul 2 23:01:18 PDT 2012


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 hw/dmx/input/dmxevents.c |   24 ++++++++++++------------
 hw/dmx/input/dmxsigio.c  |   22 ----------------------
 hw/dmx/input/dmxsigio.h  |    2 --
 hw/kdrive/ephyr/ephyr.c  |   24 ++----------------------
 hw/kdrive/src/kinput.c   |   40 ++++++++++------------------------------
 5 files changed, 24 insertions(+), 88 deletions(-)

diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c
index f734808..2875620 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 9b1b493..6ef543c 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 4e48749..9f30662 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 8eda539..fe3dae6 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 58ae552..000bda9 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 = {
-- 
1.7.10.4



More information about the xorg-devel mailing list