MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetCPUID

Function GetCPUID

src/compat/cpuid.h:14–21  ·  view source on GitHub ↗

We can't use cpuid.h's __get_cpuid as it does not support subleafs.

Source from the content-addressed store, hash-verified

12
13// We can't use cpuid.h's __get_cpuid as it does not support subleafs.
14void static inline GetCPUID(uint32_t leaf, uint32_t subleaf, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d)
15{
16#ifdef __GNUC__
17 __cpuid_count(leaf, subleaf, a, b, c, d);
18#else
19 __asm__ ("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(leaf), "2"(subleaf));
20#endif
21}
22
23#endif // defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
24#endif // BITCOIN_COMPAT_CPUID_H

Callers 3

InitHardwareRandFunction · 0.85
AddCPUIDFunction · 0.85
SHA256AutoDetectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected