annotate cpudetect.h @ 36319:4e5239ebd43d

Avoid some code duplication.
author reimar
date Fri, 09 Aug 2013 20:11:22 +0000
parents 3e1a4184b70e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30429
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
1 /*
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
2 * This file is part of MPlayer.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
3 *
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
5 * it under the terms of the GNU General Public License as published by
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
7 * (at your option) any later version.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
8 *
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
12 * GNU General Public License for more details.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
13 *
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
14 * You should have received a copy of the GNU General Public License along
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
17 */
c1a3f1bbba26 Add license header to all top-level files missing them.
diego
parents: 29039
diff changeset
18
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25530
diff changeset
19 #ifndef MPLAYER_CPUDETECT_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25530
diff changeset
20 #define MPLAYER_CPUDETECT_H
2268
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
21
31077
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
22 #define CPUTYPE_I386 3
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
23 #define CPUTYPE_I486 4
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
24 #define CPUTYPE_I586 5
2281
arpi
parents: 2280
diff changeset
25 #define CPUTYPE_I686 6
2268
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
26
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
27 typedef struct cpucaps_s {
31077
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
28 int cpuType;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
29 int cpuModel;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
30 int cpuStepping;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
31 int hasMMX;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
32 int hasMMX2;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
33 int has3DNow;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
34 int has3DNowExt;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
35 int hasSSE;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
36 int hasSSE2;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
37 int hasSSE3;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
38 int hasSSSE3;
35101
3e1a4184b70e Add SSE3, SSE4, SSE4.2 and AVX detection.
cehoyos
parents: 34198
diff changeset
39 int hasSSE4;
3e1a4184b70e Add SSE3, SSE4, SSE4.2 and AVX detection.
cehoyos
parents: 34198
diff changeset
40 int hasSSE42;
31077
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
41 int hasSSE4a;
35101
3e1a4184b70e Add SSE3, SSE4, SSE4.2 and AVX detection.
cehoyos
parents: 34198
diff changeset
42 int hasAVX;
31077
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
43 int isX86;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
44 unsigned cl_size; /* size of cache line */
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
45 int hasAltiVec;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
46 int hasTSC;
2268
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
47 } CpuCaps;
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
48
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
49 extern CpuCaps gCpuCaps;
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
50
31826
f3aed7bffcbb Reuse do_cpuid from cpudetect.c in loader/win32.c.
reimar
parents: 31077
diff changeset
51 void do_cpuid(unsigned int ax, unsigned int *p);
f3aed7bffcbb Reuse do_cpuid from cpudetect.c in loader/win32.c.
reimar
parents: 31077
diff changeset
52
2301
b4c4c832cce7 Detect and show cpu name.
atmos4
parents: 2281
diff changeset
53 void GetCpuCaps(CpuCaps *caps);
2303
456e22bfb147 returns a malloc()'ed string instead of an auto char[]
pl
parents: 2301
diff changeset
54
456e22bfb147 returns a malloc()'ed string instead of an auto char[]
pl
parents: 2301
diff changeset
55 /* returned value is malloc()'ed so free() it after use */
2301
b4c4c832cce7 Detect and show cpu name.
atmos4
parents: 2281
diff changeset
56 char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]);
2268
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
57
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25530
diff changeset
58 #endif /* MPLAYER_CPUDETECT_H */