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
This commit is contained in:
reimar 2010-08-02 17:39:20 +00:00 committed by Uoti Urpala
parent 4843c8d7d9
commit 04ce30b2fd
3 changed files with 4 additions and 16 deletions

View File

@ -89,7 +89,7 @@ static int has_cpuid(void)
#endif
}
static void
void
do_cpuid(unsigned int ax, unsigned int *p)
{
// code from libavcodec:

View File

@ -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 */

View File

@ -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;