pkgsrc/devel/liboil/patches/patch-ad
wiz 3c1a4c919f Update to 0.3.16:
Version bump
if's need else's. Fix previous commit
Wrap force_align_arg_pointer in HAVE_I386
Add AltiVec detection support for OpenBSD
Fix double free on failed arm_init
Add SSE detection support for OpenBSD
init: shortcut benchmarking, if there is only one runable implementation.
Add x86_64/amd64 to unaligned access whitelist
Add cris to unaligned access whitelist
remove ltdl.m4
Clean up function prototypes used for casting
bump version
Remove ' DATA' from symbol list
Add srcdir to includes for out-of-source builds
Fix cpu detection on OS/X
Add avg2_32xn_u8
2009-03-22 21:02:17 +00:00

68 lines
1.9 KiB
Text

$NetBSD: patch-ad,v 1.5 2009/03/22 21:02:17 wiz Exp $
Provide proper detection of altivec on NetBSD/powerpc ports.
--- liboil/liboilcpu-powerpc.c.orig 2009-02-26 19:50:42.000000000 +0000
+++ liboil/liboilcpu-powerpc.c
@@ -59,6 +59,12 @@
#include <sys/sysctl.h>
#endif
+#if defined(__NetBSD__)
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
+#endif
+
#if defined(__OpenBSD__)
#include <sys/param.h>
#include <sys/sysctl.h>
@@ -75,7 +81,7 @@ oil_profile_stamp_tb(void)
return ts;
}
-#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(__linux__)
+#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(__linux__) && !defined(__NetBSD__)
static void
test_altivec (void * ignored)
{
@@ -83,6 +89,21 @@ test_altivec (void * ignored)
}
#endif
+#if defined(__NetBSD__)
+static void
+oil_check_altivec_sysctl_netbsd (void)
+{
+ int ret, av;
+ size_t len;
+
+ len = sizeof(av);
+ ret = sysctlbyname("machdep.altivec", &av, &len, NULL, 0);
+ if (!ret && av) {
+ oil_cpu_flags |= OIL_IMPL_FLAG_ALTIVEC;
+ }
+}
+#endif
+
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
static void
oil_check_altivec_sysctl_freebsd (void)
@@ -181,7 +202,7 @@ out:
}
#endif
-#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(__linux__)
+#if !defined(__FreeBSD__) && !defined(__FreeBSD_kernel__) && !defined(__OpenBSD__) && !defined(__APPLE__) && !defined(__linux__) && !defined(__NetBSD__)
static void
oil_check_altivec_fault (void)
{
@@ -199,6 +220,8 @@ oil_cpu_detect_arch(void)
{
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
oil_check_altivec_sysctl_freebsd();
+#elif defined(__NetBSD__)
+ oil_check_altivec_sysctl_netbsd();
#elif defined(__OpenBSD__)
oil_check_altivec_sysctl_openbsd();
#elif defined(__APPLE__)