Initial Vexta Core v0.1.0 release
This commit is contained in:
commit
25c454329d
2481 changed files with 689289 additions and 0 deletions
24
src/compat/cpuid.h
Normal file
24
src/compat/cpuid.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// Copyright (c) 2017-2019 The DigiByte Core developers
|
||||
// Distributed under the MIT software license, see the accompanying
|
||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||
|
||||
#ifndef DIGIBYTE_COMPAT_CPUID_H
|
||||
#define DIGIBYTE_COMPAT_CPUID_H
|
||||
|
||||
#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
|
||||
#define HAVE_GETCPUID
|
||||
|
||||
#include <cpuid.h>
|
||||
|
||||
// We can't use cpuid.h's __get_cpuid as it does not support subleafs.
|
||||
void static inline GetCPUID(uint32_t leaf, uint32_t subleaf, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d)
|
||||
{
|
||||
#ifdef __GNUC__
|
||||
__cpuid_count(leaf, subleaf, a, b, c, d);
|
||||
#else
|
||||
__asm__ ("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(leaf), "2"(subleaf));
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
|
||||
#endif // DIGIBYTE_COMPAT_CPUID_H
|
||||
Loading…
Reference in a new issue