]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - include/asm-x86/processor.h
1 #ifndef __ASM_X86_PROCESSOR_H
2 #define __ASM_X86_PROCESSOR_H
4 static inline void native_cpuid(unsigned int *eax
, unsigned int *ebx
,
5 unsigned int *ecx
, unsigned int *edx
)
7 /* ecx is often an input as well as an output. */
13 : "0" (*eax
), "2" (*ecx
));
18 # include "processor_32.h"
20 # include "processor_64.h"
23 #ifndef CONFIG_PARAVIRT
24 #define __cpuid native_cpuid
28 * Generic CPUID function
29 * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx
30 * resulting in stale register contents being returned.
32 static inline void cpuid(unsigned int op
,
33 unsigned int *eax
, unsigned int *ebx
,
34 unsigned int *ecx
, unsigned int *edx
)
38 __cpuid(eax
, ebx
, ecx
, edx
);
41 /* Some CPUID calls want 'count' to be placed in ecx */
42 static inline void cpuid_count(unsigned int op
, int count
,
43 unsigned int *eax
, unsigned int *ebx
,
44 unsigned int *ecx
, unsigned int *edx
)
48 __cpuid(eax
, ebx
, ecx
, edx
);
52 * CPUID functions returning a single datum
54 static inline unsigned int cpuid_eax(unsigned int op
)
56 unsigned int eax
, ebx
, ecx
, edx
;
58 cpuid(op
, &eax
, &ebx
, &ecx
, &edx
);
61 static inline unsigned int cpuid_ebx(unsigned int op
)
63 unsigned int eax
, ebx
, ecx
, edx
;
65 cpuid(op
, &eax
, &ebx
, &ecx
, &edx
);
68 static inline unsigned int cpuid_ecx(unsigned int op
)
70 unsigned int eax
, ebx
, ecx
, edx
;
72 cpuid(op
, &eax
, &ebx
, &ecx
, &edx
);
75 static inline unsigned int cpuid_edx(unsigned int op
)
77 unsigned int eax
, ebx
, ecx
, edx
;
79 cpuid(op
, &eax
, &ebx
, &ecx
, &edx
);