Bitcoin ABC
0.26.3
P2P Digital Currency
Loading...
Searching...
No Matches
src
compat
cpuid.h
Go to the documentation of this file.
1
// Copyright (c) 2017-2019 The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5
#ifndef BITCOIN_COMPAT_CPUID_H
6
#define BITCOIN_COMPAT_CPUID_H
7
8
#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
9
#define HAVE_GETCPUID
10
11
#include <
cpuid.h
>
12
13
// We can't use cpuid.h's __get_cpuid as it does not support subleafs.
14
void
static
inline
GetCPUID
(
uint32_t
leaf,
uint32_t
subleaf
,
uint32_t
&
a
,
15
uint32_t
&
b
,
uint32_t
&
c
,
uint32_t
&d) {
16
#ifdef __GNUC__
17
__cpuid_count
(leaf,
subleaf
,
a
,
b
,
c
, d);
18
#else
19
__asm__
(
"cpuid"
20
:
"=a"
(
a
),
"=b"
(
b
),
"=c"
(
c
),
"=d"
(d)
21
:
"0"
(leaf),
"2"
(
subleaf
));
22
#endif
23
}
24
25
#endif
// defined(__x86_64__) || defined(__amd64__) || defined(__i386__)
26
#endif
// BITCOIN_COMPAT_CPUID_H
cpuid.h
GetRand
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
Definition
random.h:85
Generated on Thu Dec 26 2024 02:38:01 for Bitcoin ABC by
1.9.8