|
Lines 72-80
Link Here
|
| 72 |
|
72 |
|
| 73 |
#ifdef __i386__ |
73 |
#ifdef __i386__ |
| 74 |
|
74 |
|
| 75 |
#define cpuid_up(in,a,b,c,d)\ |
|
|
| 76 |
asm("cpuid": "=a" (a), "=b" (b), "=c" (c), "=d" (d) : "a" (in)); |
| 77 |
|
| 78 |
static void cpuid(int cpunumber, |
75 |
static void cpuid(int cpunumber, |
| 79 |
unsigned long idx, |
76 |
unsigned long idx, |
| 80 |
unsigned long &eax, |
77 |
unsigned long &eax, |
|
Lines 100-106
Link Here
|
| 100 |
edx = (*(unsigned long *) (buffer + 12)); |
97 |
edx = (*(unsigned long *) (buffer + 12)); |
| 101 |
} |
98 |
} |
| 102 |
else |
99 |
else |
| 103 |
cpuid_up(idx, eax, ebx, ecx, edx); |
100 |
asm( |
|
|
101 |
#ifdef __PIC__ |
| 102 |
"movl %%ebx,%%edi\n" |
| 103 |
"cpuid\n" |
| 104 |
"movl %%ebx,%3\n" |
| 105 |
"movl %%edi,%%ebx\n" |
| 106 |
: "=a" (eax), "=c" (ecx), "=d" (edx), "=m" (ebx) |
| 107 |
: "a" (idx) |
| 108 |
: "edi" |
| 109 |
#else |
| 110 |
"cpuid\n" |
| 111 |
: "=a" (eax), "=c" (ecx), "=d" (edx), "=b" (ebx) |
| 112 |
: "a" (idx) |
| 113 |
#endif |
| 114 |
); |
| 104 |
} |
115 |
} |
| 105 |
|
116 |
|
| 106 |
|
117 |
|