summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cpudetect.c2
-rw-r--r--cpudetect.h2
-rw-r--r--loader/win32.c16
3 files changed, 4 insertions, 16 deletions
diff --git a/cpudetect.c b/cpudetect.c
index d39026ea40..d394bdcdab 100644
--- a/cpudetect.c
+++ b/cpudetect.c
@@ -89,7 +89,7 @@ static int has_cpuid(void)
#endif
}
-static void
+void
do_cpuid(unsigned int ax, unsigned int *p)
{
// code from libavcodec:
diff --git a/cpudetect.h b/cpudetect.h
index 38a7b79d11..5ff6c5a78b 100644
--- a/cpudetect.h
+++ b/cpudetect.h
@@ -49,6 +49,8 @@ typedef struct cpucaps_s {
extern CpuCaps gCpuCaps;
+void do_cpuid(unsigned int ax, unsigned int *p);
+
void GetCpuCaps(CpuCaps *caps);
/* returned value is malloc()'ed so free() it after use */
diff --git a/loader/win32.c b/loader/win32.c
index becfd51e85..13ac8d4a28 100644
--- a/loader/win32.c
+++ b/loader/win32.c
@@ -76,22 +76,8 @@ for DLL to know too much about its environment.
#endif
#include "osdep/mmap_anon.h"
#include "libavutil/avstring.h"
+#include "cpudetect.h"
-static void do_cpuid(unsigned int ax, unsigned int *regs)
-{
- __asm__ volatile
- (
- "pushl %%ebx; pushl %%ecx; pushl %%edx;"
- ".byte 0x0f, 0xa2;"
- "movl %%eax, (%2);"
- "movl %%ebx, 4(%2);"
- "movl %%ecx, 8(%2);"
- "movl %%edx, 12(%2);"
- "popl %%edx; popl %%ecx; popl %%ebx;"
- : "=a" (ax)
- : "0" (ax), "S" (regs)
- );
-}
static unsigned int c_localcount_tsc(void)
{
int a;