pixman: Branch 'master'

Benjamin Otte company at kemper.freedesktop.org
Wed Jul 16 11:43:58 PDT 2008


 pixman/pixman-pict.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 7dfd023e94d9ab5940d7062c2e5cde11ab02f43e
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Jul 16 20:41:02 2008 +0200

    fix Altivec detection
    
    the old code used to cause infinite looping on G3 machines.

diff --git a/pixman/pixman-pict.c b/pixman/pixman-pict.c
index 7c88a65..817f13a 100644
--- a/pixman/pixman-pict.c
+++ b/pixman/pixman-pict.c
@@ -1922,20 +1922,28 @@ pixman_bool_t pixman_have_vmx (void) {
 
 #else
 #include <signal.h>
+#include <setjmp.h>
+
+static jmp_buf jump_env;
 
 static void vmx_test(int sig, siginfo_t *si, void *unused) {
-    have_vmx = FALSE;
+    longjmp (jump_env, 1);
 }
 
 pixman_bool_t pixman_have_vmx (void) {
     struct sigaction sa, osa;
+    int jmp_result;
     if (!initialized) {
         sa.sa_flags = SA_SIGINFO;
         sigemptyset(&sa.sa_mask);
         sa.sa_sigaction = vmx_test;
         sigaction(SIGILL, &sa, &osa);
-        asm volatile ( "vor 0, 0, 0" );
+	jmp_result = setjmp (jump_env);
+	if (jmp_result == 0) {
+	    asm volatile ( "vor 0, 0, 0" );
+	}
         sigaction(SIGILL, &osa, NULL);
+	have_vmx = (jmp_result == 0);
         initialized = TRUE;
     }
     return have_vmx;


More information about the xorg-commit mailing list