annotate cpudetect.h @ 32963:ce00479b68ce

Cosmetic: Format to MPlayer coding style. Additionally: sort prototype declarations, remove useless comment at top of file, add comment to include file, group and sort includes, move assignment outside condition, group statements by adding or removing new lines to ease reading and remove needless parentheses and braces.
author ib
date Tue, 08 Mar 2011 12:29:44 +0000
parents f3aed7bffcbb
children 064be070d8c8
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
28629
b089d639e810 Add necessary header for ARCH_X86_64 preprocessor check.
diego
parents: 28288
diff changeset
22 #include "config.h"
b089d639e810 Add necessary header for ARCH_X86_64 preprocessor check.
diego
parents: 28288
diff changeset
23
31077
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
24 #define CPUTYPE_I386 3
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
25 #define CPUTYPE_I486 4
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
26 #define CPUTYPE_I586 5
2281
arpi
parents: 2280
diff changeset
27 #define CPUTYPE_I686 6
2268
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
28
29039
ce682f8d1f68 Directly include libavutil/x86_cpu.h in cpudetect.h instead of duplicating it
reimar
parents: 28901
diff changeset
29 #include "libavutil/x86_cpu.h"
13720
821f464b4d90 adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents: 10885
diff changeset
30
2268
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
31 typedef struct cpucaps_s {
31077
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
32 int cpuType;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
33 int cpuModel;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
34 int cpuStepping;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
35 int hasMMX;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
36 int hasMMX2;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
37 int has3DNow;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
38 int has3DNowExt;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
39 int hasSSE;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
40 int hasSSE2;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
41 int hasSSE3;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
42 int hasSSSE3;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
43 int hasSSE4a;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
44 int isX86;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
45 unsigned cl_size; /* size of cache line */
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
46 int hasAltiVec;
dd7f15a3fb1b the great MPlayer tab removal: part II
diego
parents: 30429
diff changeset
47 int hasTSC;
2268
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
48 } CpuCaps;
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
49
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
50 extern CpuCaps gCpuCaps;
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
51
31826
f3aed7bffcbb Reuse do_cpuid from cpudetect.c in loader/win32.c.
reimar
parents: 31077
diff changeset
52 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
53
2301
b4c4c832cce7 Detect and show cpu name.
atmos4
parents: 2281
diff changeset
54 void GetCpuCaps(CpuCaps *caps);
2303
456e22bfb147 returns a malloc()'ed string instead of an auto char[]
pl
parents: 2301
diff changeset
55
456e22bfb147 returns a malloc()'ed string instead of an auto char[]
pl
parents: 2301
diff changeset
56 /* returned value is malloc()'ed so free() it after use */
2301
b4c4c832cce7 Detect and show cpu name.
atmos4
parents: 2281
diff changeset
57 char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]);
2268
72ff2179d396 cpu detect code by Eric Anholt <eanholt@gladstone.uoregon.edu>
arpi
parents:
diff changeset
58
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25530
diff changeset
59 #endif /* MPLAYER_CPUDETECT_H */