From 03d298ebbcbc8a097bd5e800ce32c75dd4365569 Mon Sep 17 00:00:00 2001 From: Juergen Keil Date: Tue, 11 Mar 2003 16:07:22 +0000 Subject: Disable some debug output on x86, when the OS doesn't support SSE. CVS patchset: 4394 CVS date: 2003/03/11 16:07:22 --- src/xine-utils/cpu_accel.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index 7acb0ee25..feca22e51 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -29,6 +29,10 @@ #include "attributes.h" #include "xineutils.h" +/* +#define LOG +*/ + #ifdef ARCH_X86 static uint32_t arch_accel (void) { @@ -112,7 +116,6 @@ static uint32_t arch_accel (void) static jmp_buf sigill_return; static void sigill_handler (int n) { - printf ("cpu_accel: OS doesn't support SSE instructions.\n"); longjmp(sigill_return, 1); } #endif /* ARCH_X86 */ @@ -164,13 +167,20 @@ uint32_t xine_mm_accel (void) #ifdef ARCH_X86 /* test OS support for SSE */ if( accel & MM_ACCEL_X86_SSE ) { + void (*old_sigill_handler)(int); + + old_sigill_handler = signal (SIGILL, sigill_handler); + if (setjmp(sigill_return)) { +#ifdef LOG + printf ("cpu_accel: OS doesn't support SSE instructions.\n"); +#endif accel &= ~(MM_ACCEL_X86_SSE|MM_ACCEL_X86_SSE2); } else { - signal (SIGILL, sigill_handler); __asm__ volatile ("xorps %xmm0, %xmm0"); - signal (SIGILL, SIG_DFL); } + + signal (SIGILL, old_sigill_handler); } #endif /* ARCH_X86 */ -- cgit v1.2.3