aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/ppc
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2007-10-02 18:18:35 +0000
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2007-10-02 18:18:35 +0000
commitd9a5dab2da1220b5bec718d343ecc30e22084676 (patch)
treef5128ae9113732312f748f49749bdd17caf40d1a /libavcodec/ppc
parente0d21bfe835eec87b8c0efe6e9973ae5f588bc07 (diff)
downloadffmpeg-d9a5dab2da1220b5bec718d343ecc30e22084676.tar.gz
Remove uses of SIGILL for CPU extension detection, that method is not acceptable
in a library. Should not change anything for PPC, the autodetection is currently pointless due to other code being compiled with -maltivec as well (and detection for OSX and AmigaOS remains in place). SPARC binaries built with VIS support can now only run on systems with VIS. Originally committed as revision 10648 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/ppc')
-rw-r--r--libavcodec/ppc/check_altivec.c38
1 files changed, 3 insertions, 35 deletions
diff --git a/libavcodec/ppc/check_altivec.c b/libavcodec/ppc/check_altivec.c
index 72b4afe48a..b3778cab31 100644
--- a/libavcodec/ppc/check_altivec.c
+++ b/libavcodec/ppc/check_altivec.c
@@ -28,23 +28,6 @@
#include <exec/exec.h>
#include <interfaces/exec.h>
#include <proto/exec.h>
-#else
-#include <signal.h>
-#include <setjmp.h>
-
-static sigjmp_buf jmpbuf;
-static volatile sig_atomic_t canjump = 0;
-
-static void sigill_handler (int sig)
-{
- if (!canjump) {
- signal (sig, SIG_DFL);
- raise (sig);
- }
-
- canjump = 0;
- siglongjmp (jmpbuf, 1);
-}
#endif /* __APPLE__ */
/**
@@ -72,24 +55,9 @@ int has_altivec(void)
if (err == 0) return (has_vu != 0);
return 0;
#else
-/* Do it the brute-force way, borrowed from the libmpeg2 library. */
- {
- signal (SIGILL, sigill_handler);
- if (sigsetjmp (jmpbuf, 1)) {
- signal (SIGILL, SIG_DFL);
- } else {
- canjump = 1;
-
- asm volatile ("mtspr 256, %0\n\t"
- "vand %%v0, %%v0, %%v0"
- :
- : "r" (-1));
-
- signal (SIGILL, SIG_DFL);
- return 1;
- }
- }
- return 0;
+ // since we were compiled for altivec, just assume we have it
+ // until someone comes up with a proper way (not involving signal hacks).
+ return 1;
#endif /* __AMIGAOS4__ */
}