summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorThomas Winischhofer <thomas@winischhofer.net>2004-10-29 02:06:17 +0000
committerThomas Winischhofer <thomas@winischhofer.net>2004-10-29 02:06:17 +0000
commit09fdfaa28d2afe33dfadd4293b39a34da268fbdb (patch)
tree92f674d4973bf3ad901b276e12dc3d4cdb76e576 /hw
parentb0185a4bf77a668e65e94197bdb13331680521c7 (diff)
Add facility to catch sig 4 from driver. This can be used to check for OS
SSE support. (Part 1)
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86.h1
-rw-r--r--hw/xfree86/common/xf86Events.c17
2 files changed, 17 insertions, 1 deletions
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 313d43015..3c5dba088 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -219,6 +219,7 @@ int xf86RemoveInputHandler(pointer handler);
void xf86DisableInputHandler(pointer handler);
void xf86EnableInputHandler(pointer handler);
void xf86InterceptSignals(int *signo);
+void xf86InterceptSigIll(void (*sigillhandler)(void));
Bool xf86EnableVTSwitch(Bool new);
Bool xf86CommonSpecialKey(int key, Bool down, int modifiers);
void xf86ProcessActionEvent(ActionEvent action, void *arg);
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index ff907a269..22740047d 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -49,7 +49,7 @@
*/
/* $XConsortium: xf86Events.c /main/46 1996/10/25 11:36:30 kaleb $ */
-/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.3 2004/07/30 20:56:53 eich Exp $ */
+/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86Events.c,v 1.4 2004/10/11 09:58:04 eich Exp $ */
/* [JCH-96/01/21] Extended std reverse map to four buttons. */
@@ -1265,6 +1265,14 @@ xf86InterceptSignals(int *signo)
*signo = -1;
}
+static void (*xf86SigIllHandler)(void) = NULL;
+
+void
+xf86InterceptSigIll(void (*sigillhandler)(void))
+{
+ xf86SigIllHandler = sigillhandler;
+}
+
/*
* xf86SigHandler --
* Catch unexpected signals and exit or continue cleanly.
@@ -1272,6 +1280,13 @@ xf86InterceptSignals(int *signo)
void
xf86SigHandler(int signo)
{
+ if ((signo == SIGILL) && xf86SigIllHandler) {
+ (*xf86SigIllHandler)();
+ /* Re-arm handler just in case we unexpectedly return here */
+ (void) signal(signo, xf86SigHandler);
+ return;
+ }
+
if (xf86SignalIntercept && (*xf86SignalIntercept < 0)) {
/* Re-arm handler just in case */
(void) signal(signo, xf86SigHandler);