diff i386/cputest.c @ 16:89bc3bf1a031 libavcodec

added external cpuid code to solve -fPIC and gcc unclear constraints problems
author glantau
date Mon, 30 Jul 2001 23:51:20 +0000
parents b8374040680d
children c31fb57d17a6
line wrap: on
line diff
--- a/i386/cputest.c	Mon Jul 30 23:50:04 2001 +0000
+++ b/i386/cputest.c	Mon Jul 30 23:51:20 2001 +0000
@@ -4,18 +4,8 @@
 #include <stdlib.h>
 #include "../dsputil.h"
 
-/* ebx saving is necessary for PIC. gcc seems unable to see it alone */
-static inline void cpuid(int index, int *eax, int *ebx, int *ecx, int *edx)
-{
-    asm ("pushl %%ebx\n\t"
-         "cpuid\n\t"
-         "movl %%ebx, %1\n\t"
-         "popl %%ebx\n\t"
-         : "=a" (*eax), "=m" (*ebx), 
-           "=c" (*ecx), "=d" (*edx)
-         : "a" (index)
-         : "cc");
-}
+/* need this external function to solve -fPIC ebx issues ! */
+extern void cpuid(int index, int *eax, int *ebx, int *ecx, int *edx);
 
 /* Function to test if multimedia instructions are supported...  */
 int mm_support(void)