CPUID: Difference between revisions
[unchecked revision] | [unchecked revision] |
Content deleted Content added
m Correction to cpuid_string. It was returning value of uninitialized local variable. |
m Correction to inline asm; input constraint for EAX input was "0" instead of "a" |
||
Line 157:
*/
static inline void cpuid(int code, dword *a, dword *d) {
asm volatile("cpuid":"=a"(*a),"=d"(*d):"
}
Line 164:
static inline int cpuid_string(int code, dword where[4]) {
asm volatile("cpuid":"=a"(*where),"=b"(*(where+1)),
"=c"(*(where+2)),"=d"(*(where+3)):"
return (int)where[0];
}
|