From 72a446e10b634ced1034f689581a291b6ce8d770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Tue, 26 Aug 2014 18:58:21 +0200 Subject: [PATCH] libroot/x86_64: implement get_cpuid() in user mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/system/libroot/os/arch/x86_64/system_info.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/system/libroot/os/arch/x86_64/system_info.cpp b/src/system/libroot/os/arch/x86_64/system_info.cpp index 03a3e4c440..4a1acdb490 100644 --- a/src/system/libroot/os/arch/x86_64/system_info.cpp +++ b/src/system/libroot/os/arch/x86_64/system_info.cpp @@ -1,4 +1,5 @@ /* + * Cp[yright 2014, Paweł Dziepak, pdziepak@quarnos.org. * Copyright 2003-2004, Axel Dörfler, axeld@pinc-software.de. * 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; }