Brad <[email protected]> writes:

> On Saturday 31 July 2010 05:45:25 Søren Sandmann wrote:
> > From: Brad Smith <[email protected]>
> >
> > Bug 29331.
> 
> FYI, I updated the diff with the bug report.

The new patch is included below. 


As a general note, it's usually easier for everybody if people
generate patches with

        git format-patch 

and then send the result to this mailing list, possibly using git
send-email. That way we get a changelog entry, and I don't have to
fish patches out of bugzilla.


Thanks,
Soren



>From bad3e0ca25165544f176899e042d17bf18ad7691 Mon Sep 17 00:00:00 2001
From: Brad Smith <[email protected]>
Date: Mon, 2 Aug 2010 13:37:49 -0400
Subject: [PATCH] Add support for AltiVec detection for OpenBSD/PowerPC.

Bug 29331.
---
 pixman/pixman-cpu.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/pixman/pixman-cpu.c b/pixman/pixman-cpu.c
index e96b140..e4fb1e4 100644
--- a/pixman/pixman-cpu.c
+++ b/pixman/pixman-cpu.c
@@ -61,6 +61,29 @@ pixman_have_vmx (void)
     return have_vmx;
 }
 
+#elif defined (__OpenBSD__)
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#include <machine/cpu.h>
+
+static pixman_bool_t
+pixman_have_vmx (void)
+{
+    if (!initialized)
+    {
+       int mib[2] = { CTL_MACHDEP, CPU_ALTIVEC };
+       size_t length = sizeof(have_vmx);
+       int error =
+           sysctl (mib, 2, &have_vmx, &length, NULL, 0);
+
+       if (error != 0)
+           have_vmx = FALSE;
+
+       initialized = TRUE;
+    }
+    return have_vmx;
+}
+
 #elif defined (__linux__)
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -123,7 +146,7 @@ pixman_have_vmx (void)
     return have_vmx;
 }
 
-#else /* !__APPLE__ && !__linux__ */
+#else /* !__APPLE__ && !__OpenBSD__ && !__linux__ */
 #include <signal.h>
 #include <setjmp.h>
 
-- 
1.7.1.1
_______________________________________________
Pixman mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to