cpudetect.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * This file is part of MPlayer.
  3. *
  4. * MPlayer is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * MPlayer is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with MPlayer; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. #ifndef MPLAYER_CPUDETECT_H
  19. #define MPLAYER_CPUDETECT_H
  20. //#include "config.h"
  21. #define CPUTYPE_I386 3
  22. #define CPUTYPE_I486 4
  23. #define CPUTYPE_I586 5
  24. #define CPUTYPE_I686 6
  25. #include "libavutil/x86_cpu.h"
  26. typedef struct cpucaps_s {
  27. int cpuType;
  28. int cpuModel;
  29. int cpuStepping;
  30. int hasMMX;
  31. int hasMMX2;
  32. int has3DNow;
  33. int has3DNowExt;
  34. int hasSSE;
  35. int hasSSE2;
  36. int hasSSE3;
  37. int hasSSSE3;
  38. int hasSSE4a;
  39. int isX86;
  40. unsigned cl_size; /* size of cache line */
  41. int hasAltiVec;
  42. int hasTSC;
  43. } CpuCaps;
  44. extern CpuCaps gCpuCaps;
  45. void do_cpuid(unsigned int ax, unsigned int *p);
  46. void GetCpuCaps(CpuCaps *caps);
  47. /* returned value is malloc()'ed so free() it after use */
  48. char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]);
  49. #endif /* MPLAYER_CPUDETECT_H */