| 88 | |
| 89 | #ifndef _MSC_VER |
| 90 | static void do_cpuid(uint32_t eax, uint32_t ecx, uint32_t* regs) |
| 91 | { |
| 92 | uint32_t ebx = 0, edx = 0; |
| 93 | |
| 94 | #if defined(__PIC__) && defined(__i386__) |
| 95 | __asm__("movl %%ebx, %%edi;" |
| 96 | "cpuid;" |
| 97 | "xchgl %%ebx, %%edi;" |
| 98 | : "=D"(ebx), "+a"(eax), "+c"(ecx), "=d"(edx)); |
| 99 | #else |
| 100 | __asm__("cpuid;" : "+b"(ebx), "+a"(eax), "+c"(ecx), "=d"(edx)); |
| 101 | #endif |
| 102 | |
| 103 | regs[0] = eax; regs[1] = ebx; regs[2] = ecx; regs[3] = edx; |
| 104 | } |
| 105 | #endif |
| 106 | |
| 107 | static void get_cpuinfo(cpu_info &info) |