libavfilter/libmpcodecs/cpudetect.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of MPlayer.
00003  *
00004  * MPlayer is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  *
00009  * MPlayer is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License along
00015  * with MPlayer; if not, write to the Free Software Foundation, Inc.,
00016  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00017  */
00018 
00019 #ifndef MPLAYER_CPUDETECT_H
00020 #define MPLAYER_CPUDETECT_H
00021 
00022 //#include "config.h"
00023 
00024 #define CPUTYPE_I386    3
00025 #define CPUTYPE_I486    4
00026 #define CPUTYPE_I586    5
00027 #define CPUTYPE_I686    6
00028 
00029 #include "libavutil/x86_cpu.h"
00030 
00031 typedef struct cpucaps_s {
00032     int cpuType;
00033     int cpuModel;
00034     int cpuStepping;
00035     int hasMMX;
00036     int hasMMX2;
00037     int has3DNow;
00038     int has3DNowExt;
00039     int hasSSE;
00040     int hasSSE2;
00041     int hasSSE3;
00042     int hasSSSE3;
00043     int hasSSE4a;
00044     int isX86;
00045     unsigned cl_size; /* size of cache line */
00046     int hasAltiVec;
00047     int hasTSC;
00048 } CpuCaps;
00049 
00050 extern CpuCaps gCpuCaps;
00051 
00052 void do_cpuid(unsigned int ax, unsigned int *p);
00053 
00054 void GetCpuCaps(CpuCaps *caps);
00055 
00056 /* returned value is malloc()'ed so free() it after use */
00057 char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]);
00058 
00059 #endif /* MPLAYER_CPUDETECT_H */