1 #ifndef __ASM_X86_PROCESSOR_H
2 #define __ASM_X86_PROCESSOR_H
4 #include <asm/processor-flags.h>
7 #include <asm/system.h>
9 static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
10 unsigned int *ecx, unsigned int *edx)
12 /* ecx is often an input as well as an output. */
18 : "0" (*eax), "2" (*ecx));
21 static inline void load_cr3(pgd_t *pgdir)
23 write_cr3(__pa(pgdir));
27 # include "processor_32.h"
29 # include "processor_64.h"
32 #ifndef CONFIG_PARAVIRT
33 #define __cpuid native_cpuid
37 * Generic CPUID function
38 * clear %ecx since some cpus (Cyrix MII) do not set or clear %ecx
39 * resulting in stale register contents being returned.
41 static inline void cpuid(unsigned int op,
42 unsigned int *eax, unsigned int *ebx,
43 unsigned int *ecx, unsigned int *edx)
47 __cpuid(eax, ebx, ecx, edx);
50 /* Some CPUID calls want 'count' to be placed in ecx */
51 static inline void cpuid_count(unsigned int op, int count,
52 unsigned int *eax, unsigned int *ebx,
53 unsigned int *ecx, unsigned int *edx)
57 __cpuid(eax, ebx, ecx, edx);
61 * CPUID functions returning a single datum
63 static inline unsigned int cpuid_eax(unsigned int op)
65 unsigned int eax, ebx, ecx, edx;
67 cpuid(op, &eax, &ebx, &ecx, &edx);
70 static inline unsigned int cpuid_ebx(unsigned int op)
72 unsigned int eax, ebx, ecx, edx;
74 cpuid(op, &eax, &ebx, &ecx, &edx);
77 static inline unsigned int cpuid_ecx(unsigned int op)
79 unsigned int eax, ebx, ecx, edx;
81 cpuid(op, &eax, &ebx, &ecx, &edx);
84 static inline unsigned int cpuid_edx(unsigned int op)
86 unsigned int eax, ebx, ecx, edx;
88 cpuid(op, &eax, &ebx, &ecx, &edx);