Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static unsigned int cpuid_getreg(unsigned int f, int reg)
- {
- __asm__ (
- "movl %0, %%eax" : : \
- "r" (f) : "%eax" );
- __asm__ (
- "cpuid"
- );
- switch(reg)
- {
- case MCR_EAX: { register unsigned int t __asm__("%eax"); return t; }
- case MCR_EBX: { register unsigned int t __asm__("%ebx"); return t; }
- case MCR_ECX: { register unsigned int t __asm__("%ecx"); return t; }
- case MCR_EDX: { register unsigned int t __asm__("%edx"); return t; }
- default:
- return 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement