libroot/x86_64: implement get_cpuid() in user mode

cpuid is available in user mode as well and it doesn't look like there
are going to be any x86 platforms with significantly different CPUs anytime
soon.

Signed-off-by: Paweł Dziepak <[email protected]>
This commit is contained in:
Paweł Dziepak
2014-08-26 19:01:37 +02:00
parent 6d70d75a8e
commit 72a446e10b
@@ -1,4 +1,5 @@
/*
* Cp[yright 2014, Paweł Dziepak, [email protected].
* Copyright 2003-2004, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License.
*/
@@ -11,6 +12,10 @@
status_t
get_cpuid(cpuid_info* info, uint32 eaxRegister, uint32 cpuNum)
{
return _kern_get_cpuid(info, eaxRegister, cpuNum);
__asm__("cpuid"
: "=a" (info->regs.eax), "=b" (info->regs.ebx), "=c" (info->regs.ecx),
"=d" (info->regs.edx)
: "a" (eaxRegister), "c" (0));
return B_OK;
}