diff options
author | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-11-14 23:49:53 +0000 |
---|---|---|
committer | Guenter Bartsch <guenter@users.sourceforge.net> | 2001-11-14 23:49:53 +0000 |
commit | 974b136b28fbdd2d488828492712d2a5e2c0e886 (patch) | |
tree | f4f6a1601eaf6788a33cac9d080dd309108bd873 /src | |
parent | 568b476edc6a257bf124c646de5cb06a6a578dbf (diff) | |
download | xine-lib-974b136b28fbdd2d488828492712d2a5e2c0e886.tar.gz xine-lib-974b136b28fbdd2d488828492712d2a5e2c0e886.tar.bz2 |
catch sigill in memcpy probing
CVS patchset: 1036
CVS date: 2001/11/14 23:49:53
Diffstat (limited to 'src')
-rw-r--r-- | src/xine-utils/memcpy.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/xine-utils/memcpy.c b/src/xine-utils/memcpy.c index 5ded24ebc..2d644d4a9 100644 --- a/src/xine-utils/memcpy.c +++ b/src/xine-utils/memcpy.c @@ -35,6 +35,8 @@ #include <stdlib.h> #include <string.h> +#include <signal.h> +#include <setjmp.h> #include "xine_internal.h" #include "cpu_accel.h" @@ -388,6 +390,15 @@ static unsigned long long int rdtsc() } #endif +static jmp_buf sigill_return; + +static void sigill_handler (int n) { + + printf ("memcpy: SIGILL catched\n"); + + longjmp(sigill_return, 1); +} + #define BUFSIZE 1024*1024 void probe_fast_memcpy(config_values_t *config) @@ -434,12 +445,20 @@ void probe_fast_memcpy(config_values_t *config) if( (config_flags & memcpy_method[i].cpu_require) != memcpy_method[i].cpu_require ) continue; - + + if (setjmp(sigill_return)) + continue; + + signal (SIGILL, sigill_handler); + t = rdtsc(); for(j=0;j<50;j++) { memcpy_method[i].function(buf2,buf1,BUFSIZE); memcpy_method[i].function(buf1,buf2,BUFSIZE); } + + signal (SIGILL, SIG_DFL); + t = rdtsc() - t; memcpy_method[i].time = t; |