Rev 2079 | Rev 2316 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2079 | Rev 2082 | ||
---|---|---|---|
Line 74... | Line 74... | ||
74 | 74 | ||
75 | static inline uint32_t has_cpuid(void) |
75 | static inline uint32_t has_cpuid(void) |
76 | { |
76 | { |
77 | uint32_t val, ret; |
77 | uint32_t val, ret; |
78 | 78 | ||
79 | __asm__ volatile ( |
79 | asm volatile ( |
80 | "pushf\n" /* read flags */ |
80 | "pushf\n" /* read flags */ |
81 | "popl %0\n" |
81 | "popl %0\n" |
82 | "movl %0, %1\n" |
82 | "movl %0, %1\n" |
83 | 83 | ||
84 | "btcl $21, %1\n" /* swap the ID bit */ |
84 | "btcl $21, %1\n" /* swap the ID bit */ |
Line 97... | Line 97... | ||
97 | return ret; |
97 | return ret; |
98 | } |
98 | } |
99 | 99 | ||
100 | static inline void cpuid(uint32_t cmd, cpu_info_t *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 | ||
106 | "movl %%eax, %0\n" |
106 | "movl %%eax, %0\n" |
107 | "movl %%ebx, %1\n" |
107 | "movl %%ebx, %1\n" |