/* * @author xamidev * @brief x86 CPU identification * @license GPL-3.0-only */ #include #include /* * cpuid - Wrapper for CPUID instruction * @leaf: Requested leaf (input EAX) * @eax: EAX register value (output) * @ebx: EBX register value (output) * @ecx: ECX register value (output) * @edx: EDX register value (output) */ void cpuid(uint32_t leaf, uint32_t* eax, uint32_t* ebx, uint32_t* ecx, uint32_t* edx) { __asm__ volatile("cpuid" : "=a"(*eax), "=b"(*ebx), "=c"(*ecx), "=d"(*edx) : "a"(leaf)); }