summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-08-02 17:39:20 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:15:01 +0200
commit04ce30b2fd2d47138da25b759d20d68a89feacdb (patch)
tree801e615ab1d43917b39d7e12e21cb7aa50fe306a
parent4843c8d7d944edf2b364110baf44588e44418f11 (diff)
downloadmpv-04ce30b2fd2d47138da25b759d20d68a89feacdb.tar.bz2
mpv-04ce30b2fd2d47138da25b759d20d68a89feacdb.tar.xz
loader: Reuse do_cpuid from cpudetect.c in loader/win32.c
Also avoids several "used uninitialized" warnings. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31905 b3059339-0415-0410-9bf9-f77b7e298cf2
-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;