Rev 2071 | Rev 2082 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2071 | Rev 2079 | ||
---|---|---|---|
Line 35... | Line 35... | ||
35 | #ifndef KERN_ia32_CPUID_H_ |
35 | #ifndef KERN_ia32_CPUID_H_ |
36 | #define KERN_ia32_CPUID_H_ |
36 | #define KERN_ia32_CPUID_H_ |
37 | 37 | ||
38 | #include <arch/types.h> |
38 | #include <arch/types.h> |
39 | 39 | ||
40 | struct cpu_info { |
40 | typedef struct { |
41 | uint32_t cpuid_eax; |
41 | uint32_t cpuid_eax; |
42 | uint32_t cpuid_ebx; |
42 | uint32_t cpuid_ebx; |
43 | uint32_t cpuid_ecx; |
43 | uint32_t cpuid_ecx; |
44 | uint32_t cpuid_edx; |
44 | uint32_t cpuid_edx; |
45 | } __attribute__ ((packed)); |
45 | } __attribute__ ((packed)) cpu_info_t; |
46 | 46 | ||
47 | struct __cpuid_extended_feature_info { |
47 | struct __cpuid_extended_feature_info { |
48 | unsigned sse3 : 1; |
48 | unsigned sse3 : 1; |
49 | unsigned : 31; |
49 | unsigned : 31; |
50 | } __attribute__ ((packed)); |
50 | } __attribute__ ((packed)); |
Line 95... | Line 95... | ||
95 | ); |
95 | ); |
96 | 96 | ||
97 | return ret; |
97 | return ret; |
98 | } |
98 | } |
99 | 99 | ||
100 | static inline void cpuid(uint32_t cmd, struct cpu_info *info) |
100 | static inline void cpuid(uint32_t cmd, cpu_info_t *info) |
101 | { |
101 | { |
102 | __asm__ volatile ( |
102 | __asm__ volatile ( |
103 | "movl %4, %%eax\n" |
103 | "movl %4, %%eax\n" |
104 | "cpuid\n" |
104 | "cpuid\n" |
105 | 105 |