cpuid/x86: move the result struct into an anonymous namespace

This commit is contained in:
Danny Robson 2019-06-28 16:11:49 +10:00
parent d40d454ca4
commit 471c81c43a

View File

@ -20,16 +20,22 @@ using cruft::cpu::x86;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
auto cpuid (u32 query, u32 param = 0) namespace {
{ struct cpuid_t {
struct {
uint32_t a, b, c, d; uint32_t a, b, c, d;
} res; };
}
//-----------------------------------------------------------------------------
cpuid_t cpuid (u32 query, u32 param = 0)
{
cpuid_t res;
asm ( asm (
"cpuid" "cpuid"
: "=a" (res.a), "=b" (res.b), "=c" (res.c), "=d" (res.d) : "=a" (res.a), "=b" (res.b), "=c" (res.c), "=d" (res.d)
: "a" (query), "c" (param) : "a" (query), "c" (param)
); );
return res; return res;