Lines 5-13
static inline void __cpuid(unsigned int *eax, unsigned int *ebx,
Link Here
|
5 |
unsigned int *ecx, unsigned int *edx) |
5 |
unsigned int *ecx, unsigned int *edx) |
6 |
{ |
6 |
{ |
7 |
/* ecx is often an input as well as an output. */ |
7 |
/* ecx is often an input as well as an output. */ |
8 |
asm volatile("cpuid" |
8 |
asm volatile( |
|
|
9 |
#if defined(__i386__) && defined(__PIC__) |
10 |
"push %%ebx\n" |
11 |
"cpuid\n" |
12 |
"movl %%ebx, %1\n" |
13 |
"pop %%ebx\n" |
14 |
#else |
15 |
"cpuid\n" |
16 |
#endif |
9 |
: "=a" (*eax), |
17 |
: "=a" (*eax), |
|
|
18 |
#if defined(__i386__) && defined(__PIC__) |
19 |
"=r" (*ebx), |
20 |
#else |
10 |
"=b" (*ebx), |
21 |
"=b" (*ebx), |
|
|
22 |
#endif |
11 |
"=c" (*ecx), |
23 |
"=c" (*ecx), |
12 |
"=d" (*edx) |
24 |
"=d" (*edx) |
13 |
: "0" (*eax), "2" (*ecx)); |
25 |
: "0" (*eax), "2" (*ecx)); |
14 |
- |
|
|