Fix segfault if an 'strf' chunk couldn't be found in avi
[mplayer/glamo.git] / cpudetect.h
blob27bc6b856fa5b1e2f74b7d41a036b17e6dc236a8
1 #ifndef CPUDETECT_H
2 #define CPUDETECT_H
4 #define CPUTYPE_I386 3
5 #define CPUTYPE_I486 4
6 #define CPUTYPE_I586 5
7 #define CPUTYPE_I686 6
9 #ifdef ARCH_X86_64
10 # define REGa rax
11 # define REGb rbx
12 # define REGBP rbp
13 # define REGSP rsp
14 # define REG_a "rax"
15 # define REG_b "rbx"
16 # define REG_c "rcx"
17 # define REG_d "rdx"
18 # define REG_S "rsi"
19 # define REG_D "rdi"
20 # define REG_SP "rsp"
21 # define REG_BP "rbp"
22 #else
23 # define REGa eax
24 # define REGb ebx
25 # define REGBP ebp
26 # define REGSP esp
27 # define REG_a "eax"
28 # define REG_b "ebx"
29 # define REG_c "ecx"
30 # define REG_d "edx"
31 # define REG_S "esi"
32 # define REG_D "edi"
33 # define REG_SP "esp"
34 # define REG_BP "ebp"
35 #endif
37 typedef struct cpucaps_s {
38 int cpuType;
39 int cpuModel;
40 int cpuStepping;
41 int hasMMX;
42 int hasMMX2;
43 int has3DNow;
44 int has3DNowExt;
45 int hasSSE;
46 int hasSSE2;
47 int isX86;
48 unsigned cl_size; /* size of cache line */
49 int hasAltiVec;
50 int hasTSC;
51 } CpuCaps;
53 extern CpuCaps gCpuCaps;
55 void GetCpuCaps(CpuCaps *caps);
57 /* returned value is malloc()'ed so free() it after use */
58 char *GetCpuFriendlyName(unsigned int regs[], unsigned int regs2[]);
60 #endif /* !CPUDETECT_H */