Subject: Re: help with libvisual
To: Davide Zanon <d.zanon@infinito.it>
From: Thomas Klausner <wiz@NetBSD.org>
List: port-macppc
Date: 05/24/2005 17:01:18
--ZJcv+A0YCCLh2VIg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Tue, May 24, 2005 at 01:07:09PM +0000, Davide Zanon wrote:
> $ sysctl -a | grep alti
> machdep.altivec = 1
Looks good. Try the attached untested replacement for
libvisual/patches/patch-aa (replace it, do 'make mps', 'make clean',
'make') and tell me how it goes.
Thomas
--ZJcv+A0YCCLh2VIg
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=patch-aa
$NetBSD: patch-aa,v 1.3 2005/05/24 12:29:40 wiz Exp $
--- libvisual/lv_cpu.c.orig 2005-02-09 20:20:12.000000000 +0100
+++ libvisual/lv_cpu.c
@@ -140,8 +140,12 @@ static void sigill_handler (int sig)
static void check_os_altivec_support( void )
{
+#if defined(VISUAL_OS_DARWIN) || defined(VISUAL_OS_NETBSD)
#if defined(VISUAL_OS_DARWIN)
int sels[2] = {CTL_HW, HW_VECTORUNIT};
+#else
+ int sels[2] = {HW_MACHINE, CPU_ALTIVEC};
+#endif
int has_vu = 0;
size_t len = sizeof(has_vu);
int err;
@@ -354,7 +358,7 @@ void visual_cpu_initialize ()
#endif
/* Count the number of CPUs in system */
-#if !defined(VISUAL_OS_WIN32) && !defined(VISUAL_OS_UNKNOWN)
+#if !defined(VISUAL_OS_WIN32) && !defined(VISUAL_OS_UNKNOWN) && defined(_SC_NPROCESSORS_ONLN)
_lv_cpu_caps.nrcpu = sysconf (_SC_NPROCESSORS_ONLN);
if (_lv_cpu_caps.nrcpu == -1)
_lv_cpu_caps.nrcpu = 1;
@@ -423,7 +427,7 @@ void visual_cpu_initialize ()
#endif
#endif /* VISUAL_ARCH_X86 */
-#if VISUAL_ARCH_POWERPC
+#if defined(VISUAL_ARCH_POWERPC)
check_os_altivec_support ();
#endif /* VISUAL_ARCH_POWERPC */
--ZJcv+A0YCCLh2VIg--