mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-06 23:52:38 -05:00
Compare commits
136 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1b8351a63 | ||
|
|
a620dfc955 | ||
|
|
f1e688724e | ||
|
|
e8355e1a1c | ||
|
|
6cb27e9662 | ||
|
|
5fee8ba288 | ||
|
|
b7840d9ab6 | ||
|
|
d591832eea | ||
|
|
13ac54ada9 | ||
|
|
1f36ea2a8e | ||
|
|
ab90af37b3 | ||
|
|
88031650b4 | ||
|
|
4a5493e12f | ||
|
|
6a97aeaf1b | ||
|
|
6ac3534fd5 | ||
|
|
e210067660 | ||
|
|
50c66083a7 | ||
|
|
05dc9821c5 | ||
|
|
c623dc7c92 | ||
|
|
4a7897b8bc | ||
|
|
33a7530f9b | ||
|
|
44f0daf384 | ||
|
|
6a45d5dcc9 | ||
|
|
7bf12dc81f | ||
|
|
2020b71eeb | ||
|
|
cad5fef1ea | ||
|
|
56e88f57fb | ||
|
|
bc09aa5ad0 | ||
|
|
eeadea53e2 | ||
|
|
0528ccd01e | ||
|
|
5486300db7 | ||
|
|
b0dda2b5b3 | ||
|
|
c80ef54b60 | ||
|
|
31383861cd | ||
|
|
b2b18ce22d | ||
|
|
8496f5b631 | ||
|
|
ec17bc4d40 | ||
|
|
5fa6a034d5 | ||
|
|
24c25b7d2e | ||
|
|
874cff3d51 | ||
|
|
297d884482 | ||
|
|
26c72cd7d8 | ||
|
|
fa91cff515 | ||
|
|
f415814069 | ||
|
|
9cf78cf14b | ||
|
|
8dc87576c5 | ||
|
|
f0db17be87 | ||
|
|
616c52f266 | ||
|
|
5bad45925a | ||
|
|
cdd9ea2496 | ||
|
|
14ef99ca67 | ||
|
|
2cd45a9e38 | ||
|
|
a070035d97 | ||
|
|
012d7124cd | ||
|
|
cde1e2c5f3 | ||
|
|
ead441f5db | ||
|
|
031e09fede | ||
|
|
1ee27a564b | ||
|
|
23c51c9a11 | ||
|
|
f9e653ea9f | ||
|
|
131085be80 | ||
|
|
12081e4f5b | ||
|
|
e1b8f52e59 | ||
|
|
6dad42a4db | ||
|
|
799d95d67a | ||
|
|
b131c60f08 | ||
|
|
1e2e247789 | ||
|
|
0caeb41bff | ||
|
|
fd0cbd448b | ||
|
|
bdf6e87dc5 | ||
|
|
88c7aca6f5 | ||
|
|
887c891ab2 | ||
|
|
2bc5fb10a7 | ||
|
|
8497e9c54f | ||
|
|
2e07e69697 | ||
|
|
2fea4e72b5 | ||
|
|
2863ade0c2 | ||
|
|
fb0b638cbb | ||
|
|
1e2d011705 | ||
|
|
dfaca04167 | ||
|
|
33b1d5f4b3 | ||
|
|
2499822106 | ||
|
|
9fe9e8989d | ||
|
|
311d3e1c18 | ||
|
|
5e444553b1 | ||
|
|
16f011a47f | ||
|
|
488049e695 | ||
|
|
d23e5e15ba | ||
|
|
5ad52192fe | ||
|
|
937dc7b7c3 | ||
|
|
7fa5e8706e | ||
|
|
2f27d5d108 | ||
|
|
56f23db878 | ||
|
|
264e3928c2 | ||
|
|
ef629ba0d0 | ||
|
|
aacdbc360b | ||
|
|
e2e37c8cfb | ||
|
|
c307433900 | ||
|
|
97e6a6669f | ||
|
|
e8f5cc67f8 | ||
|
|
8f9c1dd781 | ||
|
|
60634366c1 | ||
|
|
78bd280666 | ||
|
|
217540296f | ||
|
|
7eaabd4e00 | ||
|
|
ff59f3dbb4 | ||
|
|
9c8da1d4d3 | ||
|
|
ffc9f67751 | ||
|
|
bf1a0a0b83 | ||
|
|
f864687a96 | ||
|
|
030d6e5962 | ||
|
|
f609be6ec3 | ||
|
|
aa4a4c9fd0 | ||
|
|
269d12d1be | ||
|
|
23a1ae0337 | ||
|
|
4571899664 | ||
|
|
6d9b50b938 | ||
|
|
cd763be05b | ||
|
|
4e6b24d67d | ||
|
|
42a7194e93 | ||
|
|
01e063f6f5 | ||
|
|
81e3f6e7d9 | ||
|
|
9f1753cc4f | ||
|
|
39eafc3255 | ||
|
|
d342968211 | ||
|
|
c5968e8896 | ||
|
|
8e6f4d4ecb | ||
|
|
f80177cbd3 | ||
|
|
32b0314990 | ||
|
|
665e43fecc | ||
|
|
b5fb96dca0 | ||
|
|
73722ce186 | ||
|
|
638ed7b4f2 | ||
|
|
b5b12216d6 | ||
|
|
d2867a2ed8 | ||
|
|
e290995999 |
41
CHANGELOG.md
41
CHANGELOG.md
@@ -1,3 +1,44 @@
|
||||
# v5.9.0
|
||||
- [#1578](https://github.com/xmrig/xmrig/pull/1578) Added new RandomKEVA algorithm for upcoming Kevacoin fork, as `"algo": "rx/keva"` or `"coin": "keva"`.
|
||||
- [#1584](https://github.com/xmrig/xmrig/pull/1584) Fixed invalid AstroBWT hashes after algorithm switching.
|
||||
- [#1585](https://github.com/xmrig/xmrig/issues/1585) Fixed build without HTTP support.
|
||||
- Added command line option `--astrobwt-max-size`.
|
||||
|
||||
# v5.8.2
|
||||
- [#1580](https://github.com/xmrig/xmrig/pull/1580) AstroBWT algorithm 20-50% speedup.
|
||||
- Added new option `astrobwt-max-size`.
|
||||
- [#1581](https://github.com/xmrig/xmrig/issues/1581) Fixed macOS build.
|
||||
|
||||
# v5.8.1
|
||||
- [#1575](https://github.com/xmrig/xmrig/pull/1575) Fixed new block detection for DERO solo mining.
|
||||
|
||||
# v5.8.0
|
||||
- [#1573](https://github.com/xmrig/xmrig/pull/1573) Added new AstroBWT algorithm for upcoming DERO fork, as `"algo": "astrobwt"` or `"coin": "dero"`.
|
||||
|
||||
# v5.7.0
|
||||
- **Added SOCKS5 proxies support for Tor https://xmrig.com/docs/miner/tor.**
|
||||
- [#377](https://github.com/xmrig/xmrig-proxy/issues/377) Fixed duplicate jobs in daemon (solo) mining client.
|
||||
- [#1560](https://github.com/xmrig/xmrig/pull/1560) RandomX 0.3-0.4% speedup depending on CPU.
|
||||
- Fixed possible crashes in HTTP client.
|
||||
|
||||
# v5.6.0
|
||||
- [#1536](https://github.com/xmrig/xmrig/pull/1536) Added workaround for new AMD GPU drivers.
|
||||
- [#1546](https://github.com/xmrig/xmrig/pull/1546) Fixed generic OpenCL code for AMD Navi GPUs.
|
||||
- [#1551](https://github.com/xmrig/xmrig/pull/1551) Added RandomX JIT for AMD Navi GPUs.
|
||||
- Added health information for AMD GPUs (clocks/power/fan/temperature) via ADL (Windows) and sysfs (Linux).
|
||||
- Fixed possible nicehash nonce overflow in some conditions.
|
||||
- Fixed wrong OpenCL platform on macOS, option `platform` now ignored on this OS.
|
||||
|
||||
# v5.5.3
|
||||
- [#1529](https://github.com/xmrig/xmrig/pull/1529) Fixed crash on Bulldozer CPUs.
|
||||
|
||||
# v5.5.2
|
||||
- [#1500](https://github.com/xmrig/xmrig/pull/1500) Removed unnecessary code from RandomX JIT compiler.
|
||||
- [#1502](https://github.com/xmrig/xmrig/pull/1502) Optimizations for AMD Bulldozer.
|
||||
- [#1508](https://github.com/xmrig/xmrig/pull/1508) Added support for BMI2 instructions.
|
||||
- [#1510](https://github.com/xmrig/xmrig/pull/1510) Optimized `CFROUND` instruction for RandomX.
|
||||
- [#1520](https://github.com/xmrig/xmrig/pull/1520) Fixed thread affinity.
|
||||
|
||||
# v5.5.1
|
||||
- [#1469](https://github.com/xmrig/xmrig/issues/1469) Fixed build with gcc 4.8.
|
||||
- [#1473](https://github.com/xmrig/xmrig/pull/1473) Added RandomX auto-config for mobile Ryzen APUs.
|
||||
|
||||
@@ -9,6 +9,7 @@ option(WITH_CN_PICO "Enable CryptoNight-Pico algorithm" ON)
|
||||
option(WITH_CN_GPU "Enable CryptoNight-GPU algorithm" ON)
|
||||
option(WITH_RANDOMX "Enable RandomX algorithms family" ON)
|
||||
option(WITH_ARGON2 "Enable Argon2 algorithms family" ON)
|
||||
option(WITH_ASTROBWT "Enable AstroBWT algorithms family" ON)
|
||||
option(WITH_HTTP "Enable HTTP protocol support (client/server)" ON)
|
||||
option(WITH_DEBUG_LOG "Enable debug log output" OFF)
|
||||
option(WITH_TLS "Enable OpenSSL support" ON)
|
||||
@@ -19,6 +20,7 @@ option(WITH_EMBEDDED_CONFIG "Enable internal embedded JSON config" OFF)
|
||||
option(WITH_OPENCL "Enable OpenCL backend" ON)
|
||||
option(WITH_CUDA "Enable CUDA backend" ON)
|
||||
option(WITH_NVML "Enable NVML (NVIDIA Management Library) support (only if CUDA backend enabled)" ON)
|
||||
option(WITH_ADL "Enable ADL (AMD Display Library) or sysfs support (only if OpenCL backend enabled)" ON)
|
||||
option(WITH_STRICT_CACHE "Enable strict checks for OpenCL cache" ON)
|
||||
option(WITH_INTERLEAVE_DEBUG_LOG "Enable debug log for threads interleave" OFF)
|
||||
|
||||
@@ -53,7 +55,6 @@ set(HEADERS
|
||||
src/net/JobResult.h
|
||||
src/net/JobResults.h
|
||||
src/net/Network.h
|
||||
src/net/NetworkState.h
|
||||
src/net/strategies/DonateStrategy.h
|
||||
src/Summary.h
|
||||
src/version.h
|
||||
@@ -103,7 +104,6 @@ set(SOURCES
|
||||
src/core/Miner.cpp
|
||||
src/net/JobResults.cpp
|
||||
src/net/Network.cpp
|
||||
src/net/NetworkState.cpp
|
||||
src/net/strategies/DonateStrategy.cpp
|
||||
src/Summary.cpp
|
||||
src/xmrig.cpp
|
||||
@@ -177,6 +177,7 @@ find_package(UV REQUIRED)
|
||||
include(cmake/flags.cmake)
|
||||
include(cmake/randomx.cmake)
|
||||
include(cmake/argon2.cmake)
|
||||
include(cmake/astrobwt.cmake)
|
||||
include(cmake/OpenSSL.cmake)
|
||||
include(cmake/asm.cmake)
|
||||
include(cmake/cn-gpu.cmake)
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
# XMRig
|
||||
|
||||
**:warning: [Monero changed PoW algorithm to RandomX on November 30.](https://github.com/xmrig/xmrig/issues/1204)**
|
||||
|
||||
[](https://github.com/xmrig/xmrig/releases)
|
||||
[](https://github.com/xmrig/xmrig/releases)
|
||||
[](https://github.com/xmrig/xmrig/releases)
|
||||
@@ -9,7 +7,7 @@
|
||||
[](https://github.com/xmrig/xmrig/stargazers)
|
||||
[](https://github.com/xmrig/xmrig/network)
|
||||
|
||||
XMRig High performance, open source, cross platform RandomX, CryptoNight and Argon2 CPU/GPU miner, with official support for Windows.
|
||||
XMRig High performance, open source, cross platform RandomX, CryptoNight, AstroBWT and Argon2 CPU/GPU miner, with official support for Windows.
|
||||
|
||||
## Mining backends
|
||||
- **CPU** (x64/x86/ARM)
|
||||
@@ -38,6 +36,7 @@ Network:
|
||||
-u, --user=USERNAME username for mining server
|
||||
-p, --pass=PASSWORD password for mining server
|
||||
-O, --userpass=U:P username:password pair for mining server
|
||||
-x, --proxy=HOST:PORT connect through a SOCKS5 proxy
|
||||
-k, --keepalive send keepalive packet for prevent timeout (needs pool support)
|
||||
--nicehash enable nicehash.com support
|
||||
--rig-id=ID rig identifier for pool-side statistics (needs pool support)
|
||||
@@ -68,6 +67,7 @@ CPU backend:
|
||||
--randomx-1gb-pages use 1GB hugepages for dataset (Linux only)
|
||||
--randomx-wrmsr=N write custom value (0-15) to Intel MSR register 0x1a4 or disable MSR mod (-1)
|
||||
--randomx-no-rdmsr disable reverting initial MSR values on exit
|
||||
--astrobwt-max-size=N skip hashes with large stage 2 size, default: 550, min: 400, max: 1200
|
||||
|
||||
API:
|
||||
--api-worker-id=ID custom worker-id for API
|
||||
|
||||
36
cmake/astrobwt.cmake
Normal file
36
cmake/astrobwt.cmake
Normal file
@@ -0,0 +1,36 @@
|
||||
if (WITH_ASTROBWT)
|
||||
add_definitions(/DXMRIG_ALGO_ASTROBWT)
|
||||
|
||||
list(APPEND HEADERS_CRYPTO
|
||||
src/crypto/astrobwt/AstroBWT.h
|
||||
src/crypto/astrobwt/sha3.h
|
||||
)
|
||||
|
||||
list(APPEND SOURCES_CRYPTO
|
||||
src/crypto/astrobwt/AstroBWT.cpp
|
||||
src/crypto/astrobwt/sha3.cpp
|
||||
)
|
||||
|
||||
if (XMRIG_ARM)
|
||||
list(APPEND HEADERS_CRYPTO
|
||||
src/crypto/astrobwt/salsa20_ref/ecrypt-config.h
|
||||
src/crypto/astrobwt/salsa20_ref/ecrypt-machine.h
|
||||
src/crypto/astrobwt/salsa20_ref/ecrypt-portable.h
|
||||
src/crypto/astrobwt/salsa20_ref/ecrypt-sync.h
|
||||
)
|
||||
|
||||
list(APPEND SOURCES_CRYPTO
|
||||
src/crypto/astrobwt/salsa20_ref/salsa20.c
|
||||
)
|
||||
else()
|
||||
list(APPEND HEADERS_CRYPTO
|
||||
src/crypto/astrobwt/Salsa20.hpp
|
||||
)
|
||||
|
||||
list(APPEND SOURCES_CRYPTO
|
||||
src/crypto/astrobwt/Salsa20.cpp
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
remove_definitions(/DXMRIG_ALGO_ASTROBWT)
|
||||
endif()
|
||||
@@ -60,6 +60,7 @@ function rx()
|
||||
'randomx_constants_wow.h',
|
||||
'randomx_constants_loki.h',
|
||||
'randomx_constants_arqma.h',
|
||||
'randomx_constants_keva.h',
|
||||
'aes.cl',
|
||||
'blake2b.cl',
|
||||
'randomx_vm.cl',
|
||||
|
||||
@@ -13,7 +13,7 @@ if cat /proc/cpuinfo | grep "AMD Ryzen" > /dev/null;
|
||||
elif cat /proc/cpuinfo | grep "Intel" > /dev/null;
|
||||
then
|
||||
echo "Detected Intel"
|
||||
wrmsr -a 0x1a4 6
|
||||
wrmsr -a 0x1a4 0xf
|
||||
echo "MSR register values for Intel applied"
|
||||
else
|
||||
echo "No supported CPU detected"
|
||||
|
||||
2342
src/3rdparty/adl/adl_defines.h
vendored
Normal file
2342
src/3rdparty/adl/adl_defines.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
44
src/3rdparty/adl/adl_sdk.h
vendored
Normal file
44
src/3rdparty/adl/adl_sdk.h
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
//
|
||||
// Copyright (c) 2016 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// MIT LICENSE:
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
/// \file adl_sdk.h
|
||||
/// \brief Contains the definition of the Memory Allocation Callback.\n <b>Included in ADL SDK</b>
|
||||
///
|
||||
/// \n\n
|
||||
/// This file contains the definition of the Memory Allocation Callback.\n
|
||||
/// It also includes definitions of the respective structures and constants.\n
|
||||
/// <b> This is the only header file to be included in a C/C++ project using ADL </b>
|
||||
|
||||
#ifndef ADL_SDK_H_
|
||||
#define ADL_SDK_H_
|
||||
|
||||
#include "adl_structures.h"
|
||||
|
||||
#if defined (LINUX)
|
||||
#define __stdcall
|
||||
#endif /* (LINUX) */
|
||||
|
||||
/// Memory Allocation Call back
|
||||
typedef void* ( __stdcall *ADL_MAIN_MALLOC_CALLBACK )( int );
|
||||
|
||||
|
||||
#endif /* ADL_SDK_H_ */
|
||||
3440
src/3rdparty/adl/adl_structures.h
vendored
Normal file
3440
src/3rdparty/adl/adl_structures.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
128
src/3rdparty/http-parser/http_parser.c
vendored
128
src/3rdparty/http-parser/http_parser.c
vendored
@@ -381,7 +381,10 @@ enum header_states
|
||||
, h_transfer_encoding
|
||||
, h_upgrade
|
||||
|
||||
, h_matching_transfer_encoding_token_start
|
||||
, h_matching_transfer_encoding_chunked
|
||||
, h_matching_transfer_encoding_token
|
||||
|
||||
, h_matching_connection_token_start
|
||||
, h_matching_connection_keep_alive
|
||||
, h_matching_connection_close
|
||||
@@ -1257,9 +1260,9 @@ reexecute:
|
||||
|
||||
switch (parser->header_state) {
|
||||
case h_general: {
|
||||
size_t limit = data + len - p;
|
||||
limit = MIN(limit, max_header_size);
|
||||
while (p+1 < data + limit && TOKEN(p[1])) {
|
||||
size_t left = data + len - p;
|
||||
const char* pe = p + MIN(left, max_header_size);
|
||||
while (p+1 < pe && TOKEN(p[1])) {
|
||||
p++;
|
||||
}
|
||||
break;
|
||||
@@ -1335,6 +1338,7 @@ reexecute:
|
||||
parser->header_state = h_general;
|
||||
} else if (parser->index == sizeof(TRANSFER_ENCODING)-2) {
|
||||
parser->header_state = h_transfer_encoding;
|
||||
parser->flags |= F_TRANSFER_ENCODING;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1416,10 +1420,14 @@ reexecute:
|
||||
if ('c' == c) {
|
||||
parser->header_state = h_matching_transfer_encoding_chunked;
|
||||
} else {
|
||||
parser->header_state = h_general;
|
||||
parser->header_state = h_matching_transfer_encoding_token;
|
||||
}
|
||||
break;
|
||||
|
||||
/* Multi-value `Transfer-Encoding` header */
|
||||
case h_matching_transfer_encoding_token_start:
|
||||
break;
|
||||
|
||||
case h_content_length:
|
||||
if (UNLIKELY(!IS_NUM(ch))) {
|
||||
SET_ERRNO(HPE_INVALID_CONTENT_LENGTH);
|
||||
@@ -1496,28 +1504,25 @@ reexecute:
|
||||
|
||||
switch (h_state) {
|
||||
case h_general:
|
||||
{
|
||||
const char* p_cr;
|
||||
const char* p_lf;
|
||||
size_t limit = data + len - p;
|
||||
{
|
||||
size_t left = data + len - p;
|
||||
const char* pe = p + MIN(left, max_header_size);
|
||||
|
||||
limit = MIN(limit, max_header_size);
|
||||
|
||||
p_cr = (const char*) memchr(p, CR, limit);
|
||||
p_lf = (const char*) memchr(p, LF, limit);
|
||||
if (p_cr != NULL) {
|
||||
if (p_lf != NULL && p_cr >= p_lf)
|
||||
p = p_lf;
|
||||
else
|
||||
p = p_cr;
|
||||
} else if (UNLIKELY(p_lf != NULL)) {
|
||||
p = p_lf;
|
||||
} else {
|
||||
p = data + len;
|
||||
for (; p != pe; p++) {
|
||||
ch = *p;
|
||||
if (ch == CR || ch == LF) {
|
||||
--p;
|
||||
break;
|
||||
}
|
||||
if (!lenient && !IS_HEADER_CHAR(ch)) {
|
||||
SET_ERRNO(HPE_INVALID_HEADER_TOKEN);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
if (p == data + len)
|
||||
--p;
|
||||
break;
|
||||
}
|
||||
--p;
|
||||
break;
|
||||
}
|
||||
|
||||
case h_connection:
|
||||
case h_transfer_encoding:
|
||||
@@ -1566,16 +1571,41 @@ reexecute:
|
||||
goto error;
|
||||
|
||||
/* Transfer-Encoding: chunked */
|
||||
case h_matching_transfer_encoding_token_start:
|
||||
/* looking for 'Transfer-Encoding: chunked' */
|
||||
if ('c' == c) {
|
||||
h_state = h_matching_transfer_encoding_chunked;
|
||||
} else if (STRICT_TOKEN(c)) {
|
||||
/* TODO(indutny): similar code below does this, but why?
|
||||
* At the very least it seems to be inconsistent given that
|
||||
* h_matching_transfer_encoding_token does not check for
|
||||
* `STRICT_TOKEN`
|
||||
*/
|
||||
h_state = h_matching_transfer_encoding_token;
|
||||
} else if (c == ' ' || c == '\t') {
|
||||
/* Skip lws */
|
||||
} else {
|
||||
h_state = h_general;
|
||||
}
|
||||
break;
|
||||
|
||||
case h_matching_transfer_encoding_chunked:
|
||||
parser->index++;
|
||||
if (parser->index > sizeof(CHUNKED)-1
|
||||
|| c != CHUNKED[parser->index]) {
|
||||
h_state = h_general;
|
||||
h_state = h_matching_transfer_encoding_token;
|
||||
} else if (parser->index == sizeof(CHUNKED)-2) {
|
||||
h_state = h_transfer_encoding_chunked;
|
||||
}
|
||||
break;
|
||||
|
||||
case h_matching_transfer_encoding_token:
|
||||
if (ch == ',') {
|
||||
h_state = h_matching_transfer_encoding_token_start;
|
||||
parser->index = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
case h_matching_connection_token_start:
|
||||
/* looking for 'Connection: keep-alive' */
|
||||
if (c == 'k') {
|
||||
@@ -1634,7 +1664,7 @@ reexecute:
|
||||
break;
|
||||
|
||||
case h_transfer_encoding_chunked:
|
||||
if (ch != ' ') h_state = h_general;
|
||||
if (ch != ' ') h_state = h_matching_transfer_encoding_token;
|
||||
break;
|
||||
|
||||
case h_connection_keep_alive:
|
||||
@@ -1768,12 +1798,17 @@ reexecute:
|
||||
REEXECUTE();
|
||||
}
|
||||
|
||||
/* Cannot use chunked encoding and a content-length header together
|
||||
per the HTTP specification. */
|
||||
if ((parser->flags & F_CHUNKED) &&
|
||||
/* Cannot us transfer-encoding and a content-length header together
|
||||
per the HTTP specification. (RFC 7230 Section 3.3.3) */
|
||||
if ((parser->flags & F_TRANSFER_ENCODING) &&
|
||||
(parser->flags & F_CONTENTLENGTH)) {
|
||||
SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
|
||||
goto error;
|
||||
/* Allow it for lenient parsing as long as `Transfer-Encoding` is
|
||||
* not `chunked`
|
||||
*/
|
||||
if (!lenient || (parser->flags & F_CHUNKED)) {
|
||||
SET_ERRNO(HPE_UNEXPECTED_CONTENT_LENGTH);
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
UPDATE_STATE(s_headers_done);
|
||||
@@ -1848,8 +1883,31 @@ reexecute:
|
||||
UPDATE_STATE(NEW_MESSAGE());
|
||||
CALLBACK_NOTIFY(message_complete);
|
||||
} else if (parser->flags & F_CHUNKED) {
|
||||
/* chunked encoding - ignore Content-Length header */
|
||||
/* chunked encoding - ignore Content-Length header,
|
||||
* prepare for a chunk */
|
||||
UPDATE_STATE(s_chunk_size_start);
|
||||
} else if (parser->flags & F_TRANSFER_ENCODING) {
|
||||
if (parser->type == HTTP_REQUEST && !lenient) {
|
||||
/* RFC 7230 3.3.3 */
|
||||
|
||||
/* If a Transfer-Encoding header field
|
||||
* is present in a request and the chunked transfer coding is not
|
||||
* the final encoding, the message body length cannot be determined
|
||||
* reliably; the server MUST respond with the 400 (Bad Request)
|
||||
* status code and then close the connection.
|
||||
*/
|
||||
SET_ERRNO(HPE_INVALID_TRANSFER_ENCODING);
|
||||
RETURN(p - data); /* Error */
|
||||
} else {
|
||||
/* RFC 7230 3.3.3 */
|
||||
|
||||
/* If a Transfer-Encoding header field is present in a response and
|
||||
* the chunked transfer coding is not the final encoding, the
|
||||
* message body length is determined by reading the connection until
|
||||
* it is closed by the server.
|
||||
*/
|
||||
UPDATE_STATE(s_body_identity_eof);
|
||||
}
|
||||
} else {
|
||||
if (parser->content_length == 0) {
|
||||
/* Content-Length header given but zero: Content-Length: 0\r\n */
|
||||
@@ -2103,6 +2161,12 @@ http_message_needs_eof (const http_parser *parser)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* RFC 7230 3.3.3, see `s_headers_almost_done` */
|
||||
if ((parser->flags & F_TRANSFER_ENCODING) &&
|
||||
(parser->flags & F_CHUNKED) == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if ((parser->flags & F_CHUNKED) || parser->content_length != ULLONG_MAX) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
7
src/3rdparty/http-parser/http_parser.h
vendored
7
src/3rdparty/http-parser/http_parser.h
vendored
@@ -27,7 +27,7 @@ extern "C" {
|
||||
/* Also update SONAME in the Makefile whenever you change these. */
|
||||
#define HTTP_PARSER_VERSION_MAJOR 2
|
||||
#define HTTP_PARSER_VERSION_MINOR 9
|
||||
#define HTTP_PARSER_VERSION_PATCH 0
|
||||
#define HTTP_PARSER_VERSION_PATCH 3
|
||||
|
||||
#include <stddef.h>
|
||||
#if defined(_WIN32) && !defined(__MINGW32__) && \
|
||||
@@ -225,6 +225,7 @@ enum flags
|
||||
, F_UPGRADE = 1 << 5
|
||||
, F_SKIPBODY = 1 << 6
|
||||
, F_CONTENTLENGTH = 1 << 7
|
||||
, F_TRANSFER_ENCODING = 1 << 8
|
||||
};
|
||||
|
||||
|
||||
@@ -271,6 +272,8 @@ enum flags
|
||||
"unexpected content-length header") \
|
||||
XX(INVALID_CHUNK_SIZE, \
|
||||
"invalid character in chunk size header") \
|
||||
XX(INVALID_TRANSFER_ENCODING, \
|
||||
"request has invalid transfer-encoding") \
|
||||
XX(INVALID_CONSTANT, "invalid constant string") \
|
||||
XX(INVALID_INTERNAL_STATE, "encountered unexpected internal state")\
|
||||
XX(STRICT, "strict mode assertion failed") \
|
||||
@@ -293,11 +296,11 @@ enum http_errno {
|
||||
struct http_parser {
|
||||
/** PRIVATE **/
|
||||
unsigned int type : 2; /* enum http_parser_type */
|
||||
unsigned int flags : 8; /* F_* values from 'flags' enum; semi-public */
|
||||
unsigned int state : 7; /* enum state from http_parser.c */
|
||||
unsigned int header_state : 7; /* enum header_state from http_parser.c */
|
||||
unsigned int index : 7; /* index into current matcher */
|
||||
unsigned int lenient_http_headers : 1;
|
||||
unsigned int flags : 16; /* F_* values from 'flags' enum; semi-public */
|
||||
|
||||
uint32_t nread; /* # bytes read in various scenarios */
|
||||
uint64_t content_length; /* # bytes in body (0 if no Content-Length header) */
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -61,7 +61,7 @@ xmrig::App::~App()
|
||||
int xmrig::App::exec()
|
||||
{
|
||||
if (!m_controller->isReady()) {
|
||||
LOG_EMERG("no valid configuration found.");
|
||||
LOG_EMERG("no valid configuration found, try https://xmrig.com/wizard");
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -64,13 +64,17 @@ public:
|
||||
}
|
||||
|
||||
|
||||
inline void nextRound(uint32_t rounds, uint32_t roundSize)
|
||||
inline bool nextRound(uint32_t rounds, uint32_t roundSize)
|
||||
{
|
||||
bool ok = true;
|
||||
m_rounds[index()]++;
|
||||
|
||||
if ((m_rounds[index()] % rounds) == 0) {
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
*nonce(i) = Nonce::next(index(), *nonce(i), rounds * roundSize, currentJob().isNicehash());
|
||||
*nonce(i) = Nonce::next(index(), *nonce(i), rounds * roundSize, currentJob().isNicehash(), &ok);
|
||||
if (!ok) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -78,6 +82,8 @@ public:
|
||||
*nonce(i) += roundSize;
|
||||
}
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,16 +120,19 @@ inline uint32_t *xmrig::WorkerJob<1>::nonce(size_t)
|
||||
|
||||
|
||||
template<>
|
||||
inline void xmrig::WorkerJob<1>::nextRound(uint32_t rounds, uint32_t roundSize)
|
||||
inline bool xmrig::WorkerJob<1>::nextRound(uint32_t rounds, uint32_t roundSize)
|
||||
{
|
||||
bool ok = true;
|
||||
m_rounds[index()]++;
|
||||
|
||||
if ((m_rounds[index()] % rounds) == 0) {
|
||||
*nonce() = Nonce::next(index(), *nonce(), rounds * roundSize, currentJob().isNicehash());
|
||||
*nonce() = Nonce::next(index(), *nonce(), rounds * roundSize, currentJob().isNicehash(), &ok);
|
||||
}
|
||||
else {
|
||||
*nonce() += roundSize;
|
||||
}
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -56,6 +56,7 @@ public:
|
||||
virtual void execCommand(char command) = 0;
|
||||
virtual void prepare(const Job &nextJob) = 0;
|
||||
virtual void printHashrate(bool details) = 0;
|
||||
virtual void printHealth() = 0;
|
||||
virtual void setJob(const Job &job) = 0;
|
||||
virtual void start(IWorker *worker, bool ready) = 0;
|
||||
virtual void stop() = 0;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -91,8 +91,6 @@ rapidjson::Value xmrig::Cpu::toJSON(rapidjson::Document &doc)
|
||||
|
||||
void xmrig::Cpu::release()
|
||||
{
|
||||
assert(cpuInfo != nullptr);
|
||||
|
||||
delete cpuInfo;
|
||||
cpuInfo = nullptr;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -319,6 +319,11 @@ void xmrig::CpuBackend::printHashrate(bool details)
|
||||
}
|
||||
|
||||
|
||||
void xmrig::CpuBackend::printHealth()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void xmrig::CpuBackend::setJob(const Job &job)
|
||||
{
|
||||
if (!isEnabled()) {
|
||||
@@ -411,6 +416,10 @@ rapidjson::Value xmrig::CpuBackend::toJSON(rapidjson::Document &doc) const
|
||||
out.AddMember("argon2-impl", argon2::Impl::name().toJSON(), allocator);
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
out.AddMember("astrobwt-max-size", cpu.astrobwtMaxSize(), allocator);
|
||||
# endif
|
||||
|
||||
out.AddMember("hugepages", d_ptr->hugePages(2, doc), allocator);
|
||||
out.AddMember("memory", static_cast<uint64_t>(d_ptr->algo.isValid() ? (d_ptr->ways() * d_ptr->algo.l3()) : 0), allocator);
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -59,6 +59,7 @@ protected:
|
||||
const String &type() const override;
|
||||
void prepare(const Job &nextJob) override;
|
||||
void printHashrate(bool details) override;
|
||||
void printHealth() override;
|
||||
void setJob(const Job &job) override;
|
||||
void start(IWorker *worker, bool ready) override;
|
||||
void stop() override;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -29,6 +29,8 @@
|
||||
#include "base/io/json/Json.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
@@ -48,6 +50,11 @@ static const char *kAsm = "asm";
|
||||
static const char *kArgon2Impl = "argon2-impl";
|
||||
#endif
|
||||
|
||||
#ifdef XMRIG_ALGO_ASTROBWT
|
||||
static const char* kAstroBWTMaxSize = "astrobwt-max-size";
|
||||
#endif
|
||||
|
||||
|
||||
extern template class Threads<CpuThreads>;
|
||||
|
||||
}
|
||||
@@ -85,6 +92,10 @@ rapidjson::Value xmrig::CpuConfig::toJSON(rapidjson::Document &doc) const
|
||||
obj.AddMember(StringRef(kArgon2Impl), m_argon2Impl.toJSON(), allocator);
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
obj.AddMember(StringRef(kAstroBWTMaxSize), m_astrobwtMaxSize, allocator);
|
||||
# endif
|
||||
|
||||
m_threads.toJSON(obj, doc);
|
||||
|
||||
return obj;
|
||||
@@ -136,6 +147,16 @@ void xmrig::CpuConfig::read(const rapidjson::Value &value)
|
||||
m_argon2Impl = Json::getString(value, kArgon2Impl);
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
const auto& obj = Json::getValue(value, kAstroBWTMaxSize);
|
||||
if (obj.IsNull() || !obj.IsInt()) {
|
||||
m_shouldSave = true;
|
||||
}
|
||||
else {
|
||||
m_astrobwtMaxSize = std::min(std::max(obj.GetInt(), 400), 1200);
|
||||
}
|
||||
# endif
|
||||
|
||||
m_threads.read(value);
|
||||
|
||||
generate();
|
||||
@@ -165,8 +186,9 @@ void xmrig::CpuConfig::generate()
|
||||
count += xmrig::generate<Algorithm::CN_PICO>(m_threads, m_limit);
|
||||
count += xmrig::generate<Algorithm::RANDOM_X>(m_threads, m_limit);
|
||||
count += xmrig::generate<Algorithm::ARGON2>(m_threads, m_limit);
|
||||
count += xmrig::generate<Algorithm::ASTROBWT>(m_threads, m_limit);
|
||||
|
||||
m_shouldSave = count > 0;
|
||||
m_shouldSave |= count > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -59,6 +59,7 @@ public:
|
||||
inline const Assembly &assembly() const { return m_assembly; }
|
||||
inline const String &argon2Impl() const { return m_argon2Impl; }
|
||||
inline const Threads<CpuThreads> &threads() const { return m_threads; }
|
||||
inline int astrobwtMaxSize() const { return m_astrobwtMaxSize; }
|
||||
inline int priority() const { return m_priority; }
|
||||
inline uint32_t limit() const { return m_limit; }
|
||||
|
||||
@@ -69,17 +70,18 @@ private:
|
||||
|
||||
inline void setPriority(int priority) { m_priority = (priority >= -1 && priority <= 5) ? priority : -1; }
|
||||
|
||||
AesMode m_aes = AES_AUTO;
|
||||
AesMode m_aes = AES_AUTO;
|
||||
Assembly m_assembly;
|
||||
bool m_enabled = true;
|
||||
bool m_hugePages = true;
|
||||
bool m_shouldSave = false;
|
||||
bool m_yield = true;
|
||||
int m_memoryPool = 0;
|
||||
int m_priority = -1;
|
||||
bool m_enabled = true;
|
||||
bool m_hugePages = true;
|
||||
bool m_shouldSave = false;
|
||||
bool m_yield = true;
|
||||
int m_astrobwtMaxSize = 550;
|
||||
int m_memoryPool = 0;
|
||||
int m_priority = -1;
|
||||
String m_argon2Impl;
|
||||
Threads<CpuThreads> m_threads;
|
||||
uint32_t m_limit = 100;
|
||||
uint32_t m_limit = 100;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -109,11 +109,11 @@ template<>
|
||||
size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32_t limit)
|
||||
{
|
||||
size_t count = 0;
|
||||
|
||||
auto wow = Cpu::info()->threads(Algorithm::RX_WOW, limit);
|
||||
auto cpuInfo = Cpu::info();
|
||||
auto wow = cpuInfo->threads(Algorithm::RX_WOW, limit);
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_ARQ)) {
|
||||
auto arq = Cpu::info()->threads(Algorithm::RX_ARQ, limit);
|
||||
auto arq = cpuInfo->threads(Algorithm::RX_ARQ, limit);
|
||||
if (arq == wow) {
|
||||
threads.setAlias(Algorithm::RX_ARQ, "rx/wow");
|
||||
++count;
|
||||
@@ -123,6 +123,17 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CpuThreads> &threads, uint32
|
||||
}
|
||||
}
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_KEVA)) {
|
||||
auto keva = cpuInfo->threads(Algorithm::RX_KEVA, limit);
|
||||
if (keva == wow) {
|
||||
threads.setAlias(Algorithm::RX_KEVA, "rx/wow");
|
||||
++count;
|
||||
}
|
||||
else {
|
||||
count += threads.move("rx/keva", std::move(keva));
|
||||
}
|
||||
}
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_WOW)) {
|
||||
count += threads.move("rx/wow", std::move(wow));
|
||||
}
|
||||
@@ -143,6 +154,14 @@ size_t inline generate<Algorithm::ARGON2>(Threads<CpuThreads> &threads, uint32_t
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_ASTROBWT
|
||||
template<>
|
||||
size_t inline generate<Algorithm::ASTROBWT>(Threads<CpuThreads>& threads, uint32_t limit)
|
||||
{
|
||||
return generate("astrobwt", threads, Algorithm::ASTROBWT_DERO, limit);
|
||||
}
|
||||
#endif
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
|
||||
#include "backend/cpu/CpuLaunchData.h"
|
||||
|
||||
#include "backend/common/Tags.h"
|
||||
#include "backend/cpu/CpuConfig.h"
|
||||
|
||||
@@ -39,6 +38,7 @@ xmrig::CpuLaunchData::CpuLaunchData(const Miner *miner, const Algorithm &algorit
|
||||
hugePages(config.isHugePages()),
|
||||
hwAES(config.isHwAES()),
|
||||
yield(config.isYield()),
|
||||
astrobwtMaxSize(config.astrobwtMaxSize()),
|
||||
priority(config.priority()),
|
||||
affinity(thread.affinity()),
|
||||
miner(miner),
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -61,6 +61,7 @@ public:
|
||||
const bool hugePages;
|
||||
const bool hwAES;
|
||||
const bool yield;
|
||||
const int astrobwtMaxSize;
|
||||
const int priority;
|
||||
const int64_t affinity;
|
||||
const Miner *miner;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "core/Miner.h"
|
||||
#include "crypto/cn/CnCtx.h"
|
||||
#include "crypto/cn/CryptoNight_test.h"
|
||||
#include "crypto/cn/CryptoNight.h"
|
||||
#include "crypto/common/Nonce.h"
|
||||
#include "crypto/common/VirtualMemory.h"
|
||||
#include "crypto/rx/Rx.h"
|
||||
@@ -44,10 +45,29 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_ALGO_ASTROBWT
|
||||
# include "crypto/astrobwt/AstroBWT.h"
|
||||
#endif
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
static constexpr uint32_t kReserveCount = 32768;
|
||||
|
||||
|
||||
template<size_t N>
|
||||
inline bool nextRound(WorkerJob<N> &job)
|
||||
{
|
||||
if (!job.nextRound(kReserveCount, 1)) {
|
||||
JobResults::done(job.currentJob());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
@@ -60,6 +80,7 @@ xmrig::CpuWorker<N>::CpuWorker(size_t id, const CpuLaunchData &data) :
|
||||
m_hwAES(data.hwAES),
|
||||
m_yield(data.yield),
|
||||
m_av(data.av()),
|
||||
m_astrobwtMaxSize(data.astrobwtMaxSize * 1000),
|
||||
m_miner(data.miner),
|
||||
m_ctx()
|
||||
{
|
||||
@@ -166,6 +187,12 @@ bool xmrig::CpuWorker<N>::selfTest()
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
if (m_algorithm.family() == Algorithm::ASTROBWT) {
|
||||
return verify(Algorithm::ASTROBWT_DERO, astrobwt_dero_test_out);
|
||||
}
|
||||
# endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -215,29 +242,48 @@ void xmrig::CpuWorker<N>::start()
|
||||
current_job_nonces[i] = *m_job.nonce(i);
|
||||
}
|
||||
|
||||
bool valid = true;
|
||||
|
||||
# ifdef XMRIG_ALGO_RANDOMX
|
||||
if (job.algorithm().family() == Algorithm::RANDOM_X) {
|
||||
if (first) {
|
||||
first = false;
|
||||
randomx_calculate_hash_first(m_vm->get(), tempHash, m_job.blob(), job.size());
|
||||
}
|
||||
m_job.nextRound(kReserveCount, 1);
|
||||
|
||||
if (!nextRound(m_job)) {
|
||||
break;
|
||||
}
|
||||
|
||||
randomx_calculate_hash_next(m_vm->get(), tempHash, m_job.blob(), job.size(), m_hash);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
{
|
||||
fn(job.algorithm())(m_job.blob(), job.size(), m_hash, m_ctx, job.height());
|
||||
m_job.nextRound(kReserveCount, 1);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
if (*reinterpret_cast<uint64_t*>(m_hash + (i * 32) + 24) < job.target()) {
|
||||
JobResults::submit(job, current_job_nonces[i], m_hash + (i * 32));
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
if (job.algorithm().family() == Algorithm::ASTROBWT) {
|
||||
if (!astrobwt::astrobwt_dero(m_job.blob(), job.size(), m_ctx[0]->memory, m_hash, m_astrobwtMaxSize))
|
||||
valid = false;
|
||||
}
|
||||
else
|
||||
# endif
|
||||
{
|
||||
fn(job.algorithm())(m_job.blob(), job.size(), m_hash, m_ctx, job.height());
|
||||
}
|
||||
|
||||
if (!nextRound(m_job)) {
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
||||
m_count += N;
|
||||
if (valid) {
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
if (*reinterpret_cast<uint64_t*>(m_hash + (i * 32) + 24) < job.target()) {
|
||||
JobResults::submit(job, current_job_nonces[i], m_hash + (i * 32));
|
||||
}
|
||||
}
|
||||
m_count += N;
|
||||
}
|
||||
|
||||
if (m_yield) {
|
||||
std::this_thread::yield();
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -73,6 +73,7 @@ private:
|
||||
const bool m_hwAES;
|
||||
const bool m_yield;
|
||||
const CnHash::AlgoVariant m_av;
|
||||
const int m_astrobwtMaxSize;
|
||||
const Miner *m_miner;
|
||||
cryptonight_ctx *m_ctx[N];
|
||||
uint8_t m_hash[N * 32]{ 0 };
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
virtual Assembly::Id assembly() const = 0;
|
||||
virtual bool hasAES() const = 0;
|
||||
virtual bool hasAVX2() const = 0;
|
||||
virtual bool hasBMI2() const = 0;
|
||||
virtual bool hasOneGbPages() const = 0;
|
||||
virtual const char *backend() const = 0;
|
||||
virtual const char *brand() const = 0;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -153,6 +153,7 @@ xmrig::AdvancedCpuInfo::AdvancedCpuInfo() :
|
||||
}
|
||||
|
||||
m_avx2 = data.flags[CPU_FEATURE_AVX2] && data.flags[CPU_FEATURE_OSXSAVE];
|
||||
m_bmi2 = data.flags[CPU_FEATURE_BMI2];
|
||||
}
|
||||
|
||||
|
||||
@@ -171,6 +172,17 @@ xmrig::CpuThreads xmrig::AdvancedCpuInfo::threads(const Algorithm &algorithm, ui
|
||||
size_t cache = 0;
|
||||
size_t count = 0;
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
if (algorithm == Algorithm::ASTROBWT_DERO) {
|
||||
CpuThreads t;
|
||||
count = threads();
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
t.add(i, 0);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
# endif
|
||||
|
||||
if (m_L3) {
|
||||
cache = m_L2_exclusive ? (m_L2 + m_L3) : m_L3;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -43,6 +43,7 @@ protected:
|
||||
inline Assembly::Id assembly() const override { return m_assembly; }
|
||||
inline bool hasAES() const override { return m_aes; }
|
||||
inline bool hasAVX2() const override { return m_avx2; }
|
||||
inline bool hasBMI2() const override { return m_bmi2; }
|
||||
inline bool hasOneGbPages() const override { return m_pdpe1gb; }
|
||||
inline const char *backend() const override { return m_backend; }
|
||||
inline const char *brand() const override { return m_brand; }
|
||||
@@ -59,6 +60,7 @@ private:
|
||||
Assembly m_assembly;
|
||||
bool m_aes = false;
|
||||
bool m_avx2 = false;
|
||||
bool m_bmi2 = false;
|
||||
bool m_L2_exclusive = false;
|
||||
char m_backend[32]{};
|
||||
char m_brand[64 + 5]{};
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -45,6 +45,10 @@
|
||||
# define bit_AVX2 (1 << 5)
|
||||
#endif
|
||||
|
||||
#ifndef bit_BMI2
|
||||
# define bit_BMI2 (1 << 8)
|
||||
#endif
|
||||
|
||||
#ifndef bit_PDPE1GB
|
||||
# define bit_PDPE1GB (1 << 26)
|
||||
#endif
|
||||
@@ -141,6 +145,12 @@ static inline bool has_avx2()
|
||||
}
|
||||
|
||||
|
||||
static inline bool has_bmi2()
|
||||
{
|
||||
return has_feature(EXTENDED_FEATURES, EBX_Reg, bit_BMI2);
|
||||
}
|
||||
|
||||
|
||||
static inline bool has_pdpe1gb()
|
||||
{
|
||||
return has_feature(PROCESSOR_EXT_INFO, EDX_Reg, bit_PDPE1GB);
|
||||
@@ -154,6 +164,7 @@ xmrig::BasicCpuInfo::BasicCpuInfo() :
|
||||
m_threads(std::thread::hardware_concurrency()),
|
||||
m_aes(has_aes_ni()),
|
||||
m_avx2(has_avx2()),
|
||||
m_bmi2(has_bmi2()),
|
||||
m_pdpe1gb(has_pdpe1gb())
|
||||
{
|
||||
cpu_brand_string(m_brand);
|
||||
@@ -247,5 +258,15 @@ xmrig::CpuThreads xmrig::BasicCpuInfo::threads(const Algorithm &algorithm, uint3
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
if (algorithm.family() == Algorithm::ASTROBWT) {
|
||||
CpuThreads threads;
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
threads.add(i, 0);
|
||||
}
|
||||
return threads;
|
||||
}
|
||||
# endif
|
||||
|
||||
return CpuThreads(std::max<size_t>(count / 2, 1), 1);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2019 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -44,6 +44,7 @@ protected:
|
||||
inline Assembly::Id assembly() const override { return m_assembly; }
|
||||
inline bool hasAES() const override { return m_aes; }
|
||||
inline bool hasAVX2() const override { return m_avx2; }
|
||||
inline bool hasBMI2() const override { return m_bmi2; }
|
||||
inline bool hasOneGbPages() const override { return m_pdpe1gb; }
|
||||
inline const char *brand() const override { return m_brand; }
|
||||
inline MsrMod msrMod() const override { return m_msrMod; }
|
||||
@@ -63,6 +64,7 @@ private:
|
||||
Assembly m_assembly = Assembly::NONE;
|
||||
bool m_aes = false;
|
||||
const bool m_avx2 = false;
|
||||
const bool m_bmi2 = false;
|
||||
const bool m_pdpe1gb = false;
|
||||
MsrMod m_msrMod = MSR_MOD_NONE;
|
||||
Vendor m_vendor = VENDOR_UNKNOWN;
|
||||
|
||||
@@ -216,6 +216,12 @@ bool xmrig::HwlocCpuInfo::membind(hwloc_const_bitmap_t nodeset)
|
||||
|
||||
xmrig::CpuThreads xmrig::HwlocCpuInfo::threads(const Algorithm &algorithm, uint32_t limit) const
|
||||
{
|
||||
# ifdef XMRIG_ALGO_ASTROBWT
|
||||
if (algorithm == Algorithm::ASTROBWT_DERO) {
|
||||
return BasicCpuInfo::threads(algorithm, limit);
|
||||
}
|
||||
# endif
|
||||
|
||||
if (L2() == 0 && L3() == 0) {
|
||||
return BasicCpuInfo::threads(algorithm, limit);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -254,7 +254,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
LOG_INFO(CYAN_BOLD("#%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CLEAR WHITE_BOLD("%s") "%s",
|
||||
LOG_INFO("%s" CYAN_BOLD(" #%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CLEAR WHITE_BOLD("%s") "%s",
|
||||
tag,
|
||||
device.index(),
|
||||
device.topology().toString().data(),
|
||||
health.power,
|
||||
@@ -338,13 +339,8 @@ const xmrig::String &xmrig::CudaBackend::type() const
|
||||
}
|
||||
|
||||
|
||||
void xmrig::CudaBackend::execCommand(char command)
|
||||
void xmrig::CudaBackend::execCommand(char)
|
||||
{
|
||||
# ifdef XMRIG_FEATURE_NVML
|
||||
if (command == 'e' || command == 'E') {
|
||||
d_ptr->printHealth();
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
@@ -387,6 +383,14 @@ void xmrig::CudaBackend::printHashrate(bool details)
|
||||
}
|
||||
|
||||
|
||||
void xmrig::CudaBackend::printHealth()
|
||||
{
|
||||
# ifdef XMRIG_FEATURE_NVML
|
||||
d_ptr->printHealth();
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
void xmrig::CudaBackend::setJob(const Job &job)
|
||||
{
|
||||
const auto &cuda = d_ptr->controller->config()->cuda();
|
||||
@@ -455,15 +459,6 @@ void xmrig::CudaBackend::stop()
|
||||
void xmrig::CudaBackend::tick(uint64_t ticks)
|
||||
{
|
||||
d_ptr->workers.tick(ticks);
|
||||
|
||||
# ifdef XMRIG_FEATURE_NVML
|
||||
if (isEnabled()) {
|
||||
auto seconds = d_ptr->controller->config()->healthPrintTime();
|
||||
if (seconds && ticks && (ticks % (seconds * 2)) == 0) {
|
||||
d_ptr->printHealth();
|
||||
}
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -59,6 +59,7 @@ protected:
|
||||
void execCommand(char command) override;
|
||||
void prepare(const Job &nextJob) override;
|
||||
void printHashrate(bool details) override;
|
||||
void printHealth() override;
|
||||
void setJob(const Job &job) override;
|
||||
void start(IWorker *worker, bool ready) override;
|
||||
void stop() override;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -115,6 +115,7 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
|
||||
auto rx = CudaThreads(devices, Algorithm::RX_0);
|
||||
auto wow = CudaThreads(devices, Algorithm::RX_WOW);
|
||||
auto arq = CudaThreads(devices, Algorithm::RX_ARQ);
|
||||
auto kva = CudaThreads(devices, Algorithm::RX_KEVA);
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_WOW) && wow != rx) {
|
||||
count += threads.move("rx/wow", std::move(wow));
|
||||
@@ -124,6 +125,10 @@ size_t inline generate<Algorithm::RANDOM_X>(Threads<CudaThreads> &threads, const
|
||||
count += threads.move("rx/arq", std::move(arq));
|
||||
}
|
||||
|
||||
if (!threads.isExist(Algorithm::RX_KEVA) && kva != rx) {
|
||||
count += threads.move("rx/keva", std::move(kva));
|
||||
}
|
||||
|
||||
count += threads.move("rx", std::move(rx));
|
||||
|
||||
return count;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -139,7 +139,9 @@ void xmrig::CudaWorker::start()
|
||||
}
|
||||
|
||||
const size_t batch_size = intensity();
|
||||
m_job.nextRound(roundSize(batch_size), batch_size);
|
||||
if (!m_job.nextRound(roundSize(batch_size), batch_size)) {
|
||||
JobResults::done(m_job.currentJob());
|
||||
}
|
||||
|
||||
storeStats();
|
||||
std::this_thread::yield();
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -27,11 +27,11 @@
|
||||
#include <string>
|
||||
|
||||
|
||||
#include "backend/opencl/OclBackend.h"
|
||||
#include "backend/common/Hashrate.h"
|
||||
#include "backend/common/interfaces/IWorker.h"
|
||||
#include "backend/common/Tags.h"
|
||||
#include "backend/common/Workers.h"
|
||||
#include "backend/opencl/OclBackend.h"
|
||||
#include "backend/opencl/OclConfig.h"
|
||||
#include "backend/opencl/OclLaunchData.h"
|
||||
#include "backend/opencl/OclWorker.h"
|
||||
@@ -52,6 +52,13 @@
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_ADL
|
||||
#include "backend/opencl/wrappers/AdlLib.h"
|
||||
|
||||
namespace xmrig { static const char *kAdlLabel = "ADL"; }
|
||||
#endif
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
@@ -59,14 +66,15 @@ extern template class Threads<OclThreads>;
|
||||
|
||||
|
||||
constexpr const size_t oneMiB = 1024U * 1024U;
|
||||
static const char *kLabel = "OPENCL";
|
||||
static const char *tag = MAGENTA_BG_BOLD(WHITE_BOLD_S " ocl ");
|
||||
static const String kType = "opencl";
|
||||
static std::mutex mutex;
|
||||
|
||||
|
||||
static void printDisabled(const char *reason)
|
||||
static void printDisabled(const char *label, const char *reason)
|
||||
{
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") RED_BOLD("disabled") "%s", "OPENCL", reason);
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") RED_BOLD("disabled") "%s", label, reason);
|
||||
}
|
||||
|
||||
|
||||
@@ -129,11 +137,11 @@ public:
|
||||
void init(const OclConfig &cl)
|
||||
{
|
||||
if (!cl.isEnabled()) {
|
||||
return printDisabled("");
|
||||
return printDisabled(kLabel, "");
|
||||
}
|
||||
|
||||
if (!OclLib::init(cl.loader())) {
|
||||
return printDisabled(RED_S " (failed to load OpenCL runtime)");
|
||||
return printDisabled(kLabel, RED_S " (failed to load OpenCL runtime)");
|
||||
}
|
||||
|
||||
if (platform.isValid()) {
|
||||
@@ -142,14 +150,30 @@ public:
|
||||
|
||||
platform = cl.platform();
|
||||
if (!platform.isValid()) {
|
||||
return printDisabled(RED_S " (selected OpenCL platform NOT found)");
|
||||
return printDisabled(kLabel, RED_S " (selected OpenCL platform NOT found)");
|
||||
}
|
||||
|
||||
devices = platform.devices();
|
||||
if (devices.empty()) {
|
||||
return printDisabled(RED_S " (no devices)");
|
||||
return printDisabled(kLabel, RED_S " (no devices)");
|
||||
}
|
||||
|
||||
# ifdef XMRIG_FEATURE_ADL
|
||||
if (cl.isAdlEnabled()) {
|
||||
if (AdlLib::init()) {
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") "press " MAGENTA_BG(WHITE_BOLD_S "e") " for health report",
|
||||
kAdlLabel
|
||||
);
|
||||
}
|
||||
else {
|
||||
printDisabled(kAdlLabel, RED_S " (failed to load ADL)");
|
||||
}
|
||||
}
|
||||
else {
|
||||
printDisabled(kAdlLabel, "");
|
||||
}
|
||||
# endif
|
||||
|
||||
Log::print(GREEN_BOLD(" * ") WHITE_BOLD("%-13s") CYAN_BOLD("#%zu ") WHITE_BOLD("%s") "/" WHITE_BOLD("%s"), "OPENCL", platform.index(), platform.name().data(), platform.version().data());
|
||||
|
||||
for (const OclDevice &device : devices) {
|
||||
@@ -204,6 +228,32 @@ public:
|
||||
}
|
||||
|
||||
|
||||
# ifdef XMRIG_FEATURE_ADL
|
||||
void printHealth()
|
||||
{
|
||||
if (!AdlLib::isReady()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto &device : devices) {
|
||||
const auto health = AdlLib::health(device);
|
||||
|
||||
LOG_INFO("%s" CYAN_BOLD(" #%u") YELLOW(" %s") MAGENTA_BOLD("%4uW") CSI "1;%um %2uC" CYAN_BOLD(" %4u") CYAN("RPM") WHITE_BOLD(" %u/%u") "MHz",
|
||||
tag,
|
||||
device.index(),
|
||||
device.topology().toString().data(),
|
||||
health.power,
|
||||
health.temperature < 60 ? 32 : (health.temperature > 85 ? 31 : 33),
|
||||
health.temperature,
|
||||
health.rpm,
|
||||
health.clock,
|
||||
health.memClock
|
||||
);
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
|
||||
Algorithm algo;
|
||||
Controller *controller;
|
||||
OclContext context;
|
||||
@@ -237,6 +287,10 @@ xmrig::OclBackend::~OclBackend()
|
||||
delete d_ptr;
|
||||
|
||||
OclLib::close();
|
||||
|
||||
# ifdef XMRIG_FEATURE_ADL
|
||||
AdlLib::close();
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
@@ -270,6 +324,11 @@ const xmrig::String &xmrig::OclBackend::type() const
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclBackend::execCommand(char)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclBackend::prepare(const Job &)
|
||||
{
|
||||
}
|
||||
@@ -309,6 +368,14 @@ void xmrig::OclBackend::printHashrate(bool details)
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclBackend::printHealth()
|
||||
{
|
||||
# ifdef XMRIG_FEATURE_ADL
|
||||
d_ptr->printHealth();
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
void xmrig::OclBackend::setJob(const Job &job)
|
||||
{
|
||||
const auto &cl = d_ptr->controller->config()->cl();
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -51,15 +51,15 @@ public:
|
||||
~OclBackend() override;
|
||||
|
||||
protected:
|
||||
inline void execCommand(char) override {}
|
||||
|
||||
bool isEnabled() const override;
|
||||
bool isEnabled(const Algorithm &algorithm) const override;
|
||||
const Hashrate *hashrate() const override;
|
||||
const String &profileName() const override;
|
||||
const String &type() const override;
|
||||
void execCommand(char command) override;
|
||||
void prepare(const Job &nextJob) override;
|
||||
void printHashrate(bool details) override;
|
||||
void printHealth() override;
|
||||
void setJob(const Job &job) override;
|
||||
void start(IWorker *worker, bool ready) override;
|
||||
void stop() override;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -35,14 +35,21 @@
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static const char *kAMD = "AMD";
|
||||
static const char *kCache = "cache";
|
||||
static const char *kDevicesHint = "devices-hint";
|
||||
static const char *kEnabled = "enabled";
|
||||
static const char *kINTEL = "INTEL";
|
||||
static const char *kLoader = "loader";
|
||||
|
||||
#ifndef XMRIG_OS_APPLE
|
||||
static const char *kAMD = "AMD";
|
||||
static const char *kINTEL = "INTEL";
|
||||
static const char *kNVIDIA = "NVIDIA";
|
||||
static const char *kPlatform = "platform";
|
||||
#endif
|
||||
|
||||
#ifdef XMRIG_FEATURE_ADL
|
||||
static const char *kAdl = "adl";
|
||||
#endif
|
||||
|
||||
|
||||
extern template class Threads<OclThreads>;
|
||||
@@ -51,10 +58,11 @@ extern template class Threads<OclThreads>;
|
||||
}
|
||||
|
||||
|
||||
xmrig::OclConfig::OclConfig() :
|
||||
m_platformVendor(kAMD)
|
||||
{
|
||||
}
|
||||
#ifndef XMRIG_OS_APPLE
|
||||
xmrig::OclConfig::OclConfig() : m_platformVendor(kAMD) {}
|
||||
#else
|
||||
xmrig::OclConfig::OclConfig() = default;
|
||||
#endif
|
||||
|
||||
|
||||
xmrig::OclPlatform xmrig::OclConfig::platform() const
|
||||
@@ -64,6 +72,7 @@ xmrig::OclPlatform xmrig::OclConfig::platform() const
|
||||
return {};
|
||||
}
|
||||
|
||||
# ifndef XMRIG_OS_APPLE
|
||||
if (!m_platformVendor.isEmpty()) {
|
||||
String search;
|
||||
String vendor = m_platformVendor;
|
||||
@@ -93,6 +102,9 @@ xmrig::OclPlatform xmrig::OclConfig::platform() const
|
||||
}
|
||||
|
||||
return {};
|
||||
# else
|
||||
return platforms[0];
|
||||
# endif
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +118,14 @@ rapidjson::Value xmrig::OclConfig::toJSON(rapidjson::Document &doc) const
|
||||
obj.AddMember(StringRef(kEnabled), m_enabled, allocator);
|
||||
obj.AddMember(StringRef(kCache), m_cache, allocator);
|
||||
obj.AddMember(StringRef(kLoader), m_loader.toJSON(), allocator);
|
||||
|
||||
# ifndef XMRIG_OS_APPLE
|
||||
obj.AddMember(StringRef(kPlatform), m_platformVendor.isEmpty() ? Value(m_platformIndex) : m_platformVendor.toJSON(), allocator);
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_ADL
|
||||
obj.AddMember(StringRef(kAdl), m_adl, allocator);
|
||||
# endif
|
||||
|
||||
m_threads.toJSON(obj, doc);
|
||||
|
||||
@@ -152,9 +171,16 @@ void xmrig::OclConfig::read(const rapidjson::Value &value)
|
||||
m_cache = Json::getBool(value, kCache, m_cache);
|
||||
m_loader = Json::getString(value, kLoader);
|
||||
|
||||
# ifndef XMRIG_OS_APPLE
|
||||
setPlatform(Json::getValue(value, kPlatform));
|
||||
# endif
|
||||
|
||||
setDevicesHint(Json::getString(value, kDevicesHint));
|
||||
|
||||
# ifdef XMRIG_FEATURE_ADL
|
||||
m_adl = Json::getBool(value, kAdl, m_adl);
|
||||
# endif
|
||||
|
||||
m_threads.read(value);
|
||||
|
||||
generate();
|
||||
@@ -214,6 +240,7 @@ void xmrig::OclConfig::setDevicesHint(const char *devicesHint)
|
||||
}
|
||||
|
||||
|
||||
#ifndef XMRIG_OS_APPLE
|
||||
void xmrig::OclConfig::setPlatform(const rapidjson::Value &platform)
|
||||
{
|
||||
if (platform.IsString()) {
|
||||
@@ -224,3 +251,4 @@ void xmrig::OclConfig::setPlatform(const rapidjson::Value &platform)
|
||||
m_platformIndex = platform.GetUint();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -51,19 +51,31 @@ public:
|
||||
inline const String &loader() const { return m_loader; }
|
||||
inline const Threads<OclThreads> &threads() const { return m_threads; }
|
||||
|
||||
# ifdef XMRIG_FEATURE_ADL
|
||||
inline bool isAdlEnabled() const { return m_adl; }
|
||||
# endif
|
||||
|
||||
private:
|
||||
void generate();
|
||||
void setDevicesHint(const char *devicesHint);
|
||||
void setPlatform(const rapidjson::Value &platform);
|
||||
|
||||
bool m_cache = true;
|
||||
bool m_enabled = false;
|
||||
bool m_shouldSave = false;
|
||||
std::vector<uint32_t> m_devicesHint;
|
||||
String m_loader;
|
||||
String m_platformVendor;
|
||||
Threads<OclThreads> m_threads;
|
||||
|
||||
# ifndef XMRIG_OS_APPLE
|
||||
void setPlatform(const rapidjson::Value &platform);
|
||||
|
||||
String m_platformVendor;
|
||||
uint32_t m_platformIndex = 0;
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_ADL
|
||||
bool m_adl = true;
|
||||
# endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
|
||||
#include "backend/opencl/OclWorker.h"
|
||||
|
||||
#include "backend/common/Tags.h"
|
||||
#include "backend/opencl/runners/OclCnRunner.h"
|
||||
#include "backend/opencl/runners/tools/OclSharedData.h"
|
||||
@@ -187,7 +186,9 @@ void xmrig::OclWorker::start()
|
||||
JobResults::submit(m_job.currentJob(), results, results[0xFF]);
|
||||
}
|
||||
|
||||
m_job.nextRound(roundSize(m_intensity), m_intensity);
|
||||
if (!m_job.nextRound(roundSize(m_intensity), m_intensity)) {
|
||||
JobResults::done(m_job.currentJob());
|
||||
}
|
||||
|
||||
storeStats(t);
|
||||
std::this_thread::yield();
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -22,8 +22,10 @@
|
||||
#define ALGO_RX_LOKI 21
|
||||
#define ALGO_RX_ARQMA 22
|
||||
#define ALGO_RX_SFX 23
|
||||
#define ALGO_AR2_CHUKWA 24
|
||||
#define ALGO_AR2_WRKZ 25
|
||||
#define ALGO_RX_KEVA 24
|
||||
#define ALGO_AR2_CHUKWA 25
|
||||
#define ALGO_AR2_WRKZ 26
|
||||
#define ALGO_ASTROBWT_DERO 27
|
||||
|
||||
#define FAMILY_UNKNOWN 0
|
||||
#define FAMILY_CN 1
|
||||
@@ -32,3 +34,4 @@
|
||||
#define FAMILY_CN_PICO 4
|
||||
#define FAMILY_RANDOM_X 5
|
||||
#define FAMILY_ARGON2 6
|
||||
#define FAMILY_ASTROBWT 7
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,8 @@
|
||||
#include "randomx_constants_loki.h"
|
||||
#elif (ALGO == ALGO_RX_ARQMA)
|
||||
#include "randomx_constants_arqma.h"
|
||||
#elif (ALGO == ALGO_RX_KEVA)
|
||||
#include "randomx_constants_keva.h"
|
||||
#endif
|
||||
|
||||
#include "aes.cl"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
96
src/backend/opencl/cl/rx/randomx_constants_keva.h
Normal file
96
src/backend/opencl/cl/rx/randomx_constants_keva.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
Copyright (c) 2019 SChernykh
|
||||
|
||||
This file is part of RandomX OpenCL.
|
||||
|
||||
RandomX OpenCL is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
RandomX OpenCL is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//Dataset base size in bytes. Must be a power of 2.
|
||||
#define RANDOMX_DATASET_BASE_SIZE 2147483648
|
||||
|
||||
//Dataset extra size. Must be divisible by 64.
|
||||
#define RANDOMX_DATASET_EXTRA_SIZE 33554368
|
||||
|
||||
//Scratchpad L3 size in bytes. Must be a power of 2.
|
||||
#define RANDOMX_SCRATCHPAD_L3 1048576
|
||||
|
||||
//Scratchpad L2 size in bytes. Must be a power of two and less than or equal to RANDOMX_SCRATCHPAD_L3.
|
||||
#define RANDOMX_SCRATCHPAD_L2 131072
|
||||
|
||||
//Scratchpad L1 size in bytes. Must be a power of two (minimum 64) and less than or equal to RANDOMX_SCRATCHPAD_L2.
|
||||
#define RANDOMX_SCRATCHPAD_L1 16384
|
||||
|
||||
//Jump condition mask size in bits.
|
||||
#define RANDOMX_JUMP_BITS 8
|
||||
|
||||
//Jump condition mask offset in bits. The sum of RANDOMX_JUMP_BITS and RANDOMX_JUMP_OFFSET must not exceed 16.
|
||||
#define RANDOMX_JUMP_OFFSET 8
|
||||
|
||||
//Integer instructions
|
||||
#define RANDOMX_FREQ_IADD_RS 16
|
||||
#define RANDOMX_FREQ_IADD_M 7
|
||||
#define RANDOMX_FREQ_ISUB_R 16
|
||||
#define RANDOMX_FREQ_ISUB_M 7
|
||||
#define RANDOMX_FREQ_IMUL_R 16
|
||||
#define RANDOMX_FREQ_IMUL_M 4
|
||||
#define RANDOMX_FREQ_IMULH_R 4
|
||||
#define RANDOMX_FREQ_IMULH_M 1
|
||||
#define RANDOMX_FREQ_ISMULH_R 4
|
||||
#define RANDOMX_FREQ_ISMULH_M 1
|
||||
#define RANDOMX_FREQ_IMUL_RCP 8
|
||||
#define RANDOMX_FREQ_INEG_R 2
|
||||
#define RANDOMX_FREQ_IXOR_R 15
|
||||
#define RANDOMX_FREQ_IXOR_M 5
|
||||
#define RANDOMX_FREQ_IROR_R 8
|
||||
#define RANDOMX_FREQ_IROL_R 2
|
||||
#define RANDOMX_FREQ_ISWAP_R 4
|
||||
|
||||
//Floating point instructions
|
||||
#define RANDOMX_FREQ_FSWAP_R 4
|
||||
#define RANDOMX_FREQ_FADD_R 16
|
||||
#define RANDOMX_FREQ_FADD_M 5
|
||||
#define RANDOMX_FREQ_FSUB_R 16
|
||||
#define RANDOMX_FREQ_FSUB_M 5
|
||||
#define RANDOMX_FREQ_FSCAL_R 6
|
||||
#define RANDOMX_FREQ_FMUL_R 32
|
||||
#define RANDOMX_FREQ_FDIV_M 4
|
||||
#define RANDOMX_FREQ_FSQRT_R 6
|
||||
|
||||
//Control instructions
|
||||
#define RANDOMX_FREQ_CBRANCH 25
|
||||
#define RANDOMX_FREQ_CFROUND 1
|
||||
|
||||
//Store instruction
|
||||
#define RANDOMX_FREQ_ISTORE 16
|
||||
|
||||
//No-op instruction
|
||||
#define RANDOMX_FREQ_NOP 0
|
||||
|
||||
#define RANDOMX_DATASET_ITEM_SIZE 64
|
||||
|
||||
#define RANDOMX_PROGRAM_SIZE 256
|
||||
|
||||
#define HASH_SIZE 64
|
||||
#define ENTROPY_SIZE (128 + RANDOMX_PROGRAM_SIZE * 8)
|
||||
#define REGISTERS_SIZE 256
|
||||
#define IMM_BUF_SIZE (RANDOMX_PROGRAM_SIZE * 4 - REGISTERS_SIZE)
|
||||
#define IMM_INDEX_COUNT ((IMM_BUF_SIZE / 4) - 2)
|
||||
#define VM_STATE_SIZE (REGISTERS_SIZE + IMM_BUF_SIZE + RANDOMX_PROGRAM_SIZE * 4)
|
||||
#define ROUNDING_MODE (RANDOMX_FREQ_CFROUND ? -1 : 0)
|
||||
|
||||
// Scratchpad L1/L2/L3 bits
|
||||
#define LOC_L1 (32 - 14)
|
||||
#define LOC_L2 (32 - 17)
|
||||
#define LOC_L3 (32 - 20)
|
||||
@@ -43,6 +43,62 @@ along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RANDOMX_JUMP_BITS 8
|
||||
#define RANDOMX_JUMP_OFFSET 8
|
||||
|
||||
#if GCN_VERSION >= 15
|
||||
|
||||
#define S_SETPC_B64_S12_13 0xbe80200cu
|
||||
#define V_AND_B32_CALC_ADDRESS 0x3638000eu
|
||||
#define GLOBAL_LOAD_DWORDX2_SCRATCHPAD_LOAD 0xdc348000u
|
||||
#define S_WAITCNT_SCRATCHPAD_LOAD2 0xbf8c3f70u
|
||||
#define V_READLANE_B32_SCRATCHPAD_LOAD2 0xd7600000u
|
||||
#define S_MUL_HI_U32_IMUL_R 0x9a8f1010u
|
||||
#define S_MUL_I32_IMUL 0x93000000u
|
||||
#define S_MUL_HI_U32_IMUL_R_2 0x9a8fff10u
|
||||
#define S_MUL_HI_U32_IMUL_M 0x9aa10e10u
|
||||
#define S_MOV_B32_IMUL_RCP 0xbea003ffu
|
||||
#define S_MUL_HI_U32_IMUL_RCP 0x9a8f2010u
|
||||
#define S_XOR_B32_64 0x89000000u
|
||||
#define S_MOV_B32_XOR_R 0xbebe03ffu
|
||||
#define S_LSHR 0x90000000u
|
||||
#define S_LSHL 0x8f000000u
|
||||
#define S_OR 0x88000000u
|
||||
#define S_AND 0x87000000u
|
||||
#define S_BFE 0x94000000u
|
||||
#define DS_SWIZZLE_B32_FSWAP_R 0xd8d48001u
|
||||
#define V_ADD_F64 0xd564003cu
|
||||
#define V_AND_B32 0x36000000u
|
||||
#define GLOBAL_LOAD_DWORD_SCRATCHPAD_LOAD_FP 0xdc308000u
|
||||
#define V_XOR_B32 0x3a000000u
|
||||
#define V_MUL_F64 0xd5650044u
|
||||
|
||||
#else
|
||||
|
||||
#define S_SETPC_B64_S12_13 0xbe801d0cu
|
||||
#define V_AND_B32_CALC_ADDRESS 0x2638000eu
|
||||
#define GLOBAL_LOAD_DWORDX2_SCRATCHPAD_LOAD 0xdc548000u
|
||||
#define S_WAITCNT_SCRATCHPAD_LOAD2 0xbf8c0f70u
|
||||
#define V_READLANE_B32_SCRATCHPAD_LOAD2 0xd2890000u
|
||||
#define S_MUL_HI_U32_IMUL_R 0x960f1010u
|
||||
#define S_MUL_I32_IMUL 0x92000000u
|
||||
#define S_MUL_HI_U32_IMUL_R_2 0x960fff10u
|
||||
#define S_MUL_HI_U32_IMUL_M 0x96210e10u
|
||||
#define S_MOV_B32_IMUL_RCP 0xbea000ffu
|
||||
#define S_MUL_HI_U32_IMUL_RCP 0x960f2010u
|
||||
#define S_XOR_B32_64 0x88000000u
|
||||
#define S_MOV_B32_XOR_R 0xbebe00ffu
|
||||
#define S_LSHR 0x8f000000u
|
||||
#define S_LSHL 0x8e000000u
|
||||
#define S_OR 0x87000000u
|
||||
#define S_AND 0x86000000u
|
||||
#define S_BFE 0x93000000u
|
||||
#define DS_SWIZZLE_B32_FSWAP_R 0xd87a8001u
|
||||
#define V_ADD_F64 0xd280003cu
|
||||
#define V_AND_B32 0x26000000u
|
||||
#define GLOBAL_LOAD_DWORD_SCRATCHPAD_LOAD_FP 0xdc508000u
|
||||
#define V_XOR_B32 0x2a000000u
|
||||
#define V_MUL_F64 0xd2810044u
|
||||
|
||||
#endif
|
||||
|
||||
__global uint* jit_scratchpad_calc_address(__global uint* p, uint src, uint imm32, uint mask_reg, uint batch_size)
|
||||
{
|
||||
// s_add_i32 s14, s(16 + src * 2), imm32
|
||||
@@ -50,7 +106,7 @@ __global uint* jit_scratchpad_calc_address(__global uint* p, uint src, uint imm3
|
||||
*(p++) = imm32;
|
||||
|
||||
// v_and_b32 v28, s14, mask_reg
|
||||
*(p++) = 0x2638000eu | (mask_reg << 9);
|
||||
*(p++) = V_AND_B32_CALC_ADDRESS | (mask_reg << 9);
|
||||
|
||||
return p;
|
||||
}
|
||||
@@ -70,7 +126,7 @@ __global uint* jit_scratchpad_load(__global uint* p, uint vgpr_index)
|
||||
|
||||
#if GCN_VERSION >= 14
|
||||
// global_load_dwordx2 v[vgpr_index:vgpr_index+1], v28, s[0:1]
|
||||
*(p++) = 0xdc548000u;
|
||||
*(p++) = GLOBAL_LOAD_DWORDX2_SCRATCHPAD_LOAD;
|
||||
*(p++) = 0x0000001cu | (vgpr_index << 24);
|
||||
#else
|
||||
*(p++) = 0x32543902u; // v_add_u32 v42, vcc, v2, v28
|
||||
@@ -87,14 +143,14 @@ __global uint* jit_scratchpad_load2(__global uint* p, uint vgpr_index, int vmcnt
|
||||
{
|
||||
// s_waitcnt vmcnt(N)
|
||||
if (vmcnt >= 0)
|
||||
*(p++) = 0xbf8c0f70u | (vmcnt & 15) | ((vmcnt >> 4) << 14);
|
||||
*(p++) = S_WAITCNT_SCRATCHPAD_LOAD2 | (vmcnt & 15) | ((vmcnt >> 4) << 14);
|
||||
|
||||
// v_readlane_b32 s14, vgpr_index, 0
|
||||
*(p++) = 0xd289000eu;
|
||||
*(p++) = V_READLANE_B32_SCRATCHPAD_LOAD2 | 14;
|
||||
*(p++) = 0x00010100u | vgpr_index;
|
||||
|
||||
// v_readlane_b32 s15, vgpr_index + 1, 0
|
||||
*(p++) = 0xd289000fu;
|
||||
*(p++) = V_READLANE_B32_SCRATCHPAD_LOAD2 | 15;
|
||||
*(p++) = 0x00010100u | (vgpr_index + 1);
|
||||
|
||||
return p;
|
||||
@@ -107,9 +163,12 @@ __global uint* jit_scratchpad_calc_address_fp(__global uint* p, uint src, uint i
|
||||
*(p++) = imm32;
|
||||
|
||||
// v_and_b32 v28, s14, mask_reg
|
||||
*(p++) = 0x2638000eu | (mask_reg << 9);
|
||||
*(p++) = V_AND_B32 | 0x38000eu | (mask_reg << 9);
|
||||
|
||||
#if GCN_VERSION >= 14
|
||||
#if GCN_VERSION >= 15
|
||||
// v_add_nc_u32 v28, v28, v44
|
||||
*(p++) = 0x4a38591cu;
|
||||
#elif GCN_VERSION == 14
|
||||
// v_add_u32 v28, v28, v44
|
||||
*(p++) = 0x6838591cu;
|
||||
#else
|
||||
@@ -126,7 +185,7 @@ __global uint* jit_scratchpad_load_fp(__global uint* p, uint vgpr_index)
|
||||
|
||||
#if GCN_VERSION >= 14
|
||||
// global_load_dword v(vgpr_index), v28, s[0:1]
|
||||
*(p++) = 0xdc508000u;
|
||||
*(p++) = GLOBAL_LOAD_DWORD_SCRATCHPAD_LOAD_FP;
|
||||
*(p++) = 0x0000001cu | (vgpr_index << 24);
|
||||
#else
|
||||
*(p++) = 0x32543902u; // v_add_u32 v42, vcc, v2, v28
|
||||
@@ -143,7 +202,7 @@ __global uint* jit_scratchpad_load2_fp(__global uint* p, uint vgpr_index, int vm
|
||||
{
|
||||
// s_waitcnt vmcnt(N)
|
||||
if (vmcnt >= 0)
|
||||
*(p++) = 0xbf8c0f70u | (vmcnt & 15) | ((vmcnt >> 4) << 14);
|
||||
*(p++) = S_WAITCNT_SCRATCHPAD_LOAD2 | (vmcnt & 15) | ((vmcnt >> 4) << 14);
|
||||
|
||||
// v_cvt_f64_i32 v[28:29], vgpr_index
|
||||
*(p++) = 0x7e380900u | vgpr_index;
|
||||
@@ -164,7 +223,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
if (shift > 0) // p = 3/4
|
||||
{
|
||||
// s_lshl_b64 s[14:15], s[(16 + src * 2):(17 + src * 2)], shift
|
||||
*(p++) = 0x8e8e8010u | (src << 1) | (shift << 8);
|
||||
*(p++) = S_LSHL | 0x8e8010u | (src << 1) | (shift << 8);
|
||||
|
||||
// s_add_u32 s(16 + dst * 2), s(16 + dst * 2), s14
|
||||
*(p++) = 0x80100e10u | (dst << 1) | (dst << 17);
|
||||
@@ -283,7 +342,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
{
|
||||
#if GCN_VERSION >= 14
|
||||
// s_mul_hi_u32 s15, s(16 + dst * 2), s(16 + src * 2)
|
||||
*(p++) = 0x960f1010u | (dst << 1) | (src << 9);
|
||||
*(p++) = S_MUL_HI_U32_IMUL_R | (dst << 1) | (src << 9);
|
||||
#else
|
||||
// v_mov_b32 v28, s(16 + dst * 2)
|
||||
*(p++) = 0x7e380210u | (dst << 1);
|
||||
@@ -296,25 +355,25 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
#endif
|
||||
|
||||
// s_mul_i32 s14, s(16 + dst * 2), s(17 + src * 2)
|
||||
*(p++) = 0x920e1110u | (dst << 1) | (src << 9);
|
||||
*(p++) = S_MUL_I32_IMUL | 0x0e1110u | (dst << 1) | (src << 9);
|
||||
|
||||
// s_add_u32 s15, s15, s14
|
||||
*(p++) = 0x800f0e0fu;
|
||||
|
||||
// s_mul_i32 s14, s(17 + dst * 2), s(16 + src * 2)
|
||||
*(p++) = 0x920e1011u | (dst << 1) | (src << 9);
|
||||
*(p++) = S_MUL_I32_IMUL | 0x0e1011u | (dst << 1) | (src << 9);
|
||||
|
||||
// s_add_u32 s(17 + dst * 2), s15, s14
|
||||
*(p++) = 0x80110e0fu | (dst << 17);
|
||||
|
||||
// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s(16 + src * 2)
|
||||
*(p++) = 0x92101010u | (dst << 1) | (dst << 17) | (src << 9);
|
||||
*(p++) = S_MUL_I32_IMUL | 0x101010u | (dst << 1) | (dst << 17) | (src << 9);
|
||||
}
|
||||
else // p = 1/8
|
||||
{
|
||||
#if GCN_VERSION >= 14
|
||||
// s_mul_hi_u32 s15, s(16 + dst * 2), imm32
|
||||
*(p++) = 0x960fff10u | (dst << 1);
|
||||
*(p++) = S_MUL_HI_U32_IMUL_R_2 | (dst << 1);
|
||||
*(p++) = inst.y;
|
||||
#else
|
||||
// v_mov_b32 v28, imm32
|
||||
@@ -335,14 +394,14 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
}
|
||||
|
||||
// s_mul_i32 s14, s(17 + dst * 2), imm32
|
||||
*(p++) = 0x920eff11u | (dst << 1);
|
||||
*(p++) = S_MUL_I32_IMUL | 0x0eff11u | (dst << 1);
|
||||
*(p++) = inst.y;
|
||||
|
||||
// s_add_u32 s(17 + dst * 2), s15, s14
|
||||
*(p++) = 0x80110e0fu | (dst << 17);
|
||||
|
||||
// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), imm32
|
||||
*(p++) = 0x9210ff10u | (dst << 1) | (dst << 17);
|
||||
*(p++) = S_MUL_I32_IMUL | 0x10ff10u | (dst << 1) | (dst << 17);
|
||||
*(p++) = inst.y;
|
||||
}
|
||||
|
||||
@@ -369,7 +428,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
|
||||
#if GCN_VERSION >= 14
|
||||
// s_mul_hi_u32 s33, s(16 + dst * 2), s14
|
||||
*(p++) = 0x96210e10u | (dst << 1);
|
||||
*(p++) = S_MUL_HI_U32_IMUL_M | (dst << 1);
|
||||
#else
|
||||
// v_mov_b32 v28, s(16 + dst * 2)
|
||||
*(p++) = 0x7e380210u | (dst << 1);
|
||||
@@ -382,19 +441,19 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
#endif
|
||||
|
||||
// s_mul_i32 s32, s(16 + dst * 2), s15
|
||||
*(p++) = 0x92200f10u | (dst << 1);
|
||||
*(p++) = S_MUL_I32_IMUL | 0x200f10u | (dst << 1);
|
||||
|
||||
// s_add_u32 s33, s33, s32
|
||||
*(p++) = 0x80212021u;
|
||||
|
||||
// s_mul_i32 s32, s(17 + dst * 2), s14
|
||||
*(p++) = 0x92200e11u | (dst << 1);
|
||||
*(p++) = S_MUL_I32_IMUL | 0x200e11u | (dst << 1);
|
||||
|
||||
// s_add_u32 s(17 + dst * 2), s33, s32
|
||||
*(p++) = 0x80112021u | (dst << 17);
|
||||
|
||||
// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s14
|
||||
*(p++) = 0x92100e10u | (dst << 1) | (dst << 17);
|
||||
*(p++) = S_MUL_I32_IMUL | 0x100e10u | (dst << 1) | (dst << 17);
|
||||
}
|
||||
|
||||
// (12*7/8 + 8*1/8 + 28) + 24 = 63.5 bytes on average
|
||||
@@ -404,10 +463,17 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
|
||||
if (opcode < RANDOMX_FREQ_IMULH_R)
|
||||
{
|
||||
#if GCN_VERSION >= 15
|
||||
*(p++) = 0xbe8e0410u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
|
||||
*(p++) = 0xbea60410u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
|
||||
*(p++) = 0xbebc213au; // s_swappc_b64 s[60:61], s[58:59]
|
||||
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
|
||||
#else
|
||||
*(p++) = 0xbe8e0110u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
|
||||
*(p++) = 0xbea60110u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
|
||||
*(p++) = 0xbebc1e3au; // s_swappc_b64 s[60:61], s[58:59]
|
||||
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
|
||||
#endif
|
||||
|
||||
// 16 bytes
|
||||
return p;
|
||||
@@ -430,9 +496,15 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
{
|
||||
p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
|
||||
|
||||
#if GCN_VERSION >= 15
|
||||
*(p++) = 0xbea60410u | (dst << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
|
||||
*(p++) = 0xbebc213au; // s_swappc_b64 s[60:61], s[58:59]
|
||||
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
|
||||
#else
|
||||
*(p++) = 0xbea60110u | (dst << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
|
||||
*(p++) = 0xbebc1e3au; // s_swappc_b64 s[60:61], s[58:59]
|
||||
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
|
||||
#endif
|
||||
}
|
||||
|
||||
// (12*7/8 + 8*1/8 + 28) + 12 = 51.5 bytes on average
|
||||
@@ -442,10 +514,17 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
|
||||
if (opcode < RANDOMX_FREQ_ISMULH_R)
|
||||
{
|
||||
#if GCN_VERSION >= 15
|
||||
*(p++) = 0xbe8e0410u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
|
||||
*(p++) = 0xbea60410u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
|
||||
*(p++) = 0xbebc2138u; // s_swappc_b64 s[60:61], s[56:57]
|
||||
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
|
||||
#else
|
||||
*(p++) = 0xbe8e0110u | (dst << 1); // s_mov_b64 s[14:15], s[16 + dst * 2:17 + dst * 2]
|
||||
*(p++) = 0xbea60110u | (src << 1); // s_mov_b64 s[38:39], s[16 + src * 2:17 + src * 2]
|
||||
*(p++) = 0xbebc1e38u; // s_swappc_b64 s[60:61], s[56:57]
|
||||
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
|
||||
#endif
|
||||
|
||||
// 16 bytes
|
||||
return p;
|
||||
@@ -468,9 +547,15 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
{
|
||||
p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
|
||||
|
||||
#if GCN_VERSION >= 15
|
||||
*(p++) = 0xbea60410u | (dst << 1); // s_mov_b64 s[38:39], s[16 + dst * 2:17 + dst * 2]
|
||||
*(p++) = 0xbebc2138u; // s_swappc_b64 s[60:61], s[56:57]
|
||||
*(p++) = 0xbe90040eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
|
||||
#else
|
||||
*(p++) = 0xbea60110u | (dst << 1); // s_mov_b64 s[38:39], s[16 + dst * 2:17 + dst * 2]
|
||||
*(p++) = 0xbebc1e38u; // s_swappc_b64 s[60:61], s[56:57]
|
||||
*(p++) = 0xbe90010eu | (dst << 17); // s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[14:15]
|
||||
#endif
|
||||
}
|
||||
|
||||
// (12*7/8 + 8*1/8 + 28) + 12 = 51.5 bytes on average
|
||||
@@ -484,10 +569,10 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
{
|
||||
const uint2 rcp_value = as_uint2(imul_rcp_value(inst.y));
|
||||
|
||||
*(p++) = 0xbea000ffu; // s_mov_b32 s32, imm32
|
||||
*(p++) = S_MOV_B32_IMUL_RCP; // s_mov_b32 s32, imm32
|
||||
*(p++) = rcp_value.x;
|
||||
#if GCN_VERSION >= 14
|
||||
*(p++) = 0x960f2010u | (dst << 1); // s_mul_hi_u32 s15, s(16 + dst * 2), s32
|
||||
*(p++) = S_MUL_HI_U32_IMUL_RCP | (dst << 1); // s_mul_hi_u32 s15, s(16 + dst * 2), s32
|
||||
#else
|
||||
// v_mov_b32 v28, s32
|
||||
*(p++) = 0x7e380220u;
|
||||
@@ -498,12 +583,12 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
*(p++) = 0xd289000fu;
|
||||
*(p++) = 0x0001011cu;
|
||||
#endif
|
||||
*(p++) = 0x920eff10u | (dst << 1); // s_mul_i32 s14, s(16 + dst * 2), imm32
|
||||
*(p++) = S_MUL_I32_IMUL | 0x0eff10u | (dst << 1); // s_mul_i32 s14, s(16 + dst * 2), imm32
|
||||
*(p++) = rcp_value.y;
|
||||
*(p++) = 0x800f0e0fu; // s_add_u32 s15, s15, s14
|
||||
*(p++) = 0x920e2011u | (dst << 1); // s_mul_i32 s14, s(17 + dst * 2), s32
|
||||
*(p++) = S_MUL_I32_IMUL | 0x0e2011u | (dst << 1); // s_mul_i32 s14, s(17 + dst * 2), s32
|
||||
*(p++) = 0x80110e0fu | (dst << 17); // s_add_u32 s(17 + dst * 2), s15, s14
|
||||
*(p++) = 0x92102010u | (dst << 1) | (dst << 17);// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s32
|
||||
*(p++) = S_MUL_I32_IMUL | 0x102010u | (dst << 1) | (dst << 17);// s_mul_i32 s(16 + dst * 2), s(16 + dst * 2), s32
|
||||
}
|
||||
|
||||
// 36 bytes
|
||||
@@ -526,23 +611,23 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
if (src != dst) // p = 7/8
|
||||
{
|
||||
// s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2]
|
||||
*(p++) = 0x88901010u | (dst << 1) | (dst << 17) | (src << 9);
|
||||
*(p++) = S_XOR_B32_64 | 0x901010u | (dst << 1) | (dst << 17) | (src << 9);
|
||||
}
|
||||
else // p = 1/8
|
||||
{
|
||||
if (as_int(inst.y) < 0) // p = 1/2
|
||||
{
|
||||
// s_mov_b32 s62, imm32
|
||||
*(p++) = 0xbebe00ffu;
|
||||
*(p++) = S_MOV_B32_XOR_R;
|
||||
*(p++) = inst.y;
|
||||
|
||||
// s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[62:63]
|
||||
*(p++) = 0x88903e10u | (dst << 1) | (dst << 17);
|
||||
*(p++) = S_XOR_B32_64 | 0x903e10u | (dst << 1) | (dst << 17);
|
||||
}
|
||||
else
|
||||
{
|
||||
// s_xor_b32 s(16 + dst * 2), s(16 + dst * 2), imm32
|
||||
*(p++) = 0x8810ff10u | (dst << 1) | (dst << 17);
|
||||
*(p++) = S_XOR_B32_64 | 0x10ff10u | (dst << 1) | (dst << 17);
|
||||
*(p++) = inst.y;
|
||||
}
|
||||
}
|
||||
@@ -569,7 +654,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
p = jit_scratchpad_load2(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
|
||||
|
||||
// s_xor_b64 s[16 + dst * 2:17 + dst * 2], s[16 + dst * 2:17 + dst * 2], s[14:15]
|
||||
*(p++) = 0x88900e10u | (dst << 1) | (dst << 17);
|
||||
*(p++) = S_XOR_B32_64 | 0x900e10u | (dst << 1) | (dst << 17);
|
||||
}
|
||||
|
||||
// (12*7/8 + 8*1/8 + 28) + 4 = 43.5 bytes on average
|
||||
@@ -584,24 +669,24 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
if (opcode < RANDOMX_FREQ_IROR_R)
|
||||
{
|
||||
// s_lshr_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], s(16 + src * 2)
|
||||
*(p++) = 0x8fa01010u | (dst << 1) | (src << 9);
|
||||
*(p++) = S_LSHR | 0xa01010u | (dst << 1) | (src << 9);
|
||||
|
||||
// s_sub_u32 s15, 64, s(16 + src * 2)
|
||||
*(p++) = 0x808f10c0u | (src << 9);
|
||||
|
||||
// s_lshl_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], s15
|
||||
*(p++) = 0x8ea20f10u | (dst << 1);
|
||||
*(p++) = S_LSHL | 0xa20f10u | (dst << 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// s_lshl_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], s(16 + src * 2)
|
||||
*(p++) = 0x8ea01010u | (dst << 1) | (src << 9);
|
||||
*(p++) = S_LSHL | 0xa01010u | (dst << 1) | (src << 9);
|
||||
|
||||
// s_sub_u32 s15, 64, s(16 + src * 2)
|
||||
*(p++) = 0x808f10c0u | (src << 9);
|
||||
|
||||
// s_lshr_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], s15
|
||||
*(p++) = 0x8fa20f10u | (dst << 1);
|
||||
*(p++) = S_LSHR | 0xa20f10u | (dst << 1);
|
||||
}
|
||||
}
|
||||
else // p = 1/8
|
||||
@@ -609,14 +694,14 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
const uint shift = ((opcode < RANDOMX_FREQ_IROR_R) ? inst.y : -inst.y) & 63;
|
||||
|
||||
// s_lshr_b64 s[32:33], s[16 + dst * 2:17 + dst * 2], shift
|
||||
*(p++) = 0x8fa08010u | (dst << 1) | (shift << 8);
|
||||
*(p++) = S_LSHR | 0xa08010u | (dst << 1) | (shift << 8);
|
||||
|
||||
// s_lshl_b64 s[34:35], s[16 + dst * 2:17 + dst * 2], 64 - shift
|
||||
*(p++) = 0x8ea28010u | (dst << 1) | ((64 - shift) << 8);
|
||||
*(p++) = S_LSHL | 0xa28010u | (dst << 1) | ((64 - shift) << 8);
|
||||
}
|
||||
|
||||
// s_or_b64 s[16 + dst * 2:17 + dst * 2], s[32:33], s[34:35]
|
||||
*(p++) = 0x87902220u | (dst << 17);
|
||||
*(p++) = S_OR | 0x902220u | (dst << 17);
|
||||
|
||||
// 12*7/8 + 8/8 + 4 = 15.5 bytes on average
|
||||
return p;
|
||||
@@ -627,9 +712,15 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
{
|
||||
if (src != dst)
|
||||
{
|
||||
#if GCN_VERSION >= 15
|
||||
*(p++) = 0xbea00410u | (dst << 1); // s_mov_b64 s[32:33], s[16 + dst * 2:17 + dst * 2]
|
||||
*(p++) = 0xbe900410u | (src << 1) | (dst << 17);// s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2]
|
||||
*(p++) = 0xbe900420u | (src << 17); // s_mov_b64 s[16 + src * 2:17 + Src * 2], s[32:33]
|
||||
#else
|
||||
*(p++) = 0xbea00110u | (dst << 1); // s_mov_b64 s[32:33], s[16 + dst * 2:17 + dst * 2]
|
||||
*(p++) = 0xbe900110u | (src << 1) | (dst << 17);// s_mov_b64 s[16 + dst * 2:17 + dst * 2], s[16 + src * 2:17 + src * 2]
|
||||
*(p++) = 0xbe900120u | (src << 17); // s_mov_b64 s[16 + src * 2:17 + Src * 2], s[32:33]
|
||||
#endif
|
||||
}
|
||||
|
||||
// 12*7/8 = 10.5 bytes on average
|
||||
@@ -640,11 +731,11 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
if (opcode < RANDOMX_FREQ_FSWAP_R)
|
||||
{
|
||||
// ds_swizzle_b32 v(60 + dst * 2), v(60 + dst * 2) offset:0x8001
|
||||
*(p++) = 0xd87a8001u;
|
||||
*(p++) = DS_SWIZZLE_B32_FSWAP_R;
|
||||
*(p++) = 0x3c00003cu + (dst << 1) + (dst << 25);
|
||||
|
||||
// ds_swizzle_b32 v(61 + dst * 2), v(61 + dst * 2) offset:0x8001
|
||||
*(p++) = 0xd87a8001u;
|
||||
*(p++) = DS_SWIZZLE_B32_FSWAP_R;
|
||||
*(p++) = 0x3d00003du + (dst << 1) + (dst << 25);
|
||||
|
||||
// s_waitcnt lgkmcnt(0)
|
||||
@@ -658,7 +749,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
if (opcode < RANDOMX_FREQ_FADD_R)
|
||||
{
|
||||
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], v[52 + src * 2:53 + src * 2]
|
||||
*(p++) = 0xd280003cu + ((dst & 3) << 1);
|
||||
*(p++) = V_ADD_F64 + ((dst & 3) << 1);
|
||||
*(p++) = 0x0002693cu + ((dst & 3) << 1) + ((src & 3) << 10);
|
||||
|
||||
// 8 bytes
|
||||
@@ -679,7 +770,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
|
||||
|
||||
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], v[28:29]
|
||||
*(p++) = 0xd280003cu + ((dst & 3) << 1);
|
||||
*(p++) = V_ADD_F64 + ((dst & 3) << 1);
|
||||
*(p++) = 0x0002393cu + ((dst & 3) << 1);
|
||||
}
|
||||
|
||||
@@ -691,7 +782,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
if (opcode < RANDOMX_FREQ_FSUB_R)
|
||||
{
|
||||
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], -v[52 + src * 2:53 + src * 2]
|
||||
*(p++) = 0xd280003cu + ((dst & 3) << 1);
|
||||
*(p++) = V_ADD_F64 + ((dst & 3) << 1);
|
||||
*(p++) = 0x4002693cu + ((dst & 3) << 1) + ((src & 3) << 10);
|
||||
|
||||
// 8 bytes
|
||||
@@ -712,7 +803,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
|
||||
|
||||
// v_add_f64 v[60 + dst * 2:61 + dst * 2], v[60 + dst * 2:61 + dst * 2], -v[28:29]
|
||||
*(p++) = 0xd280003cu + ((dst & 3) << 1);
|
||||
*(p++) = V_ADD_F64 + ((dst & 3) << 1);
|
||||
*(p++) = 0x4002393cu + ((dst & 3) << 1);
|
||||
}
|
||||
|
||||
@@ -724,7 +815,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
if (opcode < RANDOMX_FREQ_FSCAL_R)
|
||||
{
|
||||
// v_xor_b32 v(61 + dst * 2), v(61 + dst * 2), v51
|
||||
*(p++) = 0x2a7a673du + ((dst & 3) << 1) + ((dst & 3) << 18);
|
||||
*(p++) = (V_XOR_B32 | 0x7a673du) + ((dst & 3) << 1) + ((dst & 3) << 18);
|
||||
|
||||
// 4 bytes
|
||||
return p;
|
||||
@@ -734,7 +825,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
if (opcode < RANDOMX_FREQ_FMUL_R)
|
||||
{
|
||||
// v_mul_f64 v[68 + dst * 2:69 + dst * 2], v[68 + dst * 2:69 + dst * 2], v[52 + src * 2:53 + src * 2]
|
||||
*(p++) = 0xd2810044u + ((dst & 3) << 1);
|
||||
*(p++) = V_MUL_F64 + ((dst & 3) << 1);
|
||||
*(p++) = 0x00026944u + ((dst & 3) << 1) + ((src & 3) << 10);
|
||||
|
||||
// 8 bytes
|
||||
@@ -755,7 +846,11 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
p = jit_scratchpad_load2_fp(p, prefetch_vgpr_index ? -prefetch_vgpr_index : 28, prefetch_vgpr_index ? vmcnt : 0);
|
||||
|
||||
// s_swappc_b64 s[60:61], s[48 + dst * 2:49 + dst * 2]
|
||||
#if GCN_VERSION >= 15
|
||||
*(p++) = 0xbebc2130u + ((dst & 3) << 1);
|
||||
#else
|
||||
*(p++) = 0xbebc1e30u + ((dst & 3) << 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
// 32 + 4 = 36 bytes
|
||||
@@ -766,7 +861,11 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
if (opcode < RANDOMX_FREQ_FSQRT_R)
|
||||
{
|
||||
// s_swappc_b64 s[60:61], s[40 + dst * 2:41 + dst * 2]
|
||||
#if GCN_VERSION >= 15
|
||||
*(p++) = 0xbebc2128u + ((dst & 3) << 1);
|
||||
#else
|
||||
*(p++) = 0xbebc1e28u + ((dst & 3) << 1);
|
||||
#endif
|
||||
|
||||
// 4 bytes
|
||||
return p;
|
||||
@@ -789,7 +888,7 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
const uint conditionMaskReg = 70 + (mod >> 4);
|
||||
|
||||
// s_and_b32 s14, s(16 + dst * 2), conditionMaskReg
|
||||
*(p++) = 0x860e0010u | (dst << 1) | (conditionMaskReg << 8);
|
||||
*(p++) = S_AND | 0x0e0010u | (dst << 1) | (conditionMaskReg << 8);
|
||||
|
||||
// s_cbranch_scc0 target
|
||||
const int delta = ((last_branch_target - p) - 1);
|
||||
@@ -805,26 +904,30 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
const uint shift = inst.y & 63;
|
||||
if (shift == 63)
|
||||
{
|
||||
*(p++) = 0x8e0e8110u | (src << 1); // s_lshl_b32 s14, s(16 + src * 2), 1
|
||||
*(p++) = 0x8f0f9f11u | (src << 1); // s_lshr_b32 s15, s(17 + src * 2), 31
|
||||
*(p++) = 0x870e0f0eu; // s_or_b32 s14, s14, s15
|
||||
*(p++) = 0x860e830eu; // s_and_b32 s14, s14, 3
|
||||
*(p++) = S_LSHL | 0x0e8110u | (src << 1); // s_lshl_b32 s14, s(16 + src * 2), 1
|
||||
*(p++) = S_LSHR | 0x0f9f11u | (src << 1); // s_lshr_b32 s15, s(17 + src * 2), 31
|
||||
*(p++) = S_OR | 0x0e0f0eu; // s_or_b32 s14, s14, s15
|
||||
*(p++) = S_AND | 0x0e830eu; // s_and_b32 s14, s14, 3
|
||||
}
|
||||
else
|
||||
{
|
||||
// s_bfe_u64 s[14:15], s[16:17], (shift,width=2)
|
||||
*(p++) = 0x938eff10u | (src << 1);
|
||||
*(p++) = S_BFE | 0x8eff10u | (src << 1);
|
||||
*(p++) = shift | (2 << 16);
|
||||
}
|
||||
|
||||
// s_brev_b32 s14, s14
|
||||
*(p++) = 0xbe8e080eu;
|
||||
|
||||
// s_lshr_b32 s66, s14, 30
|
||||
*(p++) = 0x8f429e0eu;
|
||||
|
||||
// s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
#if GCN_VERSION >= 15
|
||||
*(p++) = 0xbe8e0b0eu;
|
||||
*(p++) = 0x90429e0eu;
|
||||
*(p++) = 0xb9c20881u;
|
||||
#else
|
||||
*(p++) = 0xbe8e080eu;
|
||||
*(p++) = 0x8f429e0eu;
|
||||
*(p++) = 0xb9420881u;
|
||||
#endif
|
||||
|
||||
// 20 bytes
|
||||
return p;
|
||||
@@ -843,6 +946,10 @@ __global uint* jit_emit_instruction(__global uint* p, __global uint* last_branch
|
||||
// v28 = offset
|
||||
|
||||
#if GCN_VERSION >= 14
|
||||
#if GCN_VERSION >= 15
|
||||
// s_waitcnt vmcnt(0)
|
||||
*(p++) = 0xbf8c3f70u;
|
||||
#endif
|
||||
// global_store_dwordx2 v28, v[vgpr_id:vgpr_id + 1], s[0:1]
|
||||
*(p++) = 0xdc748000u;
|
||||
*(p++) = 0x0000001cu | (vgpr_id << 8);
|
||||
@@ -903,7 +1010,7 @@ __global uint* generate_jit_code(__global uint2* e, __global uint2* p0, __global
|
||||
int prefetch_data_count;
|
||||
|
||||
#pragma unroll 1
|
||||
for (int pass = 0; pass < 2; ++pass)
|
||||
for (volatile int pass = 0; pass < 2; ++pass)
|
||||
{
|
||||
#if RANDOMX_PROGRAM_SIZE > 256
|
||||
int registerLastChanged[8] = { -1, -1, -1, -1, -1, -1, -1, -1 };
|
||||
@@ -1419,14 +1526,14 @@ __global uint* generate_jit_code(__global uint2* e, __global uint2* p0, __global
|
||||
{
|
||||
// Code size limit exceeded!!!
|
||||
// Jump back to randomx_run kernel
|
||||
*(p++) = 0xbe801d0cu; // s_setpc_b64 s[12:13]
|
||||
*(p++) = S_SETPC_B64_S12_13; // s_setpc_b64 s[12:13]
|
||||
return p;
|
||||
}
|
||||
} while (!done);
|
||||
}
|
||||
|
||||
// Jump back to randomx_run kernel
|
||||
*(p++) = 0xbe801d0cu; // s_setpc_b64 s[12:13]
|
||||
*(p++) = S_SETPC_B64_S12_13; // s_setpc_b64 s[12:13]
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
742
src/backend/opencl/cl/rx/randomx_run_gfx1010.asm
Normal file
742
src/backend/opencl/cl/rx/randomx_run_gfx1010.asm
Normal file
@@ -0,0 +1,742 @@
|
||||
/*
|
||||
Copyright (c) 2019-2020 SChernykh
|
||||
|
||||
This file is part of RandomX OpenCL.
|
||||
|
||||
RandomX OpenCL is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
RandomX OpenCL is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with RandomX OpenCL. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
.rocm
|
||||
.gpu GFX1010
|
||||
.arch_minor 1
|
||||
.arch_stepping 0
|
||||
.eflags 53
|
||||
.llvm10binfmt
|
||||
.metadatav3
|
||||
.md_version 1, 0
|
||||
.globaldata
|
||||
.fill 64, 1, 0
|
||||
.kernel randomx_run
|
||||
.config
|
||||
.dims x
|
||||
.sgprsnum 96
|
||||
.vgprsnum 128
|
||||
.shared_vgprs 0
|
||||
.dx10clamp
|
||||
.ieeemode
|
||||
.floatmode 0xf0
|
||||
.priority 0
|
||||
.exceptions 0
|
||||
.userdatanum 6
|
||||
|
||||
# https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc1-gfx6-gfx10-table
|
||||
# https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc2-gfx6-gfx10-table
|
||||
# https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc3-gfx10-table
|
||||
.pgmrsrc1 0x40af0105
|
||||
.pgmrsrc2 0x0000008c
|
||||
.pgmrsrc3 0x00000000
|
||||
|
||||
.group_segment_fixed_size 256
|
||||
.private_segment_fixed_size 0
|
||||
.kernel_code_entry_offset 0x10c0
|
||||
.use_private_segment_buffer
|
||||
.use_kernarg_segment_ptr
|
||||
.use_wave32
|
||||
.config
|
||||
.md_symname "randomx_run.kd"
|
||||
.md_language "OpenCL C", 1, 2
|
||||
.reqd_work_group_size 32, 1, 1
|
||||
.md_kernarg_segment_size 104
|
||||
.md_kernarg_segment_align 8
|
||||
.md_group_segment_fixed_size 256
|
||||
.md_private_segment_fixed_size 0
|
||||
.md_wavefront_size 32
|
||||
.md_sgprsnum 96
|
||||
.md_vgprsnum 128
|
||||
.spilledsgprs 0
|
||||
.spilledvgprs 0
|
||||
.max_flat_work_group_size 32
|
||||
.arg dataset, "uchar*", 8, 0, globalbuf, u8, global, default const
|
||||
.arg scratchpad, "uchar*", 8, 8, globalbuf, u8, global, default
|
||||
.arg registers, "ulong*", 8, 16, globalbuf, u64, global, default
|
||||
.arg rounding_modes, "uint*", 8, 24, globalbuf, u32, global, default
|
||||
.arg programs, "uint*", 8, 32, globalbuf, u32, global, default
|
||||
.arg batch_size, "uint", 4, 40, value, u32
|
||||
.arg rx_parameters, "uint", 4, 44, value, u32
|
||||
.arg , "", 8, 48, gox, i64
|
||||
.arg , "", 8, 56, goy, i64
|
||||
.arg , "", 8, 64, goz, i64
|
||||
.arg , "", 8, 72, none, i8
|
||||
.arg , "", 8, 80, none, i8
|
||||
.arg , "", 8, 88, none, i8
|
||||
.arg , "", 8, 96, multigridsyncarg, i8
|
||||
.text
|
||||
randomx_run:
|
||||
# clear all caches
|
||||
s_dcache_wb
|
||||
s_waitcnt vmcnt(0) & lgkmcnt(0)
|
||||
s_waitcnt_vscnt null, 0x0
|
||||
s_icache_inv
|
||||
s_branch begin
|
||||
|
||||
# pgmrsrc2 = 0x0000008c, bits 1:5 = 6, so first 6 SGPRs (s0-s7) contain user data
|
||||
# s6 contains group id
|
||||
# v0 contains local id
|
||||
begin:
|
||||
# s[0:1] - pointer to registers
|
||||
# s[2:3] - pointer to rounding modes
|
||||
s_load_dwordx4 s[0:3], s[4:5], 0x10
|
||||
|
||||
# s[8:9] - group_id*group_size
|
||||
s_mov_b32 s9, 0
|
||||
s_lshl_b32 s8, s6, 5
|
||||
|
||||
# v0 - local id (sub)
|
||||
# v39 - R[sub]
|
||||
v_lshlrev_b32 v39, 3, v0
|
||||
|
||||
s_mov_b32 s12, s7
|
||||
|
||||
# vcc_lo = "if (sub < 8)"
|
||||
v_cmp_gt_u32 vcc_lo, 8, v0
|
||||
|
||||
s_waitcnt lgkmcnt(0)
|
||||
|
||||
# load rounding mode
|
||||
s_lshl_b32 s16, s6, 2
|
||||
s_add_u32 s64, s2, s16
|
||||
s_addc_u32 s65, s3, 0
|
||||
v_mov_b32 v1, 0
|
||||
global_load_dword v1, v1, s[64:65]
|
||||
s_waitcnt vmcnt(0)
|
||||
v_readlane_b32 s66, v1, 0
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
s_mov_b32 s67, 0
|
||||
|
||||
# ((__local ulong*) R)[sub] = ((__global ulong*) registers)[sub];
|
||||
s_lshl_b64 s[2:3], s[8:9], 3
|
||||
s_mov_b32 s32, s12
|
||||
s_add_u32 s0, s0, s2
|
||||
s_addc_u32 s1, s1, s3
|
||||
v_add_co_u32 v1, s0, s0, v39
|
||||
v_add_co_ci_u32 v2, s0, s1, 0, s0
|
||||
global_load_dwordx2 v[4:5], v[1:2], off
|
||||
s_waitcnt vmcnt(0)
|
||||
ds_write_b64 v39, v[4:5]
|
||||
s_waitcnt vmcnt(0) & lgkmcnt(0)
|
||||
s_waitcnt_vscnt null, 0x0
|
||||
|
||||
# "if (sub >= 8) return"
|
||||
s_and_saveexec_b32 s0, vcc_lo
|
||||
s_cbranch_execz program_end
|
||||
|
||||
# s[8:9] - pointer to dataset
|
||||
# s[10:11] - pointer to scratchpads
|
||||
# s[0:1] - pointer to programs
|
||||
s_load_dwordx4 s[8:11], s[4:5], 0x0
|
||||
s_load_dwordx2 s[0:1], s[4:5], 0x20
|
||||
|
||||
# rx_parameters
|
||||
s_load_dword s20, s[4:5], 0x2c
|
||||
|
||||
v_mov_b32 v5, 0
|
||||
v_mov_b32 v10, 0
|
||||
s_waitcnt_vscnt null, 0x0
|
||||
ds_read_b64 v[8:9], v39
|
||||
v_cmp_gt_u32 vcc_lo, 4, v0
|
||||
v_lshlrev_b32 v0, 3, v0
|
||||
ds_read2_b64 v[25:28], v5 offset0:16 offset1:17
|
||||
ds_read_b32 v11, v5 offset:152
|
||||
ds_read_b64 v[35:36], v5 offset:168
|
||||
ds_read2_b64 v[20:23], v5 offset0:18 offset1:20
|
||||
v_cndmask_b32 v4, 0xffffff, -1, vcc_lo
|
||||
v_add_nc_u32 v5, v39, v0
|
||||
s_waitcnt lgkmcnt(0)
|
||||
v_mov_b32 v13, s11
|
||||
v_mov_b32 v7, s1
|
||||
v_mov_b32 v6, s0
|
||||
|
||||
# Scratchpad L1 size
|
||||
s_bfe_u32 s21, s20, 0x050000
|
||||
s_lshl_b32 s21, 1, s21
|
||||
|
||||
# Scratchpad L2 size
|
||||
s_bfe_u32 s22, s20, 0x050005
|
||||
s_lshl_b32 s22, 1, s22
|
||||
|
||||
# Scratchpad L3 size
|
||||
s_bfe_u32 s0, s20, 0x05000A
|
||||
s_lshl_b32 s23, 1, s0
|
||||
|
||||
# program iterations
|
||||
s_bfe_u32 s24, s20, 0x04000F
|
||||
s_lshl_b32 s24, 1, s24
|
||||
|
||||
v_mov_b32 v12, s10
|
||||
v_mad_u64_u32 v[6:7], s2, 10048, s6, v[6:7]
|
||||
|
||||
# s[4:5] - pointer to current program
|
||||
v_readlane_b32 s4, v6, 0
|
||||
v_readlane_b32 s5, v7, 0
|
||||
|
||||
s_lshl_b32 s2, 1, s0
|
||||
v_add_co_u32 v14, s0, s8, v11
|
||||
v_cndmask_b32 v34, v36, 0, vcc_lo
|
||||
v_cndmask_b32 v24, v23, 0, vcc_lo
|
||||
v_cndmask_b32 v3, v22, 0, vcc_lo
|
||||
s_add_i32 s3, s2, 64
|
||||
v_add_co_ci_u32 v29, s0, s9, v10, s0
|
||||
v_cndmask_b32 v35, v35, 0, vcc_lo
|
||||
v_add_co_u32 v22, vcc_lo, v14, v0
|
||||
|
||||
# v[12:13] - pointer to current scratchpad
|
||||
v_mad_u64_u32 v[12:13], s2, s3, s6, v[12:13]
|
||||
v_mov_b32 v10, v26
|
||||
v_mov_b32 v11, v25
|
||||
v_lshlrev_b32 v36, 3, v27
|
||||
v_lshlrev_b32 v37, 3, v28
|
||||
v_lshlrev_b32 v20, 3, v20
|
||||
v_lshlrev_b32 v21, 3, v21
|
||||
v_add_co_ci_u32 v23, vcc_lo, 0, v29, vcc_lo
|
||||
|
||||
# rename registers
|
||||
# v6 - R[sub]
|
||||
v_mov_b32 v6, v39
|
||||
|
||||
# loop counter
|
||||
s_sub_u32 s2, s24, 1
|
||||
|
||||
# used in IXOR_R instruction
|
||||
s_mov_b32 s63, -1
|
||||
|
||||
# used in CBRANCH instruction
|
||||
s_mov_b32 s70, (0xFF << 8)
|
||||
s_mov_b32 s71, (0xFF << 9)
|
||||
s_mov_b32 s72, (0xFF << 10)
|
||||
s_mov_b32 s73, (0xFF << 11)
|
||||
s_mov_b32 s74, (0xFF << 12)
|
||||
s_mov_b32 s75, (0xFF << 13)
|
||||
s_mov_b32 s76, (0xFF << 14)
|
||||
s_mov_b32 s77, (0xFF << 15)
|
||||
s_mov_b32 s78, (0xFF << 16)
|
||||
s_mov_b32 s79, (0xFF << 17)
|
||||
s_mov_b32 s80, (0xFF << 18)
|
||||
s_mov_b32 s81, (0xFF << 19)
|
||||
s_mov_b32 s82, (0xFF << 20)
|
||||
s_mov_b32 s83, (0xFF << 21)
|
||||
s_mov_b32 s84, (0xFF << 22)
|
||||
s_mov_b32 s85, (0xFF << 23)
|
||||
|
||||
# ScratchpadL3Mask64
|
||||
s_sub_u32 s86, s23, 64
|
||||
|
||||
# Scratchpad masks for scratchpads
|
||||
v_sub_nc_u32 v38, s21, 8
|
||||
v_sub_nc_u32 v39, s22, 8
|
||||
v_sub_nc_u32 v50, s23, 8
|
||||
|
||||
# mask for FSCAL_R
|
||||
v_mov_b32 v51, 0x80F00000
|
||||
|
||||
# load scratchpad base address
|
||||
v_readlane_b32 s0, v12, 0
|
||||
v_readlane_b32 s1, v13, 0
|
||||
|
||||
# v41, v44 = 0
|
||||
v_mov_b32 v41, 0
|
||||
v_mov_b32 v44, 0
|
||||
|
||||
# v41 = 0 on lane 0, set it to 8 on lane 1
|
||||
# v44 = 0 on lane 0, set it to 4 on lane 1
|
||||
s_mov_b64 exec, 2
|
||||
v_mov_b32 v41, 8
|
||||
v_mov_b32 v44, 4
|
||||
|
||||
# load group A registers
|
||||
# Read low 8 bytes into lane 0 and high 8 bytes into lane 1
|
||||
s_mov_b64 exec, 3
|
||||
ds_read2_b64 v[52:55], v41 offset0:24 offset1:26
|
||||
ds_read2_b64 v[56:59], v41 offset0:28 offset1:30
|
||||
|
||||
# xmantissaMask
|
||||
v_mov_b32 v77, (1 << 24) - 1
|
||||
|
||||
# xexponentMask
|
||||
ds_read_b64 v[78:79], v41 offset:160
|
||||
|
||||
# Restore execution mask
|
||||
s_mov_b64 exec, 255
|
||||
|
||||
# sign mask (used in FSQRT_R)
|
||||
v_mov_b32 v82, 0x80000000
|
||||
|
||||
# used in FSQRT_R to check for "positive normal value" (v_cmpx_class_f64)
|
||||
s_mov_b32 s68, 256
|
||||
s_mov_b32 s69, 0
|
||||
|
||||
# High 32 bits of "1.0" constant (used in FDIV_M)
|
||||
v_mov_b32 v83, (1023 << 20)
|
||||
|
||||
# Used to multiply FP64 values by 0.5
|
||||
v_mov_b32 v84, (1 << 20)
|
||||
|
||||
s_getpc_b64 s[14:15]
|
||||
cur_addr:
|
||||
|
||||
# get addresses of FSQRT_R subroutines
|
||||
s_add_u32 s40, s14, fsqrt_r_sub0 - cur_addr
|
||||
s_addc_u32 s41, s15, 0
|
||||
s_add_u32 s42, s14, fsqrt_r_sub1 - cur_addr
|
||||
s_addc_u32 s43, s15, 0
|
||||
s_add_u32 s44, s14, fsqrt_r_sub2 - cur_addr
|
||||
s_addc_u32 s45, s15, 0
|
||||
s_add_u32 s46, s14, fsqrt_r_sub3 - cur_addr
|
||||
s_addc_u32 s47, s15, 0
|
||||
|
||||
# get addresses of FDIV_M subroutines
|
||||
s_add_u32 s48, s14, fdiv_m_sub0 - cur_addr
|
||||
s_addc_u32 s49, s15, 0
|
||||
s_add_u32 s50, s14, fdiv_m_sub1 - cur_addr
|
||||
s_addc_u32 s51, s15, 0
|
||||
s_add_u32 s52, s14, fdiv_m_sub2 - cur_addr
|
||||
s_addc_u32 s53, s15, 0
|
||||
s_add_u32 s54, s14, fdiv_m_sub3 - cur_addr
|
||||
s_addc_u32 s55, s15, 0
|
||||
|
||||
# get address for ISMULH_R subroutine
|
||||
s_add_u32 s56, s14, ismulh_r_sub - cur_addr
|
||||
s_addc_u32 s57, s15, 0
|
||||
|
||||
# get address for IMULH_R subroutine
|
||||
s_add_u32 s58, s14, imulh_r_sub - cur_addr
|
||||
s_addc_u32 s59, s15, 0
|
||||
|
||||
/*
|
||||
used: v0-v6, v8-v37
|
||||
not used: v7
|
||||
*/
|
||||
main_loop:
|
||||
s_waitcnt_vscnt null, 0x0
|
||||
|
||||
# v[27:28] = R[readReg0]
|
||||
# v[29:30] = R[readReg1]
|
||||
ds_read_b64 v[27:28], v37
|
||||
ds_read_b64 v[29:30], v36
|
||||
s_waitcnt lgkmcnt(0)
|
||||
|
||||
# R[readReg0] ^ R[readReg0] (high 32 bits)
|
||||
v_xor_b32 v28, v28, v30
|
||||
|
||||
# spAddr1
|
||||
v_xor_b32 v25, v28, v25
|
||||
v_and_b32 v25, s86, v25
|
||||
v_add_nc_u32 v25, v25, v0
|
||||
|
||||
v_add_co_u32 v16, vcc_lo, s0, v25
|
||||
|
||||
# R[readReg0] ^ R[readReg0] (low 32 bits)
|
||||
v_xor_b32 v25, v27, v29
|
||||
|
||||
v_mov_b32 v29, v11
|
||||
v_add_co_ci_u32 v17, vcc_lo, 0, s1, vcc_lo
|
||||
v_xor_b32 v25, v25, v26
|
||||
|
||||
# load from spAddr1
|
||||
global_load_dwordx2 v[27:28], v[16:17], off
|
||||
|
||||
# spAddr0
|
||||
v_and_b32 v25, s86, v25
|
||||
v_add_nc_u32 v25, v25, v0
|
||||
|
||||
v_add_co_u32 v31, vcc_lo, s0, v25
|
||||
v_add_co_ci_u32 v32, vcc_lo, 0, s1, vcc_lo
|
||||
v_add_co_u32 v29, vcc_lo, v22, v29
|
||||
|
||||
# load from spAddr0
|
||||
global_load_dwordx2 v[25:26], v[31:32], off
|
||||
|
||||
v_add_co_ci_u32 v30, vcc_lo, 0, v23, vcc_lo
|
||||
v_mov_b32 v33, v11
|
||||
s_and_b32 vcc_lo, exec_lo, vcc_lo
|
||||
s_waitcnt vmcnt(1)
|
||||
v_cvt_f64_i32 v[14:15], v28
|
||||
v_cvt_f64_i32 v[12:13], v27
|
||||
v_or_b32 v14, v14, v35
|
||||
s_waitcnt vmcnt(0)
|
||||
|
||||
# R[sub] ^= *p0;
|
||||
v_xor_b32 v8, v25, v8
|
||||
v_xor_b32 v9, v26, v9
|
||||
|
||||
v_and_b32 v26, v4, v15
|
||||
|
||||
v_and_b32 v19, v4, v13
|
||||
v_or_b32 v15, v26, v34
|
||||
v_or_b32 v18, v12, v3
|
||||
v_mov_b32 v26, 0
|
||||
v_or_b32 v19, v19, v24
|
||||
v_mov_b32 v25, v26
|
||||
ds_write2_b64 v5, v[18:19], v[14:15] offset0:8 offset1:9
|
||||
|
||||
# load from dataset
|
||||
global_load_dwordx2 v[18:19], v[29:30], off
|
||||
|
||||
# load group F,E registers
|
||||
# Read low 8 bytes into lane 0 and high 8 bytes into lane 1
|
||||
s_mov_b64 exec, 3
|
||||
s_waitcnt lgkmcnt(0)
|
||||
ds_read2_b64 v[60:63], v41 offset0:8 offset1:10
|
||||
ds_read2_b64 v[64:67], v41 offset0:12 offset1:14
|
||||
ds_read2_b64 v[68:71], v41 offset0:16 offset1:18
|
||||
ds_read2_b64 v[72:75], v41 offset0:20 offset1:22
|
||||
|
||||
# load VM integer registers
|
||||
v_readlane_b32 s16, v8, 0
|
||||
v_readlane_b32 s17, v9, 0
|
||||
v_readlane_b32 s18, v8, 1
|
||||
v_readlane_b32 s19, v9, 1
|
||||
v_readlane_b32 s20, v8, 2
|
||||
v_readlane_b32 s21, v9, 2
|
||||
v_readlane_b32 s22, v8, 3
|
||||
v_readlane_b32 s23, v9, 3
|
||||
v_readlane_b32 s24, v8, 4
|
||||
v_readlane_b32 s25, v9, 4
|
||||
v_readlane_b32 s26, v8, 5
|
||||
v_readlane_b32 s27, v9, 5
|
||||
v_readlane_b32 s28, v8, 6
|
||||
v_readlane_b32 s29, v9, 6
|
||||
v_readlane_b32 s30, v8, 7
|
||||
v_readlane_b32 s31, v9, 7
|
||||
|
||||
s_waitcnt lgkmcnt(0)
|
||||
|
||||
# Use only first 2 lanes for the program
|
||||
s_mov_b64 exec, 3
|
||||
|
||||
# call JIT code
|
||||
s_swappc_b64 s[12:13], s[4:5]
|
||||
|
||||
# Write out group F,E registers
|
||||
# Write low 8 bytes from lane 0 and high 8 bytes from lane 1
|
||||
ds_write2_b64 v41, v[60:61], v[62:63] offset0:8 offset1:10
|
||||
ds_write2_b64 v41, v[64:65], v[66:67] offset0:12 offset1:14
|
||||
ds_write2_b64 v41, v[68:69], v[70:71] offset0:16 offset1:18
|
||||
ds_write2_b64 v41, v[72:73], v[74:75] offset0:20 offset1:22
|
||||
|
||||
# store VM integer registers
|
||||
v_writelane_b32 v8, s16, 0
|
||||
v_writelane_b32 v9, s17, 0
|
||||
v_writelane_b32 v8, s18, 1
|
||||
v_writelane_b32 v9, s19, 1
|
||||
v_writelane_b32 v8, s20, 2
|
||||
v_writelane_b32 v9, s21, 2
|
||||
v_writelane_b32 v8, s22, 3
|
||||
v_writelane_b32 v9, s23, 3
|
||||
v_writelane_b32 v8, s24, 4
|
||||
v_writelane_b32 v9, s25, 4
|
||||
v_writelane_b32 v8, s26, 5
|
||||
v_writelane_b32 v9, s27, 5
|
||||
v_writelane_b32 v8, s28, 6
|
||||
v_writelane_b32 v9, s29, 6
|
||||
v_writelane_b32 v8, s30, 7
|
||||
v_writelane_b32 v9, s31, 7
|
||||
|
||||
# Turn back on 8 execution lanes
|
||||
s_mov_b64 exec, 255
|
||||
|
||||
# Write out VM integer registers
|
||||
ds_write_b64 v6, v[8:9]
|
||||
s_waitcnt lgkmcnt(0)
|
||||
|
||||
# R[readReg2], R[readReg3]
|
||||
ds_read_b32 v11, v21
|
||||
ds_read_b32 v27, v20
|
||||
s_waitcnt lgkmcnt(0)
|
||||
|
||||
# mx ^= R[readReg2] ^ R[readReg3];
|
||||
v_xor_b32 v11, v11, v27
|
||||
v_xor_b32 v10, v10, v11
|
||||
|
||||
# v[27:28] = R[sub]
|
||||
# v[29:30] = F[sub]
|
||||
ds_read2_b64 v[27:30], v6 offset1:8
|
||||
|
||||
# mx &= CacheLineAlignMask;
|
||||
v_and_b32 v11, 0x7fffffc0, v10
|
||||
v_mov_b32 v10, v33
|
||||
s_waitcnt lgkmcnt(0)
|
||||
|
||||
# const ulong next_r = R[sub] ^ data;
|
||||
s_waitcnt lgkmcnt(0)
|
||||
v_xor_b32 v8, v27, v18
|
||||
v_xor_b32 v9, v28, v19
|
||||
|
||||
# *p1 = next_r;
|
||||
global_store_dwordx2 v[16:17], v[8:9], off
|
||||
|
||||
# v[27:28] = E[sub]
|
||||
ds_read_b64 v[27:28], v6 offset:128
|
||||
|
||||
# R[sub] = next_r;
|
||||
ds_write_b64 v6, v[8:9]
|
||||
s_waitcnt lgkmcnt(1)
|
||||
|
||||
# *p0 = as_ulong(F[sub]) ^ as_ulong(E[sub]);
|
||||
v_xor_b32 v29, v27, v29
|
||||
v_xor_b32 v30, v28, v30
|
||||
global_store_dwordx2 v[31:32], v[29:30], off
|
||||
|
||||
s_sub_u32 s2, s2, 1
|
||||
s_cbranch_scc0 main_loop
|
||||
main_loop_end:
|
||||
|
||||
global_store_dwordx2 v[1:2], v[8:9], off
|
||||
global_store_dwordx2 v[1:2], v[29:30], off inst_offset:64
|
||||
global_store_dwordx2 v[1:2], v[27:28], off inst_offset:128
|
||||
|
||||
# store rounding mode
|
||||
v_mov_b32 v0, 0
|
||||
v_mov_b32 v1, s66
|
||||
global_store_dword v0, v1, s[64:65]
|
||||
|
||||
program_end:
|
||||
s_endpgm
|
||||
|
||||
fsqrt_r_sub0:
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s67
|
||||
v_rsq_f64 v[28:29], v[68:69]
|
||||
|
||||
# Improve initial approximation (can be skipped)
|
||||
#v_mul_f64 v[42:43], v[28:29], v[68:69]
|
||||
#v_mul_f64 v[48:49], v[28:29], -0.5
|
||||
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
|
||||
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
|
||||
|
||||
v_mul_f64 v[42:43], v[28:29], v[68:69]
|
||||
v_mov_b32 v48, v28
|
||||
v_sub_nc_u32 v49, v29, v84
|
||||
v_mov_b32 v46, v28
|
||||
v_xor_b32 v47, v49, v82
|
||||
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
|
||||
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
|
||||
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
|
||||
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[68:69]
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
|
||||
v_cmpx_class_f64 v[68:69], s[68:69]
|
||||
v_mov_b32 v68, v42
|
||||
v_mov_b32 v69, v43
|
||||
s_mov_b64 exec, 3
|
||||
s_setpc_b64 s[60:61]
|
||||
|
||||
fsqrt_r_sub1:
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s67
|
||||
v_rsq_f64 v[28:29], v[70:71]
|
||||
|
||||
# Improve initial approximation (can be skipped)
|
||||
#v_mul_f64 v[42:43], v[28:29], v[70:71]
|
||||
#v_mul_f64 v[48:49], v[28:29], -0.5
|
||||
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
|
||||
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
|
||||
|
||||
v_mul_f64 v[42:43], v[28:29], v[70:71]
|
||||
v_mov_b32 v48, v28
|
||||
v_sub_nc_u32 v49, v29, v84
|
||||
v_mov_b32 v46, v28
|
||||
v_xor_b32 v47, v49, v82
|
||||
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
|
||||
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
|
||||
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
|
||||
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[70:71]
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
|
||||
v_cmpx_class_f64 v[70:71], s[68:69]
|
||||
v_mov_b32 v70, v42
|
||||
v_mov_b32 v71, v43
|
||||
s_mov_b64 exec, 3
|
||||
s_setpc_b64 s[60:61]
|
||||
|
||||
fsqrt_r_sub2:
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s67
|
||||
v_rsq_f64 v[28:29], v[72:73]
|
||||
|
||||
# Improve initial approximation (can be skipped)
|
||||
#v_mul_f64 v[42:43], v[28:29], v[72:73]
|
||||
#v_mul_f64 v[48:49], v[28:29], -0.5
|
||||
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
|
||||
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
|
||||
|
||||
v_mul_f64 v[42:43], v[28:29], v[72:73]
|
||||
v_mov_b32 v48, v28
|
||||
v_sub_nc_u32 v49, v29, v84
|
||||
v_mov_b32 v46, v28
|
||||
v_xor_b32 v47, v49, v82
|
||||
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
|
||||
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
|
||||
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
|
||||
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[72:73]
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
|
||||
v_cmpx_class_f64 v[72:73], s[68:69]
|
||||
v_mov_b32 v72, v42
|
||||
v_mov_b32 v73, v43
|
||||
s_mov_b64 exec, 3
|
||||
s_setpc_b64 s[60:61]
|
||||
|
||||
fsqrt_r_sub3:
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s67
|
||||
v_rsq_f64 v[28:29], v[74:75]
|
||||
|
||||
# Improve initial approximation (can be skipped)
|
||||
#v_mul_f64 v[42:43], v[28:29], v[74:75]
|
||||
#v_mul_f64 v[48:49], v[28:29], -0.5
|
||||
#v_fma_f64 v[48:49], v[48:49], v[42:43], 0.5
|
||||
#v_fma_f64 v[28:29], v[28:29], v[48:49], v[28:29]
|
||||
|
||||
v_mul_f64 v[42:43], v[28:29], v[74:75]
|
||||
v_mov_b32 v48, v28
|
||||
v_sub_nc_u32 v49, v29, v84
|
||||
v_mov_b32 v46, v28
|
||||
v_xor_b32 v47, v49, v82
|
||||
v_fma_f64 v[46:47], v[46:47], v[42:43], 0.5
|
||||
v_fma_f64 v[42:43], v[42:43], v[46:47], v[42:43]
|
||||
v_fma_f64 v[48:49], v[48:49], v[46:47], v[48:49]
|
||||
v_fma_f64 v[46:47], -v[42:43], v[42:43], v[74:75]
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
v_fma_f64 v[42:43], v[46:47], v[48:49], v[42:43]
|
||||
v_cmpx_class_f64 v[74:75], s[68:69]
|
||||
v_mov_b32 v74, v42
|
||||
v_mov_b32 v75, v43
|
||||
s_mov_b64 exec, 3
|
||||
s_setpc_b64 s[60:61]
|
||||
|
||||
fdiv_m_sub0:
|
||||
v_or_b32 v28, v28, v78
|
||||
v_and_or_b32 v29, v29, v77, v79
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s67
|
||||
v_rcp_f64 v[48:49], v[28:29]
|
||||
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
|
||||
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
|
||||
v_mul_f64 v[80:81], v[68:69], v[48:49]
|
||||
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[68:69]
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
|
||||
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[68:69]
|
||||
v_cmpx_eq_f64 v[68:69], v[28:29]
|
||||
v_mov_b32 v80, 0
|
||||
v_mov_b32 v81, v83
|
||||
s_mov_b64 exec, 3
|
||||
v_mov_b32 v68, v80
|
||||
v_mov_b32 v69, v81
|
||||
s_setpc_b64 s[60:61]
|
||||
|
||||
fdiv_m_sub1:
|
||||
v_or_b32 v28, v28, v78
|
||||
v_and_or_b32 v29, v29, v77, v79
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s67
|
||||
v_rcp_f64 v[48:49], v[28:29]
|
||||
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
|
||||
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
|
||||
v_mul_f64 v[80:81], v[70:71], v[48:49]
|
||||
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[70:71]
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
|
||||
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[70:71]
|
||||
v_cmpx_eq_f64 v[70:71], v[28:29]
|
||||
v_mov_b32 v80, 0
|
||||
v_mov_b32 v81, v83
|
||||
s_mov_b64 exec, 3
|
||||
v_mov_b32 v70, v80
|
||||
v_mov_b32 v71, v81
|
||||
s_setpc_b64 s[60:61]
|
||||
|
||||
fdiv_m_sub2:
|
||||
v_or_b32 v28, v28, v78
|
||||
v_and_or_b32 v29, v29, v77, v79
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s67
|
||||
v_rcp_f64 v[48:49], v[28:29]
|
||||
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
|
||||
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
|
||||
v_mul_f64 v[80:81], v[72:73], v[48:49]
|
||||
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[72:73]
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
|
||||
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[72:73]
|
||||
v_cmpx_eq_f64 v[72:73], v[28:29]
|
||||
v_mov_b32 v80, 0
|
||||
v_mov_b32 v81, v83
|
||||
s_mov_b64 exec, 3
|
||||
v_mov_b32 v72, v80
|
||||
v_mov_b32 v73, v81
|
||||
s_setpc_b64 s[60:61]
|
||||
|
||||
fdiv_m_sub3:
|
||||
v_or_b32 v28, v28, v78
|
||||
v_and_or_b32 v29, v29, v77, v79
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s67
|
||||
v_rcp_f64 v[48:49], v[28:29]
|
||||
v_fma_f64 v[80:81], -v[28:29], v[48:49], 1.0
|
||||
v_fma_f64 v[48:49], v[48:49], v[80:81], v[48:49]
|
||||
v_mul_f64 v[80:81], v[74:75], v[48:49]
|
||||
v_fma_f64 v[42:43], -v[28:29], v[80:81], v[74:75]
|
||||
s_setreg_b32 hwreg(mode, 2, 2), s66
|
||||
v_fma_f64 v[42:43], v[42:43], v[48:49], v[80:81]
|
||||
v_div_fixup_f64 v[80:81], v[42:43], v[28:29], v[74:75]
|
||||
v_cmpx_eq_f64 v[74:75], v[28:29]
|
||||
v_mov_b32 v80, 0
|
||||
v_mov_b32 v81, v83
|
||||
s_mov_b64 exec, 3
|
||||
v_mov_b32 v74, v80
|
||||
v_mov_b32 v75, v81
|
||||
s_setpc_b64 s[60:61]
|
||||
|
||||
ismulh_r_sub:
|
||||
s_mov_b64 exec, 1
|
||||
v_mov_b32 v45, s14
|
||||
v_mul_hi_u32 v40, s38, v45
|
||||
v_mov_b32 v47, s15
|
||||
v_mad_u64_u32 v[42:43], s32, s38, v47, v[40:41]
|
||||
v_mov_b32 v40, v42
|
||||
v_mad_u64_u32 v[45:46], s32, s39, v45, v[40:41]
|
||||
v_mad_u64_u32 v[42:43], s32, s39, v47, v[43:44]
|
||||
v_add_co_u32 v42, vcc_lo, v42, v46
|
||||
v_add_co_ci_u32 v43, vcc_lo, 0, v43, vcc_lo
|
||||
v_readlane_b32 s32, v42, 0
|
||||
v_readlane_b32 s33, v43, 0
|
||||
s_cmp_lt_i32 s15, 0
|
||||
s_cselect_b64 s[34:35], s[38:39], 0
|
||||
s_sub_u32 s32, s32, s34
|
||||
s_subb_u32 s33, s33, s35
|
||||
s_cmp_lt_i32 s39, 0
|
||||
s_cselect_b64 s[34:35], s[14:15], 0
|
||||
s_sub_u32 s14, s32, s34
|
||||
s_subb_u32 s15, s33, s35
|
||||
s_mov_b64 exec, 3
|
||||
s_setpc_b64 s[60:61]
|
||||
|
||||
imulh_r_sub:
|
||||
s_mov_b64 exec, 1
|
||||
v_mov_b32 v45, s38
|
||||
v_mul_hi_u32 v40, s14, v45
|
||||
v_mov_b32 v47, s39
|
||||
v_mad_u64_u32 v[42:43], s32, s14, v47, v[40:41]
|
||||
v_mov_b32 v40, v42
|
||||
v_mad_u64_u32 v[45:46], s32, s15, v45, v[40:41]
|
||||
v_mad_u64_u32 v[42:43], s32, s15, v47, v[43:44]
|
||||
v_add_co_u32 v42, vcc_lo, v42, v46
|
||||
v_add_co_ci_u32 v43, vcc_lo, 0, v43, vcc_lo
|
||||
v_readlane_b32 s14, v42, 0
|
||||
v_readlane_b32 s15, v43, 0
|
||||
s_mov_b64 exec, 3
|
||||
s_setpc_b64 s[60:61]
|
||||
303
src/backend/opencl/cl/rx/randomx_run_gfx1010.h
Normal file
303
src/backend/opencl/cl/rx/randomx_run_gfx1010.h
Normal file
@@ -0,0 +1,303 @@
|
||||
/*
|
||||
This file was auto-generated from randomx_run_gfx1010.asm:
|
||||
|
||||
clrxasm randomx_run_gfx1010.asm -o randomx_run_gfx1010.bin
|
||||
bin2h -c randomx_run_gfx1010_bin < randomx_run_gfx1010.bin > randomx_run_gfx1010.h
|
||||
|
||||
clrxasm can be downloaded here: https://github.com/CLRX/CLRX-mirror/releases
|
||||
bin2h can be downloaded here: http://www.deadnode.org/sw/bin2h/
|
||||
*/
|
||||
|
||||
static unsigned char randomx_run_gfx1010_bin[]={
|
||||
0x7f,0x45,0x4c,0x46,0x02,0x01,0x01,0x40,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0xe0,0x00,0x01,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x40
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x35,0x00,0x00,0x00,0x40,0x00,0x38,0x00,0x08,0x00,0x40,0x00,0x0c,0x00,0x0a,0x00,0x06
|
||||
,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0
|
||||
,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x02
|
||||
,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x52,0xe5,0x74,0x64,0x04,0x00,0x00,0x00,0x00
|
||||
,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x51,0xe5,0x74,0x64,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x34,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07
|
||||
,0x00,0x00,0x00,0x20,0x06,0x00,0x00,0x20,0x00,0x00,0x00,0x41,0x4d,0x44,0x47,0x50,0x55,0x00,0x00,0x82,0xae,0x61,0x6d,0x64,0x68,0x73,0x61,0x2e,0x6b,0x65,0x72,0x6e
|
||||
,0x65,0x6c,0x73,0x91,0xde,0x00,0x10,0xa5,0x2e,0x61,0x72,0x67,0x73,0x9e,0x88,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67
|
||||
,0x6c,0x6f,0x62,0x61,0x6c,0xa9,0x2e,0x69,0x73,0x5f,0x63,0x6f,0x6e,0x73,0x74,0xc3,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xa7,0x64,0x61,0x74,0x61,0x73,0x65,0x74,0xa7,0x2e
|
||||
,0x6f,0x66,0x66,0x73,0x65,0x74,0x00,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa6,0x75,0x63,0x68,0x61,0x72,0x2a
|
||||
,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75
|
||||
,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x75,0x38,0x87,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67,0x6c,0x6f,0x62,0x61,0x6c
|
||||
,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xaa,0x73,0x63,0x72,0x61,0x74,0x63,0x68,0x70,0x61,0x64,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x08,0xa5,0x2e,0x73,0x69,0x7a,0x65
|
||||
,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa6,0x75,0x63,0x68,0x61,0x72,0x2a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad
|
||||
,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x75,0x38,0x87,0xae,0x2e,0x61
|
||||
,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67,0x6c,0x6f,0x62,0x61,0x6c,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xa9,0x72,0x65,0x67,0x69,0x73,0x74
|
||||
,0x65,0x72,0x73,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x10,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa6,0x75
|
||||
,0x6c,0x6f,0x6e,0x67,0x2a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab
|
||||
,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x75,0x36,0x34,0x87,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6
|
||||
,0x67,0x6c,0x6f,0x62,0x61,0x6c,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xae,0x72,0x6f,0x75,0x6e,0x64,0x69,0x6e,0x67,0x5f,0x6d,0x6f,0x64,0x65,0x73,0xa7,0x2e,0x6f,0x66,0x66
|
||||
,0x73,0x65,0x74,0x18,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa5,0x75,0x69,0x6e,0x74,0x2a,0xab,0x2e,0x76,0x61
|
||||
,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79
|
||||
,0x70,0x65,0xa3,0x75,0x33,0x32,0x87,0xae,0x2e,0x61,0x64,0x64,0x72,0x65,0x73,0x73,0x5f,0x73,0x70,0x61,0x63,0x65,0xa6,0x67,0x6c,0x6f,0x62,0x61,0x6c,0xa5,0x2e,0x6e
|
||||
,0x61,0x6d,0x65,0xa8,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x73,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x20,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xaa,0x2e,0x74,0x79
|
||||
,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa5,0x75,0x69,0x6e,0x74,0x2a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xad,0x67,0x6c,0x6f,0x62,0x61,0x6c
|
||||
,0x5f,0x62,0x75,0x66,0x66,0x65,0x72,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x75,0x33,0x32,0x86,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xaa,0x62
|
||||
,0x61,0x74,0x63,0x68,0x5f,0x73,0x69,0x7a,0x65,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x04,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f
|
||||
,0x6e,0x61,0x6d,0x65,0xa4,0x75,0x69,0x6e,0x74,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xa8,0x62,0x79,0x5f,0x76,0x61,0x6c,0x75,0x65,0xab,0x2e
|
||||
,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x75,0x33,0x32,0x86,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xad,0x72,0x78,0x5f,0x70,0x61,0x72,0x61,0x6d,0x65,0x74
|
||||
,0x65,0x72,0x73,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x2c,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x04,0xaa,0x2e,0x74,0x79,0x70,0x65,0x5f,0x6e,0x61,0x6d,0x65,0xa4,0x75
|
||||
,0x69,0x6e,0x74,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xa8,0x62,0x79,0x5f,0x76,0x61,0x6c,0x75,0x65,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f
|
||||
,0x74,0x79,0x70,0x65,0xa3,0x75,0x33,0x32,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x30,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65
|
||||
,0x5f,0x6b,0x69,0x6e,0x64,0xb6,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x78,0xab,0x2e,0x76,0x61
|
||||
,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x69,0x36,0x34,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x38,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76
|
||||
,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xb6,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x6f,0x66,0x66,0x73,0x65,0x74,0x5f,0x79
|
||||
,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x69,0x36,0x34,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x40,0xa5,0x2e,0x73,0x69,0x7a,0x65
|
||||
,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xb6,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x67,0x6c,0x6f,0x62,0x61,0x6c,0x5f,0x6f,0x66,0x66,0x73
|
||||
,0x65,0x74,0x5f,0x7a,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa3,0x69,0x36,0x34,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x48,0xa5,0x2e
|
||||
,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xab,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x6e,0x6f,0x6e,0x65,0xab,0x2e,0x76
|
||||
,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x69,0x38,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x50,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76
|
||||
,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xab,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x6e,0x6f,0x6e,0x65,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70
|
||||
,0x65,0xa2,0x69,0x38,0x84,0xa7,0x2e,0x6f,0x66,0x66,0x73,0x65,0x74,0x58,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e
|
||||
,0x64,0xab,0x68,0x69,0x64,0x64,0x65,0x6e,0x5f,0x6e,0x6f,0x6e,0x65,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2,0x69,0x38,0x84,0xa7,0x2e,0x6f
|
||||
,0x66,0x66,0x73,0x65,0x74,0x60,0xa5,0x2e,0x73,0x69,0x7a,0x65,0x08,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6b,0x69,0x6e,0x64,0xb9,0x68,0x69,0x64,0x64,0x65,0x6e
|
||||
,0x5f,0x6d,0x75,0x6c,0x74,0x69,0x67,0x72,0x69,0x64,0x5f,0x73,0x79,0x6e,0x63,0x5f,0x61,0x72,0x67,0xab,0x2e,0x76,0x61,0x6c,0x75,0x65,0x5f,0x74,0x79,0x70,0x65,0xa2
|
||||
,0x69,0x38,0xb9,0x2e,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x66,0x69,0x78,0x65,0x64,0x5f,0x73,0x69,0x7a,0x65,0xcd,0x01,0x00,0xb6
|
||||
,0x2e,0x6b,0x65,0x72,0x6e,0x61,0x72,0x67,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x61,0x6c,0x69,0x67,0x6e,0x08,0xb5,0x2e,0x6b,0x65,0x72,0x6e,0x61,0x72,0x67
|
||||
,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65,0x68,0xa9,0x2e,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0xa8,0x4f,0x70,0x65,0x6e,0x43,0x4c,0x20
|
||||
,0x43,0xb1,0x2e,0x6c,0x61,0x6e,0x67,0x75,0x61,0x67,0x65,0x5f,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x92,0x01,0x02,0xb8,0x2e,0x6d,0x61,0x78,0x5f,0x66,0x6c,0x61,0x74
|
||||
,0x5f,0x77,0x6f,0x72,0x6b,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x20,0xa5,0x2e,0x6e,0x61,0x6d,0x65,0xab,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72
|
||||
,0x75,0x6e,0xbb,0x2e,0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x5f,0x73,0x65,0x67,0x6d,0x65,0x6e,0x74,0x5f,0x66,0x69,0x78,0x65,0x64,0x5f,0x73,0x69,0x7a,0x65,0x00,0xb4
|
||||
,0x2e,0x72,0x65,0x71,0x64,0x5f,0x77,0x6f,0x72,0x6b,0x67,0x72,0x6f,0x75,0x70,0x5f,0x73,0x69,0x7a,0x65,0x93,0x20,0x01,0x01,0xab,0x2e,0x73,0x67,0x70,0x72,0x5f,0x63
|
||||
,0x6f,0x75,0x6e,0x74,0x60,0xb1,0x2e,0x73,0x67,0x70,0x72,0x5f,0x73,0x70,0x69,0x6c,0x6c,0x5f,0x63,0x6f,0x75,0x6e,0x74,0x00,0xa7,0x2e,0x73,0x79,0x6d,0x62,0x6f,0x6c
|
||||
,0xae,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x2e,0x6b,0x64,0xab,0x2e,0x76,0x67,0x70,0x72,0x5f,0x63,0x6f,0x75,0x6e,0x74,0xcc,0x80,0xb1,0x2e,0x76
|
||||
,0x67,0x70,0x72,0x5f,0x73,0x70,0x69,0x6c,0x6c,0x5f,0x63,0x6f,0x75,0x6e,0x74,0x00,0xaf,0x2e,0x77,0x61,0x76,0x65,0x66,0x72,0x6f,0x6e,0x74,0x5f,0x73,0x69,0x7a,0x65
|
||||
,0x20,0xae,0x61,0x6d,0x64,0x68,0x73,0x61,0x2e,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x92,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x12,0x03,0x06,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x00,0x00,0x00,0x11,0x03,0x05,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01
|
||||
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f
|
||||
,0x72,0x75,0x6e,0x00,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x2e,0x6b,0x64,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xcf,0x03,0xaf,0x40,0x8c,0x00,0x00,0x00,0x09,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x84,0xf4,0x00,0x00,0x00,0x00,0x70,0x00,0x8c,0xbf,0x00,0x00,0xfd,0xbb,0x00,0x00,0x93,0xbf,0x00,0x00,0x82,0xbf,0x02,0x00,0x08,0xf4,0x10,0x00,0x00,0xfa,0x80
|
||||
,0x03,0x89,0xbe,0x06,0x85,0x08,0x8f,0x83,0x00,0x4e,0x34,0x07,0x03,0x8c,0xbe,0x88,0x00,0x88,0x7d,0x7f,0xc0,0x8c,0xbf,0x06,0x82,0x10,0x8f,0x02,0x10,0x40,0x80,0x03
|
||||
,0x80,0x41,0x82,0x80,0x02,0x02,0x7e,0x00,0x80,0x30,0xdc,0x01,0x00,0x40,0x01,0x70,0x3f,0x8c,0xbf,0x42,0x00,0x60,0xd7,0x01,0x01,0x01,0x00,0x81,0x08,0xc2,0xb9,0x80
|
||||
,0x03,0xc3,0xbe,0x08,0x83,0x82,0x8f,0x0c,0x03,0xa0,0xbe,0x00,0x02,0x00,0x80,0x01,0x03,0x01,0x82,0x01,0x00,0x0f,0xd7,0x00,0x4e,0x02,0x00,0x02,0x00,0x28,0xd5,0x01
|
||||
,0x00,0x01,0x00,0x00,0x80,0x34,0xdc,0x01,0x00,0x7d,0x04,0x70,0x3f,0x8c,0xbf,0x00,0x00,0x34,0xd9,0x27,0x04,0x00,0x00,0x70,0x00,0x8c,0xbf,0x00,0x00,0xfd,0xbb,0x6a
|
||||
,0x3c,0x80,0xbe,0x65,0x01,0x88,0xbf,0x02,0x02,0x08,0xf4,0x00,0x00,0x00,0xfa,0x02,0x00,0x04,0xf4,0x20,0x00,0x00,0xfa,0x02,0x05,0x00,0xf4,0x2c,0x00,0x00,0xfa,0x80
|
||||
,0x02,0x0a,0x7e,0x80,0x02,0x14,0x7e,0x00,0x00,0xfd,0xbb,0x00,0x00,0xd8,0xd9,0x27,0x00,0x00,0x08,0x84,0x00,0x88,0x7d,0x83,0x00,0x00,0x34,0x10,0x11,0xdc,0xd9,0x05
|
||||
,0x00,0x00,0x19,0x98,0x00,0xd8,0xd8,0x05,0x00,0x00,0x0b,0xa8,0x00,0xd8,0xd9,0x05,0x00,0x00,0x23,0x12,0x14,0xdc,0xd9,0x05,0x00,0x00,0x14,0x04,0x00,0x01,0xd5,0xff
|
||||
,0x82,0xa9,0x01,0xff,0xff,0xff,0x00,0x27,0x01,0x0a,0x4a,0x7f,0xc0,0x8c,0xbf,0x0b,0x02,0x1a,0x7e,0x01,0x02,0x0e,0x7e,0x00,0x02,0x0c,0x7e,0x14,0xff,0x95,0x93,0x00
|
||||
,0x00,0x05,0x00,0x81,0x15,0x15,0x8f,0x14,0xff,0x96,0x93,0x05,0x00,0x05,0x00,0x81,0x16,0x16,0x8f,0x14,0xff,0x80,0x93,0x0a,0x00,0x05,0x00,0x81,0x00,0x17,0x8f,0x14
|
||||
,0xff,0x98,0x93,0x0f,0x00,0x04,0x00,0x81,0x18,0x18,0x8f,0x0a,0x02,0x18,0x7e,0x06,0x02,0x76,0xd5,0xff,0x0c,0x18,0x04,0x40,0x27,0x00,0x00,0x04,0x00,0x60,0xd7,0x06
|
||||
,0x01,0x01,0x00,0x05,0x00,0x60,0xd7,0x07,0x01,0x01,0x00,0x81,0x00,0x02,0x8f,0x0e,0x00,0x0f,0xd7,0x08,0x16,0x02,0x00,0x22,0x00,0x01,0xd5,0x24,0x01,0xa9,0x01,0x18
|
||||
,0x00,0x01,0xd5,0x17,0x01,0xa9,0x01,0x03,0x00,0x01,0xd5,0x16,0x01,0xa9,0x01,0x02,0xc0,0x03,0x81,0x1d,0x00,0x28,0xd5,0x09,0x14,0x02,0x00,0x23,0x00,0x01,0xd5,0x23
|
||||
,0x01,0xa9,0x01,0x16,0x6a,0x0f,0xd7,0x0e,0x01,0x02,0x00,0x0c,0x02,0x76,0xd5,0x03,0x0c,0x30,0x04,0x1a,0x03,0x14,0x7e,0x19,0x03,0x16,0x7e,0x83,0x36,0x48,0x34,0x83
|
||||
,0x38,0x4a,0x34,0x83,0x28,0x28,0x34,0x83,0x2a,0x2a,0x34,0x80,0x3a,0x2e,0x50,0x27,0x03,0x0c,0x7e,0x18,0x81,0x82,0x80,0xc1,0x03,0xbf,0xbe,0xff,0x03,0xc6,0xbe,0x00
|
||||
,0xff,0x00,0x00,0xff,0x03,0xc7,0xbe,0x00,0xfe,0x01,0x00,0xff,0x03,0xc8,0xbe,0x00,0xfc,0x03,0x00,0xff,0x03,0xc9,0xbe,0x00,0xf8,0x07,0x00,0xff,0x03,0xca,0xbe,0x00
|
||||
,0xf0,0x0f,0x00,0xff,0x03,0xcb,0xbe,0x00,0xe0,0x1f,0x00,0xff,0x03,0xcc,0xbe,0x00,0xc0,0x3f,0x00,0xff,0x03,0xcd,0xbe,0x00,0x80,0x7f,0x00,0xff,0x03,0xce,0xbe,0x00
|
||||
,0x00,0xff,0x00,0xff,0x03,0xcf,0xbe,0x00,0x00,0xfe,0x01,0xff,0x03,0xd0,0xbe,0x00,0x00,0xfc,0x03,0xff,0x03,0xd1,0xbe,0x00,0x00,0xf8,0x07,0xff,0x03,0xd2,0xbe,0x00
|
||||
,0x00,0xf0,0x0f,0xff,0x03,0xd3,0xbe,0x00,0x00,0xe0,0x1f,0xff,0x03,0xd4,0xbe,0x00,0x00,0xc0,0x3f,0xff,0x03,0xd5,0xbe,0x00,0x00,0x80,0x7f,0x17,0xc0,0xd6,0x80,0x26
|
||||
,0x00,0x26,0xd5,0x15,0x10,0x01,0x00,0x27,0x00,0x26,0xd5,0x16,0x10,0x01,0x00,0x32,0x00,0x26,0xd5,0x17,0x10,0x01,0x00,0xff,0x02,0x66,0x7e,0x00,0x00,0xf0,0x80,0x00
|
||||
,0x00,0x60,0xd7,0x0c,0x01,0x01,0x00,0x01,0x00,0x60,0xd7,0x0d,0x01,0x01,0x00,0x80,0x02,0x52,0x7e,0x80,0x02,0x58,0x7e,0x82,0x04,0xfe,0xbe,0x88,0x02,0x52,0x7e,0x84
|
||||
,0x02,0x58,0x7e,0x83,0x04,0xfe,0xbe,0x18,0x1a,0xdc,0xd9,0x29,0x00,0x00,0x34,0x1c,0x1e,0xdc,0xd9,0x29,0x00,0x00,0x38,0xff,0x02,0x9a,0x7e,0xff,0xff,0xff,0x00,0xa0
|
||||
,0x00,0xd8,0xd9,0x29,0x00,0x00,0x4e,0xff,0x04,0xfe,0xbe,0xff,0x00,0x00,0x00,0xff,0x02,0xa4,0x7e,0x00,0x00,0x00,0x80,0xff,0x03,0xc4,0xbe,0x00,0x01,0x00,0x00,0x80
|
||||
,0x03,0xc5,0xbe,0xff,0x02,0xa6,0x7e,0x00,0x00,0xf0,0x3f,0xff,0x02,0xa8,0x7e,0x00,0x00,0x10,0x00,0x00,0x1f,0x8e,0xbe,0x0e,0xff,0x28,0x80,0x48,0x03,0x00,0x00,0x0f
|
||||
,0x80,0x29,0x82,0x0e,0xff,0x2a,0x80,0xac,0x03,0x00,0x00,0x0f,0x80,0x2b,0x82,0x0e,0xff,0x2c,0x80,0x10,0x04,0x00,0x00,0x0f,0x80,0x2d,0x82,0x0e,0xff,0x2e,0x80,0x74
|
||||
,0x04,0x00,0x00,0x0f,0x80,0x2f,0x82,0x0e,0xff,0x30,0x80,0xd8,0x04,0x00,0x00,0x0f,0x80,0x31,0x82,0x0e,0xff,0x32,0x80,0x3c,0x05,0x00,0x00,0x0f,0x80,0x33,0x82,0x0e
|
||||
,0xff,0x34,0x80,0xa0,0x05,0x00,0x00,0x0f,0x80,0x35,0x82,0x0e,0xff,0x36,0x80,0x04,0x06,0x00,0x00,0x0f,0x80,0x37,0x82,0x0e,0xff,0x38,0x80,0x68,0x06,0x00,0x00,0x0f
|
||||
,0x80,0x39,0x82,0x0e,0xff,0x3a,0x80,0xdc,0x06,0x00,0x00,0x0f,0x80,0x3b,0x82,0x00,0x00,0xfd,0xbb,0x00,0x00,0xd8,0xd9,0x25,0x00,0x00,0x1b,0x00,0x00,0xd8,0xd9,0x24
|
||||
,0x00,0x00,0x1d,0x7f,0xc0,0x8c,0xbf,0x1c,0x3d,0x38,0x3a,0x1c,0x33,0x32,0x3a,0x56,0x32,0x32,0x36,0x19,0x01,0x32,0x4a,0x10,0x6a,0x0f,0xd7,0x00,0x32,0x02,0x00,0x1b
|
||||
,0x3b,0x32,0x3a,0x0b,0x03,0x3a,0x7e,0x11,0x6a,0x28,0xd5,0x80,0x02,0xa8,0x01,0x19,0x35,0x32,0x3a,0x00,0x80,0x34,0xdc,0x10,0x00,0x7d,0x1b,0x56,0x32,0x32,0x36,0x19
|
||||
,0x01,0x32,0x4a,0x1f,0x6a,0x0f,0xd7,0x00,0x32,0x02,0x00,0x20,0x6a,0x28,0xd5,0x80,0x02,0xa8,0x01,0x1d,0x6a,0x0f,0xd7,0x16,0x3b,0x02,0x00,0x00,0x80,0x34,0xdc,0x1f
|
||||
,0x00,0x7d,0x19,0x80,0x2e,0x3c,0x50,0x0b,0x03,0x42,0x7e,0x7e,0x6a,0x6a,0x87,0x71,0x3f,0x8c,0xbf,0x1c,0x09,0x1c,0x7e,0x1b,0x09,0x18,0x7e,0x0e,0x47,0x1c,0x38,0x70
|
||||
,0x3f,0x8c,0xbf,0x19,0x11,0x10,0x3a,0x1a,0x13,0x12,0x3a,0x04,0x1f,0x34,0x36,0x04,0x1b,0x26,0x36,0x1a,0x45,0x1e,0x38,0x0c,0x07,0x24,0x38,0x80,0x02,0x34,0x7e,0x13
|
||||
,0x31,0x26,0x38,0x1a,0x03,0x32,0x7e,0x08,0x09,0x38,0xd9,0x05,0x12,0x0e,0x00,0x00,0x80,0x34,0xdc,0x1d,0x00,0x7d,0x12,0x83,0x04,0xfe,0xbe,0x7f,0xc0,0x8c,0xbf,0x08
|
||||
,0x0a,0xdc,0xd9,0x29,0x00,0x00,0x3c,0x0c,0x0e,0xdc,0xd9,0x29,0x00,0x00,0x40,0x10,0x12,0xdc,0xd9,0x29,0x00,0x00,0x44,0x14,0x16,0xdc,0xd9,0x29,0x00,0x00,0x48,0x10
|
||||
,0x00,0x60,0xd7,0x08,0x01,0x01,0x00,0x11,0x00,0x60,0xd7,0x09,0x01,0x01,0x00,0x12,0x00,0x60,0xd7,0x08,0x03,0x01,0x00,0x13,0x00,0x60,0xd7,0x09,0x03,0x01,0x00,0x14
|
||||
,0x00,0x60,0xd7,0x08,0x05,0x01,0x00,0x15,0x00,0x60,0xd7,0x09,0x05,0x01,0x00,0x16,0x00,0x60,0xd7,0x08,0x07,0x01,0x00,0x17,0x00,0x60,0xd7,0x09,0x07,0x01,0x00,0x18
|
||||
,0x00,0x60,0xd7,0x08,0x09,0x01,0x00,0x19,0x00,0x60,0xd7,0x09,0x09,0x01,0x00,0x1a,0x00,0x60,0xd7,0x08,0x0b,0x01,0x00,0x1b,0x00,0x60,0xd7,0x09,0x0b,0x01,0x00,0x1c
|
||||
,0x00,0x60,0xd7,0x08,0x0d,0x01,0x00,0x1d,0x00,0x60,0xd7,0x09,0x0d,0x01,0x00,0x1e,0x00,0x60,0xd7,0x08,0x0f,0x01,0x00,0x1f,0x00,0x60,0xd7,0x09,0x0f,0x01,0x00,0x7f
|
||||
,0xc0,0x8c,0xbf,0x83,0x04,0xfe,0xbe,0x04,0x21,0x8c,0xbe,0x08,0x0a,0x38,0xd9,0x29,0x3c,0x3e,0x00,0x0c,0x0e,0x38,0xd9,0x29,0x40,0x42,0x00,0x10,0x12,0x38,0xd9,0x29
|
||||
,0x44,0x46,0x00,0x14,0x16,0x38,0xd9,0x29,0x48,0x4a,0x00,0x08,0x00,0x61,0xd7,0x10,0x00,0x01,0x00,0x09,0x00,0x61,0xd7,0x11,0x00,0x01,0x00,0x08,0x00,0x61,0xd7,0x12
|
||||
,0x02,0x01,0x00,0x09,0x00,0x61,0xd7,0x13,0x02,0x01,0x00,0x08,0x00,0x61,0xd7,0x14,0x04,0x01,0x00,0x09,0x00,0x61,0xd7,0x15,0x04,0x01,0x00,0x08,0x00,0x61,0xd7,0x16
|
||||
,0x06,0x01,0x00,0x09,0x00,0x61,0xd7,0x17,0x06,0x01,0x00,0x08,0x00,0x61,0xd7,0x18,0x08,0x01,0x00,0x09,0x00,0x61,0xd7,0x19,0x08,0x01,0x00,0x08,0x00,0x61,0xd7,0x1a
|
||||
,0x0a,0x01,0x00,0x09,0x00,0x61,0xd7,0x1b,0x0a,0x01,0x00,0x08,0x00,0x61,0xd7,0x1c,0x0c,0x01,0x00,0x09,0x00,0x61,0xd7,0x1d,0x0c,0x01,0x00,0x08,0x00,0x61,0xd7,0x1e
|
||||
,0x0e,0x01,0x00,0x09,0x00,0x61,0xd7,0x1f,0x0e,0x01,0x00,0xff,0x04,0xfe,0xbe,0xff,0x00,0x00,0x00,0x00,0x00,0x34,0xd9,0x06,0x08,0x00,0x00,0x7f,0xc0,0x8c,0xbf,0x00
|
||||
,0x00,0xd8,0xd8,0x15,0x00,0x00,0x0b,0x00,0x00,0xd8,0xd8,0x14,0x00,0x00,0x1b,0x7f,0xc0,0x8c,0xbf,0x0b,0x37,0x16,0x3a,0x0a,0x17,0x14,0x3a,0x00,0x08,0xdc,0xd9,0x06
|
||||
,0x00,0x00,0x1b,0xff,0x14,0x16,0x36,0xc0,0xff,0xff,0x7f,0x21,0x03,0x14,0x7e,0x7f,0xc0,0x8c,0xbf,0x7f,0xc0,0x8c,0xbf,0x1b,0x25,0x10,0x3a,0x1c,0x27,0x12,0x3a,0x00
|
||||
,0x80,0x74,0xdc,0x10,0x08,0x7d,0x00,0x80,0x00,0xd8,0xd9,0x06,0x00,0x00,0x1b,0x00,0x00,0x34,0xd9,0x06,0x08,0x00,0x00,0x7f,0xc1,0x8c,0xbf,0x1b,0x3b,0x3a,0x3a,0x1c
|
||||
,0x3d,0x3c,0x3a,0x00,0x80,0x74,0xdc,0x1f,0x1d,0x7d,0x00,0x02,0x81,0x82,0x80,0x57,0xff,0x84,0xbf,0x00,0x80,0x74,0xdc,0x01,0x08,0x7d,0x00,0x40,0x80,0x74,0xdc,0x01
|
||||
,0x1d,0x7d,0x00,0x80,0x80,0x74,0xdc,0x01,0x1b,0x7d,0x00,0x80,0x02,0x00,0x7e,0x42,0x02,0x02,0x7e,0x00,0x80,0x70,0xdc,0x00,0x01,0x40,0x00,0x00,0x00,0x81,0xbf,0x81
|
||||
,0x08,0xc3,0xb9,0x44,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x89,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d,0xa9,0x62,0x4c,0x1c,0x03,0x5c,0x7e,0x31,0xa5,0x5e,0x3a,0x2e
|
||||
,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30,0x5d,0xc2,0x04,0x2e,0x00,0x4c,0xd5,0x2a,0x55,0x12,0x25,0x81
|
||||
,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x44,0x89,0x00,0x00,0x2a,0x03,0x88,0x7e,0x2b,0x03,0x8a,0x7e,0x83,0x04,0xfe,0xbe,0x3c
|
||||
,0x20,0x80,0xbe,0x81,0x08,0xc3,0xb9,0x46,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x8d,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d,0xa9,0x62,0x4c,0x1c,0x03,0x5c,0x7e,0x31
|
||||
,0xa5,0x5e,0x3a,0x2e,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30,0x5d,0xc2,0x04,0x2e,0x00,0x4c,0xd5,0x2a
|
||||
,0x55,0x1a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x46,0x89,0x00,0x00,0x2a,0x03,0x8c,0x7e,0x2b,0x03,0x8e,0x7e,0x83
|
||||
,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x81,0x08,0xc3,0xb9,0x48,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x91,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d,0xa9,0x62,0x4c,0x1c
|
||||
,0x03,0x5c,0x7e,0x31,0xa5,0x5e,0x3a,0x2e,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30,0x5d,0xc2,0x04,0x2e
|
||||
,0x00,0x4c,0xd5,0x2a,0x55,0x22,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x48,0x89,0x00,0x00,0x2a,0x03,0x90,0x7e,0x2b
|
||||
,0x03,0x92,0x7e,0x83,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x81,0x08,0xc3,0xb9,0x4a,0x63,0x38,0x7e,0x2a,0x00,0x65,0xd5,0x1c,0x95,0x02,0x00,0x1c,0x03,0x60,0x7e,0x1d
|
||||
,0xa9,0x62,0x4c,0x1c,0x03,0x5c,0x7e,0x31,0xa5,0x5e,0x3a,0x2e,0x00,0x4c,0xd5,0x2e,0x55,0xc2,0x03,0x2a,0x00,0x4c,0xd5,0x2a,0x5d,0xaa,0x04,0x30,0x00,0x4c,0xd5,0x30
|
||||
,0x5d,0xc2,0x04,0x2e,0x00,0x4c,0xd5,0x2a,0x55,0x2a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2e,0x61,0xaa,0x04,0x00,0x00,0xb8,0xd4,0x4a,0x89,0x00,0x00,0x2a
|
||||
,0x03,0x94,0x7e,0x2b,0x03,0x96,0x7e,0x83,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d,0x00,0x71,0xd7,0x1d,0x9b,0x3e,0x05,0x81,0x08,0xc3,0xb9,0x1c
|
||||
,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50,0x00,0x65,0xd5,0x44,0x61,0x02,0x00,0x2a,0x00,0x4c,0xd5,0x1c
|
||||
,0xa1,0x12,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a,0x39,0x12,0x05,0x44,0x39,0x64,0x7c,0x80,0x02,0xa0,0x7e,0x53
|
||||
,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x88,0x7e,0x51,0x03,0x8a,0x7e,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d,0x00,0x71,0xd7,0x1d,0x9b,0x3e,0x05,0x81
|
||||
,0x08,0xc3,0xb9,0x1c,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50,0x00,0x65,0xd5,0x46,0x61,0x02,0x00,0x2a
|
||||
,0x00,0x4c,0xd5,0x1c,0xa1,0x1a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a,0x39,0x1a,0x05,0x46,0x39,0x64,0x7c,0x80
|
||||
,0x02,0xa0,0x7e,0x53,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x8c,0x7e,0x51,0x03,0x8e,0x7e,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d,0x00,0x71,0xd7,0x1d
|
||||
,0x9b,0x3e,0x05,0x81,0x08,0xc3,0xb9,0x1c,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50,0x00,0x65,0xd5,0x48
|
||||
,0x61,0x02,0x00,0x2a,0x00,0x4c,0xd5,0x1c,0xa1,0x22,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a,0x39,0x22,0x05,0x48
|
||||
,0x39,0x64,0x7c,0x80,0x02,0xa0,0x7e,0x53,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x90,0x7e,0x51,0x03,0x92,0x7e,0x3c,0x20,0x80,0xbe,0x1c,0x9d,0x38,0x38,0x1d
|
||||
,0x00,0x71,0xd7,0x1d,0x9b,0x3e,0x05,0x81,0x08,0xc3,0xb9,0x1c,0x5f,0x60,0x7e,0x50,0x00,0x4c,0xd5,0x1c,0x61,0xca,0x23,0x30,0x00,0x4c,0xd5,0x30,0xa1,0xc2,0x04,0x50
|
||||
,0x00,0x65,0xd5,0x4a,0x61,0x02,0x00,0x2a,0x00,0x4c,0xd5,0x1c,0xa1,0x2a,0x25,0x81,0x08,0xc2,0xb9,0x2a,0x00,0x4c,0xd5,0x2a,0x61,0x42,0x05,0x50,0x00,0x60,0xd5,0x2a
|
||||
,0x39,0x2a,0x05,0x4a,0x39,0x64,0x7c,0x80,0x02,0xa0,0x7e,0x53,0x03,0xa2,0x7e,0x83,0x04,0xfe,0xbe,0x50,0x03,0x94,0x7e,0x51,0x03,0x96,0x7e,0x3c,0x20,0x80,0xbe,0x81
|
||||
,0x04,0xfe,0xbe,0x0e,0x02,0x5a,0x7e,0x28,0x00,0x6a,0xd5,0x26,0x5a,0x02,0x00,0x0f,0x02,0x5e,0x7e,0x2a,0x20,0x76,0xd5,0x26,0x5e,0xa2,0x04,0x2a,0x03,0x50,0x7e,0x2d
|
||||
,0x20,0x76,0xd5,0x27,0x5a,0xa2,0x04,0x2a,0x20,0x76,0xd5,0x27,0x5e,0xae,0x04,0x2a,0x6a,0x0f,0xd7,0x2a,0x5d,0x02,0x00,0x80,0x56,0x56,0x50,0x20,0x00,0x60,0xd7,0x2a
|
||||
,0x01,0x01,0x00,0x21,0x00,0x60,0xd7,0x2b,0x01,0x01,0x00,0x0f,0x80,0x04,0xbf,0x26,0x80,0xa2,0x85,0x20,0x22,0xa0,0x80,0x21,0x23,0xa1,0x82,0x27,0x80,0x04,0xbf,0x0e
|
||||
,0x80,0xa2,0x85,0x20,0x22,0x8e,0x80,0x21,0x23,0x8f,0x82,0x83,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x81,0x04,0xfe,0xbe,0x26,0x02,0x5a,0x7e,0x28,0x00,0x6a,0xd5,0x0e
|
||||
,0x5a,0x02,0x00,0x27,0x02,0x5e,0x7e,0x2a,0x20,0x76,0xd5,0x0e,0x5e,0xa2,0x04,0x2a,0x03,0x50,0x7e,0x2d,0x20,0x76,0xd5,0x0f,0x5a,0xa2,0x04,0x2a,0x20,0x76,0xd5,0x0f
|
||||
,0x5e,0xae,0x04,0x2a,0x6a,0x0f,0xd7,0x2a,0x5d,0x02,0x00,0x80,0x56,0x56,0x50,0x0e,0x00,0x60,0xd7,0x2a,0x01,0x01,0x00,0x0f,0x00,0x60,0xd7,0x2b,0x01,0x01,0x00,0x83
|
||||
,0x04,0xfe,0xbe,0x3c,0x20,0x80,0xbe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x43
|
||||
,0x4c,0x52,0x58,0x20,0x52,0x4f,0x43,0x6d,0x42,0x69,0x6e,0x47,0x65,0x6e,0x65,0x72,0x61,0x74,0x6f,0x72,0x20,0x30,0x2e,0x31,0x2e,0x39,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x02,0x07,0x00,0x00
|
||||
,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x12,0x03,0x06,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x16,0x00,0x00,0x00,0x11,0x03,0x05,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x2e,0x6e,0x6f,0x74,0x65,0x00,0x2e,0x64,0x79,0x6e,0x73,0x79,0x6d,0x00,0x2e,0x68,0x61,0x73,0x68,0x00,0x2e,0x64,0x79,0x6e,0x73,0x74,0x72,0x00,0x2e,0x72,0x6f,0x64
|
||||
,0x61,0x74,0x61,0x00,0x2e,0x74,0x65,0x78,0x74,0x00,0x2e,0x64,0x79,0x6e,0x61,0x6d,0x69,0x63,0x00,0x2e,0x63,0x6f,0x6d,0x6d,0x65,0x6e,0x74,0x00,0x2e,0x73,0x79,0x6d
|
||||
,0x74,0x61,0x62,0x00,0x2e,0x73,0x68,0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x2e,0x73,0x74,0x72,0x74,0x61,0x62,0x00,0x00,0x5f,0x44,0x59,0x4e,0x41,0x4d,0x49,0x43,0x00
|
||||
,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x00,0x72,0x61,0x6e,0x64,0x6f,0x6d,0x78,0x5f,0x72,0x75,0x6e,0x2e,0x6b,0x64,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01
|
||||
,0x00,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x34
|
||||
,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07
|
||||
,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x48
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f
|
||||
,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x18
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15
|
||||
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x98,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x1c
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1d
|
||||
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x40
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x25
|
||||
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x28
|
||||
,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x2b
|
||||
,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x34
|
||||
,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x1b
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3d
|
||||
,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x60
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x45
|
||||
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x57
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x4f
|
||||
,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x37,0x21,0x00,0x00,0x00,0x00,0x00,0x00,0x25
|
||||
,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
|
||||
const int randomx_run_gfx1010_bin_size=9312;
|
||||
@@ -316,7 +316,7 @@ __kernel void init_vm(__global const void* entropy_data, __global void* vm_state
|
||||
uint64_t registerLatencyFP = 0;
|
||||
uint64_t registerReadCycleFP = 0;
|
||||
uint32_t ScratchpadHighLatency = 0;
|
||||
uint32_t ScratchpadLatency = 0;
|
||||
volatile uint32_t ScratchpadLatency = 0;
|
||||
|
||||
int32_t first_available_slot = 0;
|
||||
int32_t first_allowed_slot_cfround = 0;
|
||||
@@ -1425,15 +1425,18 @@ double fma_soft(double a, double b, double c, uint32_t rounding_mode)
|
||||
}
|
||||
|
||||
const uint64_t mantissa_size = 52;
|
||||
const uint64_t mantissa_mask = (1UL << mantissa_size) - 1;
|
||||
const uint64_t mantissa_high_bit = 1UL << mantissa_size;
|
||||
const uint64_t mantissa_mask = (1UL << 52) - 1;
|
||||
|
||||
const uint64_t exponent_size = 11;
|
||||
const uint64_t exponent_mask = (1 << exponent_size) - 1;
|
||||
|
||||
const uint32_t exponent_a = (as_uint2(a).y >> 20) & exponent_mask;
|
||||
const uint32_t exponent_b = (as_uint2(b).y >> 20) & exponent_mask;
|
||||
const uint32_t exponent_c = (as_uint2(c).y >> 20) & exponent_mask;
|
||||
uint2 a2 = as_uint2(a);
|
||||
uint2 b2 = as_uint2(b);
|
||||
uint2 c2 = as_uint2(c);
|
||||
|
||||
const uint32_t exponent_a = (a2.y >> 20) & exponent_mask;
|
||||
const uint32_t exponent_b = (b2.y >> 20) & exponent_mask;
|
||||
const uint32_t exponent_c = (c2.y >> 20) & exponent_mask;
|
||||
|
||||
if ((exponent_a == 2047) || (exponent_b == 2047) || (exponent_c == 2047))
|
||||
{
|
||||
@@ -1441,13 +1444,17 @@ double fma_soft(double a, double b, double c, uint32_t rounding_mode)
|
||||
return as_double(inf);
|
||||
}
|
||||
|
||||
const uint64_t mantissa_a = (as_ulong(a) & mantissa_mask) | mantissa_high_bit;
|
||||
const uint64_t mantissa_b = (as_ulong(b) & mantissa_mask) | mantissa_high_bit;
|
||||
const uint64_t mantissa_c = (as_ulong(c) & mantissa_mask) | mantissa_high_bit;
|
||||
const uint32_t sign_a = a2.y >> 31;
|
||||
const uint32_t sign_b = b2.y >> 31;
|
||||
const uint32_t sign_c = c2.y >> 31;
|
||||
|
||||
const uint32_t sign_a = as_uint2(a).y >> 31;
|
||||
const uint32_t sign_b = as_uint2(b).y >> 31;
|
||||
const uint32_t sign_c = as_uint2(c).y >> 31;
|
||||
a2.y = (a2.y & ((1U << 20) - 1)) | (1U << 20);
|
||||
b2.y = (b2.y & ((1U << 20) - 1)) | (1U << 20);
|
||||
c2.y = (c2.y & ((1U << 20) - 1)) | (1U << 20);
|
||||
|
||||
uint64_t mantissa_a = as_ulong(a2);
|
||||
uint64_t mantissa_b = as_ulong(b2);
|
||||
uint64_t mantissa_c = as_ulong(c2);
|
||||
|
||||
uint64_t mul_result[2];
|
||||
mul_result[0] = mantissa_a * mantissa_b;
|
||||
@@ -1585,7 +1592,7 @@ double fma_soft(double a, double b, double c, uint32_t rounding_mode)
|
||||
if (rounding_mode + sign_fma_result == 2)
|
||||
{
|
||||
fma_result[1] += round_up;
|
||||
if (fma_result[1] == mantissa_high_bit)
|
||||
if (fma_result[1] == (1UL << mantissa_size))
|
||||
{
|
||||
fma_result[1] = 0;
|
||||
++exponent_fma_result;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -49,6 +49,7 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
|
||||
const size_t mem = device.globalMemSize();
|
||||
auto config = RxAlgo::base(algorithm);
|
||||
bool gcnAsm = false;
|
||||
bool isNavi = false;
|
||||
|
||||
switch (device.type()) {
|
||||
case OclDevice::Baffin:
|
||||
@@ -59,6 +60,13 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
|
||||
gcnAsm = true;
|
||||
break;
|
||||
|
||||
case OclDevice::Navi_10:
|
||||
case OclDevice::Navi_12:
|
||||
case OclDevice::Navi_14:
|
||||
gcnAsm = true;
|
||||
isNavi = true;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -75,8 +83,9 @@ bool ocl_generic_rx_generator(const OclDevice &device, const Algorithm &algorith
|
||||
uint32_t intensity = static_cast<uint32_t>((mem - (datasetHost ? 0 : dataset_mem)) / per_thread_mem / 2);
|
||||
|
||||
// Too high intensity makes hashrate worse
|
||||
if (intensity > device.computeUnits() * 16) {
|
||||
intensity = device.computeUnits() * 16;
|
||||
const uint32_t intensityCoeff = isNavi ? 64 : 16;
|
||||
if (intensity > device.computeUnits() * intensityCoeff) {
|
||||
intensity = device.computeUnits() * intensityCoeff;
|
||||
}
|
||||
|
||||
intensity -= intensity % 64;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -30,12 +30,10 @@
|
||||
#include "crypto/rx/RxAlgo.h"
|
||||
|
||||
|
||||
void xmrig::RxRunKernel::enqueue(cl_command_queue queue, size_t threads)
|
||||
void xmrig::RxRunKernel::enqueue(cl_command_queue queue, size_t threads, size_t workgroup_size)
|
||||
{
|
||||
const size_t gthreads = threads * 64;
|
||||
static const size_t lthreads = 64;
|
||||
|
||||
enqueueNDRange(queue, 1, nullptr, >hreads, <hreads);
|
||||
const size_t gthreads = threads * workgroup_size;
|
||||
enqueueNDRange(queue, 1, nullptr, >hreads, &workgroup_size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -40,7 +40,7 @@ class RxRunKernel : public OclKernel
|
||||
public:
|
||||
inline RxRunKernel(cl_program program) : OclKernel(program, "randomx_run") {}
|
||||
|
||||
void enqueue(cl_command_queue queue, size_t threads);
|
||||
void enqueue(cl_command_queue queue, size_t threads, size_t workgroup_size);
|
||||
void setArgs(cl_mem dataset, cl_mem scratchpads, cl_mem registers, cl_mem rounding, cl_mem programs, uint32_t batch_size, const Algorithm &algorithm);
|
||||
};
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ if (WITH_OPENCL)
|
||||
src/backend/opencl/wrappers/OclLib.h
|
||||
src/backend/opencl/wrappers/OclPlatform.h
|
||||
src/backend/opencl/wrappers/OclVendor.h
|
||||
)
|
||||
)
|
||||
|
||||
set(SOURCES_BACKEND_OPENCL
|
||||
src/backend/opencl/cl/OclSource.cpp
|
||||
@@ -59,75 +59,93 @@ if (WITH_OPENCL)
|
||||
src/backend/opencl/wrappers/OclKernel.cpp
|
||||
src/backend/opencl/wrappers/OclLib.cpp
|
||||
src/backend/opencl/wrappers/OclPlatform.cpp
|
||||
)
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_win.cpp)
|
||||
else()
|
||||
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_unix.cpp)
|
||||
endif()
|
||||
if (WIN32)
|
||||
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_win.cpp)
|
||||
else()
|
||||
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/OclCache_unix.cpp)
|
||||
endif()
|
||||
|
||||
if (WITH_RANDOMX)
|
||||
list(APPEND HEADERS_BACKEND_OPENCL
|
||||
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h
|
||||
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.h
|
||||
src/backend/opencl/kernels/rx/ExecuteVmKernel.h
|
||||
src/backend/opencl/kernels/rx/FillAesKernel.h
|
||||
src/backend/opencl/kernels/rx/FindSharesKernel.h
|
||||
src/backend/opencl/kernels/rx/HashAesKernel.cpp
|
||||
src/backend/opencl/kernels/rx/InitVmKernel.h
|
||||
src/backend/opencl/kernels/rx/RxJitKernel.h
|
||||
src/backend/opencl/kernels/rx/RxRunKernel.h
|
||||
src/backend/opencl/runners/OclRxBaseRunner.h
|
||||
src/backend/opencl/runners/OclRxJitRunner.h
|
||||
src/backend/opencl/runners/OclRxVmRunner.h
|
||||
)
|
||||
if (WITH_RANDOMX)
|
||||
list(APPEND HEADERS_BACKEND_OPENCL
|
||||
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h
|
||||
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.h
|
||||
src/backend/opencl/kernels/rx/ExecuteVmKernel.h
|
||||
src/backend/opencl/kernels/rx/FillAesKernel.h
|
||||
src/backend/opencl/kernels/rx/FindSharesKernel.h
|
||||
src/backend/opencl/kernels/rx/HashAesKernel.cpp
|
||||
src/backend/opencl/kernels/rx/InitVmKernel.h
|
||||
src/backend/opencl/kernels/rx/RxJitKernel.h
|
||||
src/backend/opencl/kernels/rx/RxRunKernel.h
|
||||
src/backend/opencl/runners/OclRxBaseRunner.h
|
||||
src/backend/opencl/runners/OclRxJitRunner.h
|
||||
src/backend/opencl/runners/OclRxVmRunner.h
|
||||
)
|
||||
|
||||
list(APPEND SOURCES_BACKEND_OPENCL
|
||||
src/backend/opencl/generators/ocl_generic_rx_generator.cpp
|
||||
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.cpp
|
||||
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.cpp
|
||||
src/backend/opencl/kernels/rx/ExecuteVmKernel.cpp
|
||||
src/backend/opencl/kernels/rx/FillAesKernel.cpp
|
||||
src/backend/opencl/kernels/rx/FindSharesKernel.cpp
|
||||
src/backend/opencl/kernels/rx/HashAesKernel.cpp
|
||||
src/backend/opencl/kernels/rx/InitVmKernel.cpp
|
||||
src/backend/opencl/kernels/rx/RxJitKernel.cpp
|
||||
src/backend/opencl/kernels/rx/RxRunKernel.cpp
|
||||
src/backend/opencl/runners/OclRxBaseRunner.cpp
|
||||
src/backend/opencl/runners/OclRxJitRunner.cpp
|
||||
src/backend/opencl/runners/OclRxVmRunner.cpp
|
||||
)
|
||||
endif()
|
||||
list(APPEND SOURCES_BACKEND_OPENCL
|
||||
src/backend/opencl/generators/ocl_generic_rx_generator.cpp
|
||||
src/backend/opencl/kernels/rx/Blake2bHashRegistersKernel.cpp
|
||||
src/backend/opencl/kernels/rx/Blake2bInitialHashKernel.cpp
|
||||
src/backend/opencl/kernels/rx/ExecuteVmKernel.cpp
|
||||
src/backend/opencl/kernels/rx/FillAesKernel.cpp
|
||||
src/backend/opencl/kernels/rx/FindSharesKernel.cpp
|
||||
src/backend/opencl/kernels/rx/HashAesKernel.cpp
|
||||
src/backend/opencl/kernels/rx/InitVmKernel.cpp
|
||||
src/backend/opencl/kernels/rx/RxJitKernel.cpp
|
||||
src/backend/opencl/kernels/rx/RxRunKernel.cpp
|
||||
src/backend/opencl/runners/OclRxBaseRunner.cpp
|
||||
src/backend/opencl/runners/OclRxJitRunner.cpp
|
||||
src/backend/opencl/runners/OclRxVmRunner.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
list(APPEND HEADERS_BACKEND_OPENCL
|
||||
src/backend/opencl/kernels/Cn00RyoKernel.h
|
||||
src/backend/opencl/kernels/Cn1RyoKernel.h
|
||||
src/backend/opencl/kernels/Cn2RyoKernel.h
|
||||
src/backend/opencl/runners/OclRyoRunner.h
|
||||
)
|
||||
if (WITH_CN_GPU AND CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
list(APPEND HEADERS_BACKEND_OPENCL
|
||||
src/backend/opencl/kernels/Cn00RyoKernel.h
|
||||
src/backend/opencl/kernels/Cn1RyoKernel.h
|
||||
src/backend/opencl/kernels/Cn2RyoKernel.h
|
||||
src/backend/opencl/runners/OclRyoRunner.h
|
||||
)
|
||||
|
||||
list(APPEND SOURCES_BACKEND_OPENCL
|
||||
src/backend/opencl/generators/ocl_generic_cn_gpu_generator.cpp
|
||||
src/backend/opencl/kernels/Cn00RyoKernel.cpp
|
||||
src/backend/opencl/kernels/Cn1RyoKernel.cpp
|
||||
src/backend/opencl/kernels/Cn2RyoKernel.cpp
|
||||
src/backend/opencl/runners/OclRyoRunner.cpp
|
||||
)
|
||||
endif()
|
||||
list(APPEND SOURCES_BACKEND_OPENCL
|
||||
src/backend/opencl/generators/ocl_generic_cn_gpu_generator.cpp
|
||||
src/backend/opencl/kernels/Cn00RyoKernel.cpp
|
||||
src/backend/opencl/kernels/Cn1RyoKernel.cpp
|
||||
src/backend/opencl/kernels/Cn2RyoKernel.cpp
|
||||
src/backend/opencl/runners/OclRyoRunner.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if (WITH_STRICT_CACHE)
|
||||
add_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
|
||||
else()
|
||||
remove_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
|
||||
endif()
|
||||
if (WITH_STRICT_CACHE)
|
||||
add_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
|
||||
else()
|
||||
remove_definitions(/DXMRIG_STRICT_OPENCL_CACHE)
|
||||
endif()
|
||||
|
||||
if (WITH_INTERLEAVE_DEBUG_LOG)
|
||||
add_definitions(/DXMRIG_INTERLEAVE_DEBUG)
|
||||
endif()
|
||||
if (WITH_INTERLEAVE_DEBUG_LOG)
|
||||
add_definitions(/DXMRIG_INTERLEAVE_DEBUG)
|
||||
endif()
|
||||
|
||||
if (WITH_ADL AND (XMRIG_OS_WIN OR XMRIG_OS_LINUX))
|
||||
add_definitions(/DXMRIG_FEATURE_ADL)
|
||||
|
||||
list(APPEND HEADERS_BACKEND_OPENCL
|
||||
src/backend/opencl/wrappers/AdlHealth.h
|
||||
src/backend/opencl/wrappers/AdlLib.h
|
||||
)
|
||||
|
||||
if (XMRIG_OS_WIN)
|
||||
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/wrappers/AdlLib.cpp)
|
||||
else()
|
||||
list(APPEND SOURCES_BACKEND_OPENCL src/backend/opencl/wrappers/AdlLib_linux.cpp)
|
||||
endif()
|
||||
else()
|
||||
remove_definitions(/DXMRIG_FEATURE_ADL)
|
||||
endif()
|
||||
else()
|
||||
remove_definitions(/DXMRIG_FEATURE_OPENCL)
|
||||
remove_definitions(/DXMRIG_FEATURE_ADL)
|
||||
|
||||
set(HEADERS_BACKEND_OPENCL "")
|
||||
set(SOURCES_BACKEND_OPENCL "")
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -23,7 +23,6 @@
|
||||
*/
|
||||
|
||||
#include "backend/opencl/runners/OclRxBaseRunner.h"
|
||||
|
||||
#include "backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h"
|
||||
#include "backend/opencl/kernels/rx/Blake2bInitialHashKernel.h"
|
||||
#include "backend/opencl/kernels/rx/FillAesKernel.h"
|
||||
@@ -56,6 +55,10 @@ xmrig::OclRxBaseRunner::OclRxBaseRunner(size_t index, const OclLaunchData &data)
|
||||
m_gcn_version = 14;
|
||||
}
|
||||
|
||||
if (data.device.type() == OclDevice::Navi_10 || data.device.type() == OclDevice::Navi_12 || data.device.type() == OclDevice::Navi_14) {
|
||||
m_gcn_version = 15;
|
||||
}
|
||||
|
||||
m_options += " -DALGO=" + std::to_string(RxAlgo::id(m_algorithm));
|
||||
m_options += " -DWORKERS_PER_HASH=" + std::to_string(m_worksize);
|
||||
m_options += " -DGCN_VERSION=" + std::to_string(m_gcn_version);
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -23,9 +23,9 @@
|
||||
*/
|
||||
|
||||
#include "backend/opencl/runners/OclRxJitRunner.h"
|
||||
|
||||
#include "backend/opencl/cl/rx/randomx_run_gfx803.h"
|
||||
#include "backend/opencl/cl/rx/randomx_run_gfx900.h"
|
||||
#include "backend/opencl/cl/rx/randomx_run_gfx1010.h"
|
||||
#include "backend/opencl/kernels/rx/Blake2bHashRegistersKernel.h"
|
||||
#include "backend/opencl/kernels/rx/HashAesKernel.h"
|
||||
#include "backend/opencl/kernels/rx/RxJitKernel.h"
|
||||
@@ -84,7 +84,7 @@ void xmrig::OclRxJitRunner::execute(uint32_t iteration)
|
||||
|
||||
OclLib::finish(m_queue);
|
||||
|
||||
m_randomx_run->enqueue(m_queue, m_intensity);
|
||||
m_randomx_run->enqueue(m_queue, m_intensity, (m_gcn_version == 15) ? 32 : 64);
|
||||
}
|
||||
|
||||
|
||||
@@ -120,8 +120,23 @@ bool xmrig::OclRxJitRunner::loadAsmProgram()
|
||||
elf_header_flags = *reinterpret_cast<uint32_t*>((binary_data.data() + elf_header_flags_offset));
|
||||
}
|
||||
|
||||
const size_t len = (m_gcn_version == 14) ? randomx_run_gfx900_bin_size : randomx_run_gfx803_bin_size;
|
||||
unsigned char *binary = (m_gcn_version == 14) ? randomx_run_gfx900_bin : randomx_run_gfx803_bin;
|
||||
size_t len;
|
||||
unsigned char *binary;
|
||||
|
||||
switch (m_gcn_version) {
|
||||
case 14:
|
||||
len = randomx_run_gfx900_bin_size;
|
||||
binary = randomx_run_gfx900_bin;
|
||||
break;
|
||||
case 15:
|
||||
len = randomx_run_gfx1010_bin_size;
|
||||
binary = randomx_run_gfx1010_bin;
|
||||
break;
|
||||
default:
|
||||
len = randomx_run_gfx803_bin_size;
|
||||
binary = randomx_run_gfx803_bin;
|
||||
break;
|
||||
}
|
||||
|
||||
// Set correct internal device ID in the pre-compiled binary
|
||||
if (elf_header_flags) {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
38
src/backend/opencl/wrappers/AdlHealth.h
Normal file
38
src/backend/opencl/wrappers/AdlHealth.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/* XMRig
|
||||
* Copyright 2008-2018 Advanced Micro Devices, Inc.
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef XMRIG_ADLHEALTH_H
|
||||
#define XMRIG_ADLHEALTH_H
|
||||
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
|
||||
struct AdlHealth
|
||||
{
|
||||
uint32_t clock = 0;
|
||||
uint32_t memClock = 0;
|
||||
uint32_t power = 0;
|
||||
uint32_t rpm = 0;
|
||||
uint32_t temperature = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif /* XMRIG_ADLHEALTH_H */
|
||||
265
src/backend/opencl/wrappers/AdlLib.cpp
Normal file
265
src/backend/opencl/wrappers/AdlLib.cpp
Normal file
@@ -0,0 +1,265 @@
|
||||
/* XMRig
|
||||
* Copyright 2008-2018 Advanced Micro Devices, Inc.
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdexcept>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
#include "backend/opencl/wrappers/AdlLib.h"
|
||||
#include "3rdparty/adl/adl_sdk.h"
|
||||
#include "3rdparty/adl/adl_structures.h"
|
||||
#include "backend/opencl/wrappers/OclDevice.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static std::vector<AdapterInfo> adapters;
|
||||
static uv_lib_t adlLib;
|
||||
|
||||
|
||||
static const char *kSymbolNotFound = "symbol not found";
|
||||
static const char *kADL_Main_Control_Create = "ADL_Main_Control_Create";
|
||||
static const char *kADL_Main_Control_Destroy = "ADL_Main_Control_Destroy";
|
||||
static const char *kADL_Adapter_NumberOfAdapters_Get = "ADL_Adapter_NumberOfAdapters_Get";
|
||||
static const char *kADL_Adapter_AdapterInfo_Get = "ADL_Adapter_AdapterInfo_Get";
|
||||
static const char *kADL2_Overdrive_Caps = "ADL2_Overdrive_Caps";
|
||||
static const char *kADL2_OverdriveN_FanControl_Get = "ADL2_OverdriveN_FanControl_Get";
|
||||
static const char *kADL2_New_QueryPMLogData_Get = "ADL2_New_QueryPMLogData_Get";
|
||||
static const char *kADL2_OverdriveN_Temperature_Get = "ADL2_OverdriveN_Temperature_Get";
|
||||
static const char *kADL2_OverdriveN_PerformanceStatus_Get = "ADL2_OverdriveN_PerformanceStatus_Get";
|
||||
static const char *kADL2_Overdrive6_CurrentPower_Get = "ADL2_Overdrive6_CurrentPower_Get";
|
||||
|
||||
|
||||
using ADL_MAIN_CONTROL_CREATE = int (*)(ADL_MAIN_MALLOC_CALLBACK, int);
|
||||
using ADL_MAIN_CONTROL_DESTROY = int (*)();
|
||||
using ADL_ADAPTER_NUMBEROFADAPTERS_GET = int (*)(int *);
|
||||
using ADL_ADAPTER_ADAPTERINFO_GET = int (*)(LPAdapterInfo, int);
|
||||
using ADL2_OVERDRIVE_CAPS = int (*)(ADL_CONTEXT_HANDLE, int, int *, int *, int *);
|
||||
using ADL2_OVERDRIVEN_FANCONTROL_GET = int (*)(ADL_CONTEXT_HANDLE, int, ADLODNFanControl *);
|
||||
using ADL2_NEW_QUERYPMLOGDATA_GET = int (*)(ADL_CONTEXT_HANDLE, int, ADLPMLogDataOutput *);
|
||||
using ADL2_OVERDRIVEN_TEMPERATURE_GET = int (*)(ADL_CONTEXT_HANDLE, int, int, int *);
|
||||
using ADL2_OVERDRIVEN_PERFORMANCESTATUS_GET = int (*)(ADL_CONTEXT_HANDLE, int, ADLODNPerformanceStatus *);
|
||||
using ADL2_OVERDRIVE6_CURRENTPOWER_GET = int (*)(ADL_CONTEXT_HANDLE, int, int, int *);
|
||||
|
||||
|
||||
ADL_MAIN_CONTROL_CREATE ADL_Main_Control_Create = nullptr;
|
||||
ADL_MAIN_CONTROL_DESTROY ADL_Main_Control_Destroy = nullptr;
|
||||
ADL_ADAPTER_NUMBEROFADAPTERS_GET ADL_Adapter_NumberOfAdapters_Get = nullptr;
|
||||
ADL_ADAPTER_ADAPTERINFO_GET ADL_Adapter_AdapterInfo_Get = nullptr;
|
||||
ADL2_OVERDRIVE_CAPS ADL2_Overdrive_Caps = nullptr;
|
||||
ADL2_OVERDRIVEN_FANCONTROL_GET ADL2_OverdriveN_FanControl_Get = nullptr;
|
||||
ADL2_NEW_QUERYPMLOGDATA_GET ADL2_New_QueryPMLogData_Get = nullptr;
|
||||
ADL2_OVERDRIVEN_TEMPERATURE_GET ADL2_OverdriveN_Temperature_Get = nullptr;
|
||||
ADL2_OVERDRIVEN_PERFORMANCESTATUS_GET ADL2_OverdriveN_PerformanceStatus_Get = nullptr;
|
||||
ADL2_OVERDRIVE6_CURRENTPOWER_GET ADL2_Overdrive6_CurrentPower_Get = nullptr;
|
||||
|
||||
|
||||
#define DLSYM(x) if (uv_dlsym(&adlLib, k##x, reinterpret_cast<void**>(&(x))) == -1) { throw std::runtime_error(kSymbolNotFound); }
|
||||
|
||||
|
||||
bool AdlLib::m_initialized = false;
|
||||
bool AdlLib::m_ready = false;
|
||||
|
||||
|
||||
static void * __stdcall ADL_Main_Memory_Alloc(int iSize)
|
||||
{
|
||||
return malloc(iSize);
|
||||
}
|
||||
|
||||
|
||||
static inline bool matchTopology(const PciTopology &topology, const AdapterInfo &adapter)
|
||||
{
|
||||
return adapter.iBusNumber > -1 && topology.bus() == adapter.iBusNumber && topology.device() == adapter.iDeviceNumber && topology.function() == adapter.iFunctionNumber;
|
||||
}
|
||||
|
||||
|
||||
static void getFan_v7(const AdapterInfo &adapter, AdlHealth &health)
|
||||
{
|
||||
ADLODNFanControl data;
|
||||
memset(&data, 0, sizeof(ADLODNFanControl));
|
||||
|
||||
if (ADL2_OverdriveN_FanControl_Get(nullptr, adapter.iAdapterIndex, &data) == ADL_OK) {
|
||||
health.rpm = data.iCurrentFanSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void getTemp_v7(const AdapterInfo &adapter, AdlHealth &health)
|
||||
{
|
||||
int temp = 0;
|
||||
if (ADL2_OverdriveN_Temperature_Get(nullptr, adapter.iAdapterIndex, 1, &temp) == ADL_OK) {
|
||||
health.temperature = temp / 1000;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void getClocks_v7(const AdapterInfo &adapter, AdlHealth &health)
|
||||
{
|
||||
ADLODNPerformanceStatus data;
|
||||
memset(&data, 0, sizeof(ADLODNPerformanceStatus));
|
||||
|
||||
if (ADL2_OverdriveN_PerformanceStatus_Get(nullptr, adapter.iAdapterIndex, &data) == ADL_OK) {
|
||||
health.clock = data.iCoreClock / 100;
|
||||
health.memClock = data.iMemoryClock / 100;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void getPower_v7(const AdapterInfo &adapter, AdlHealth &health)
|
||||
{
|
||||
int power = 0;
|
||||
if (ADL2_Overdrive6_CurrentPower_Get && ADL2_Overdrive6_CurrentPower_Get(nullptr, adapter.iAdapterIndex, 0, &power) == ADL_OK) {
|
||||
health.power = static_cast<uint32_t>(power / 256.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void getSensorsData_v8(const AdapterInfo &adapter, AdlHealth &health)
|
||||
{
|
||||
if (!ADL2_New_QueryPMLogData_Get) {
|
||||
return;
|
||||
}
|
||||
|
||||
ADLPMLogDataOutput data;
|
||||
memset(&data, 0, sizeof(ADLPMLogDataOutput));
|
||||
|
||||
if (ADL2_New_QueryPMLogData_Get(nullptr, adapter.iAdapterIndex, &data) != ADL_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto sensorValue = [&data](ADLSensorType type) { return data.sensors[type].supported ? data.sensors[type].value : 0; };
|
||||
|
||||
health.clock = sensorValue(PMLOG_CLK_GFXCLK);
|
||||
health.memClock = sensorValue(PMLOG_CLK_MEMCLK);
|
||||
health.power = sensorValue(PMLOG_ASIC_POWER);
|
||||
health.rpm = sensorValue(PMLOG_FAN_RPM);
|
||||
health.temperature = sensorValue(PMLOG_TEMPERATURE_HOTSPOT);
|
||||
}
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
bool xmrig::AdlLib::init()
|
||||
{
|
||||
if (!m_initialized) {
|
||||
m_ready = dlopen() && load();
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
return m_ready;
|
||||
}
|
||||
|
||||
|
||||
const char *xmrig::AdlLib::lastError() noexcept
|
||||
{
|
||||
return uv_dlerror(&adlLib);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::AdlLib::close()
|
||||
{
|
||||
if (m_ready) {
|
||||
ADL_Main_Control_Destroy();
|
||||
}
|
||||
|
||||
uv_dlclose(&adlLib);
|
||||
}
|
||||
|
||||
|
||||
AdlHealth xmrig::AdlLib::health(const OclDevice &device)
|
||||
{
|
||||
if (!isReady() || device.vendorId() != OCL_VENDOR_AMD) {
|
||||
return {};
|
||||
}
|
||||
|
||||
int supported, enabled, version;
|
||||
AdlHealth health;
|
||||
|
||||
for (const auto &adapter : adapters) {
|
||||
if (matchTopology(device.topology(), adapter)) {
|
||||
if (ADL2_Overdrive_Caps(nullptr, adapter.iAdapterIndex, &supported, &enabled, &version) != ADL_OK) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (version == 7) {
|
||||
getFan_v7(adapter, health);
|
||||
getTemp_v7(adapter, health);
|
||||
getClocks_v7(adapter, health);
|
||||
getPower_v7(adapter, health);
|
||||
}
|
||||
else if (version == 8) {
|
||||
getSensorsData_v8(adapter, health);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return health;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::AdlLib::dlopen()
|
||||
{
|
||||
return uv_dlopen("atiadlxx.dll", &adlLib) == 0;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::AdlLib::load()
|
||||
{
|
||||
try {
|
||||
DLSYM(ADL_Main_Control_Create);
|
||||
DLSYM(ADL_Main_Control_Destroy);
|
||||
DLSYM(ADL_Adapter_NumberOfAdapters_Get);
|
||||
DLSYM(ADL_Adapter_AdapterInfo_Get);
|
||||
DLSYM(ADL2_Overdrive_Caps);
|
||||
DLSYM(ADL2_OverdriveN_FanControl_Get);
|
||||
DLSYM(ADL2_OverdriveN_Temperature_Get);
|
||||
DLSYM(ADL2_OverdriveN_PerformanceStatus_Get);
|
||||
} catch (std::exception &ex) {
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
DLSYM(ADL2_Overdrive6_CurrentPower_Get);
|
||||
DLSYM(ADL2_New_QueryPMLogData_Get);
|
||||
} catch (std::exception &ex) {}
|
||||
|
||||
if (ADL_Main_Control_Create(ADL_Main_Memory_Alloc, 1) != ADL_OK) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
if (ADL_Adapter_NumberOfAdapters_Get(&count) != ADL_OK) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (count == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
adapters.resize(count);
|
||||
const size_t size = sizeof(adapters[0]) * adapters.size();
|
||||
memset(adapters.data(), 0, size);
|
||||
|
||||
return ADL_Adapter_AdapterInfo_Get(adapters.data(), size) == ADL_OK;
|
||||
}
|
||||
57
src/backend/opencl/wrappers/AdlLib.h
Normal file
57
src/backend/opencl/wrappers/AdlLib.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/* XMRig
|
||||
* Copyright 2008-2018 Advanced Micro Devices, Inc.
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef XMRIG_ADLLIB_H
|
||||
#define XMRIG_ADLLIB_H
|
||||
|
||||
|
||||
#include "backend/opencl/wrappers/AdlHealth.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
class OclDevice;
|
||||
|
||||
|
||||
class AdlLib
|
||||
{
|
||||
public:
|
||||
static bool init();
|
||||
static const char *lastError() noexcept;
|
||||
static void close();
|
||||
|
||||
static AdlHealth health(const OclDevice &device);
|
||||
|
||||
static inline bool isInitialized() noexcept { return m_initialized; }
|
||||
static inline bool isReady() noexcept { return m_ready; }
|
||||
|
||||
private:
|
||||
static bool dlopen();
|
||||
static bool load();
|
||||
|
||||
static bool m_initialized;
|
||||
static bool m_ready;
|
||||
};
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
#endif /* XMRIG_ADLLIB_H */
|
||||
138
src/backend/opencl/wrappers/AdlLib_linux.cpp
Normal file
138
src/backend/opencl/wrappers/AdlLib_linux.cpp
Normal file
@@ -0,0 +1,138 @@
|
||||
/* XMRig
|
||||
* Copyright 2008-2018 Advanced Micro Devices, Inc.
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "backend/opencl/wrappers/AdlLib.h"
|
||||
#include "backend/opencl/wrappers/OclDevice.h"
|
||||
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
bool AdlLib::m_initialized = false;
|
||||
bool AdlLib::m_ready = false;
|
||||
static const std::string kPrefix = "/sys/bus/pci/drivers/amdgpu/";
|
||||
|
||||
|
||||
static inline bool sysfs_is_file(const char *path)
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
return stat(path, &sb) == 0 && ((sb.st_mode & S_IFMT) == S_IFREG);
|
||||
}
|
||||
|
||||
|
||||
static inline std::string sysfs_prefix(const PciTopology &topology)
|
||||
{
|
||||
std::string path = kPrefix + "0000:" + topology.toString().data() + "/hwmon/hwmon";
|
||||
|
||||
if (sysfs_is_file((path + "2/name").c_str())) {
|
||||
return path + "2/";
|
||||
}
|
||||
|
||||
if (sysfs_is_file((path + "3/name").c_str())) {
|
||||
return path + "3/";
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
uint32_t sysfs_read(const std::string &path)
|
||||
{
|
||||
std::ifstream file(path);
|
||||
if (!file.is_open()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t value = 0;
|
||||
file >> value;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
bool xmrig::AdlLib::init()
|
||||
{
|
||||
if (!m_initialized) {
|
||||
m_ready = dlopen() && load();
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
return m_ready;
|
||||
}
|
||||
|
||||
|
||||
const char *xmrig::AdlLib::lastError() noexcept
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::AdlLib::close()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
AdlHealth xmrig::AdlLib::health(const OclDevice &device)
|
||||
{
|
||||
if (!isReady() || device.vendorId() != OCL_VENDOR_AMD) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const auto prefix = sysfs_prefix(device.topology());
|
||||
if (prefix.empty()) {
|
||||
return {};
|
||||
}
|
||||
|
||||
AdlHealth health;
|
||||
health.clock = sysfs_read(prefix + "freq1_input") / 1000000;
|
||||
health.memClock = sysfs_read(prefix + "freq2_input") / 1000000;
|
||||
health.power = sysfs_read(prefix + "power1_average") / 1000000;
|
||||
health.rpm = sysfs_read(prefix + "fan1_input");
|
||||
health.temperature = sysfs_read(prefix + "temp2_input") / 1000;
|
||||
|
||||
return health;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::AdlLib::dlopen()
|
||||
{
|
||||
struct stat sb;
|
||||
if (stat(kPrefix.c_str(), &sb) == -1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (sb.st_mode & S_IFMT) == S_IFDIR;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::AdlLib::load()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
|
||||
#include "backend/opencl/wrappers/OclDevice.h"
|
||||
|
||||
#include "backend/opencl/OclGenerator.h"
|
||||
#include "backend/opencl/OclThreads.h"
|
||||
#include "backend/opencl/wrappers/OclLib.h"
|
||||
@@ -33,6 +32,10 @@
|
||||
#include "crypto/common/Algorithm.h"
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
#ifdef XMRIG_FEATURE_ADL
|
||||
# include "backend/opencl/wrappers/AdlLib.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -107,6 +110,14 @@ static OclDevice::Type getType(const String &name)
|
||||
return OclDevice::Navi_10;
|
||||
}
|
||||
|
||||
if (name == "gfx1011") {
|
||||
return OclDevice::Navi_12;
|
||||
}
|
||||
|
||||
if (name == "gfx1012") {
|
||||
return OclDevice::Navi_14;
|
||||
}
|
||||
|
||||
if (name == "gfx804") {
|
||||
return OclDevice::Lexa;
|
||||
}
|
||||
@@ -200,5 +211,20 @@ void xmrig::OclDevice::toJSON(rapidjson::Value &out, rapidjson::Document &doc) c
|
||||
out.AddMember("bus_id", topology().toString().toJSON(doc), allocator);
|
||||
out.AddMember("cu", computeUnits(), allocator);
|
||||
out.AddMember("global_mem", static_cast<uint64_t>(globalMemSize()), allocator);
|
||||
|
||||
# ifdef XMRIG_FEATURE_ADL
|
||||
if (AdlLib::isReady()) {
|
||||
auto data = AdlLib::health(*this);
|
||||
|
||||
Value health(kObjectType);
|
||||
health.AddMember("temperature", data.temperature, allocator);
|
||||
health.AddMember("power", data.power, allocator);
|
||||
health.AddMember("clock", data.clock, allocator);
|
||||
health.AddMember("mem_clock", data.memClock, allocator);
|
||||
health.AddMember("rpm", data.rpm, allocator);
|
||||
|
||||
out.AddMember("health", health, allocator);
|
||||
}
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -56,7 +56,9 @@ public:
|
||||
Vega_10,
|
||||
Vega_20,
|
||||
Raven,
|
||||
Navi_10
|
||||
Navi_10,
|
||||
Navi_12,
|
||||
Navi_14
|
||||
};
|
||||
|
||||
OclDevice() = delete;
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -38,7 +38,6 @@
|
||||
namespace xmrig {
|
||||
|
||||
static const char *kAuthorization = "authorization";
|
||||
static const char *kContentType = "content-type";
|
||||
|
||||
#ifdef _WIN32
|
||||
static const char *favicon = nullptr;
|
||||
@@ -54,6 +53,8 @@ xmrig::Httpd::Httpd(Base *base) :
|
||||
m_server(nullptr),
|
||||
m_port(0)
|
||||
{
|
||||
m_httpListener = std::make_shared<HttpListener>(this);
|
||||
|
||||
base->addListener(this);
|
||||
}
|
||||
|
||||
@@ -69,7 +70,7 @@ bool xmrig::Httpd::start()
|
||||
return true;
|
||||
}
|
||||
|
||||
m_http = new HttpServer(this);
|
||||
m_http = new HttpServer(m_httpListener);
|
||||
m_server = new TcpServer(config.host(), config.port(), m_http);
|
||||
|
||||
const int rc = m_server->bind();
|
||||
@@ -136,7 +137,7 @@ void xmrig::Httpd::onHttpData(const HttpData &data)
|
||||
# ifdef _WIN32
|
||||
if (favicon != nullptr) {
|
||||
HttpResponse response(data.id());
|
||||
response.setHeader("Content-Type", "image/x-icon");
|
||||
response.setHeader(HttpData::kContentType, "image/x-icon");
|
||||
|
||||
return response.end(favicon, faviconSize);
|
||||
}
|
||||
@@ -159,7 +160,7 @@ void xmrig::Httpd::onHttpData(const HttpData &data)
|
||||
return HttpApiResponse(data.id(), HTTP_STATUS_FORBIDDEN).end();
|
||||
}
|
||||
|
||||
if (!data.headers.count(kContentType) || data.headers.at(kContentType) != "application/json") {
|
||||
if (!data.headers.count(HttpData::kContentTypeL) || data.headers.at(HttpData::kContentTypeL) != HttpData::kApplicationJson) {
|
||||
return HttpApiResponse(data.id(), HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE).end();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -26,14 +26,15 @@
|
||||
#define XMRIG_HTTPD_H
|
||||
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
#include "base/kernel/interfaces/IBaseListener.h"
|
||||
#include "base/kernel/interfaces/IHttpListener.h"
|
||||
#include "base/net/http/HttpListener.h"
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
@@ -62,6 +63,7 @@ private:
|
||||
|
||||
Base *m_base;
|
||||
HttpServer *m_http;
|
||||
std::shared_ptr<IHttpListener> m_httpListener;
|
||||
TcpServer *m_server;
|
||||
uint16_t m_port;
|
||||
};
|
||||
|
||||
@@ -6,6 +6,7 @@ set(HEADERS_BASE
|
||||
src/base/io/json/JsonRequest.h
|
||||
src/base/io/log/backends/ConsoleLog.h
|
||||
src/base/io/log/backends/FileLog.h
|
||||
src/base/io/log/FileLogWriter.h
|
||||
src/base/io/log/Log.h
|
||||
src/base/io/Watcher.h
|
||||
src/base/kernel/Base.h
|
||||
@@ -34,13 +35,18 @@ set(HEADERS_BASE
|
||||
src/base/net/dns/Dns.h
|
||||
src/base/net/dns/DnsRecord.h
|
||||
src/base/net/http/Http.h
|
||||
src/base/net/http/HttpListener.h
|
||||
src/base/net/stratum/BaseClient.h
|
||||
src/base/net/stratum/Client.h
|
||||
src/base/net/stratum/Job.h
|
||||
src/base/net/stratum/NetworkState.h
|
||||
src/base/net/stratum/Pool.h
|
||||
src/base/net/stratum/Pools.h
|
||||
src/base/net/stratum/ProxyUrl.h
|
||||
src/base/net/stratum/Socks5.h
|
||||
src/base/net/stratum/strategies/FailoverStrategy.h
|
||||
src/base/net/stratum/strategies/SinglePoolStrategy.h
|
||||
src/base/net/stratum/strategies/StrategyProxy.h
|
||||
src/base/net/stratum/SubmitResult.h
|
||||
src/base/net/stratum/Url.h
|
||||
src/base/net/tools/RecvBuf.h
|
||||
@@ -61,6 +67,7 @@ set(SOURCES_BASE
|
||||
src/base/io/json/JsonRequest.cpp
|
||||
src/base/io/log/backends/ConsoleLog.cpp
|
||||
src/base/io/log/backends/FileLog.cpp
|
||||
src/base/io/log/FileLogWriter.cpp
|
||||
src/base/io/log/Log.cpp
|
||||
src/base/io/Watcher.cpp
|
||||
src/base/kernel/Base.cpp
|
||||
@@ -77,8 +84,11 @@ set(SOURCES_BASE
|
||||
src/base/net/stratum/BaseClient.cpp
|
||||
src/base/net/stratum/Client.cpp
|
||||
src/base/net/stratum/Job.cpp
|
||||
src/base/net/stratum/NetworkState.cpp
|
||||
src/base/net/stratum/Pool.cpp
|
||||
src/base/net/stratum/Pools.cpp
|
||||
src/base/net/stratum/ProxyUrl.cpp
|
||||
src/base/net/stratum/Socks5.cpp
|
||||
src/base/net/stratum/strategies/FailoverStrategy.cpp
|
||||
src/base/net/stratum/strategies/SinglePoolStrategy.cpp
|
||||
src/base/net/stratum/Url.cpp
|
||||
@@ -134,6 +144,7 @@ if (WITH_HTTP)
|
||||
src/base/kernel/interfaces/IHttpListener.h
|
||||
src/base/kernel/interfaces/IJsonReader.h
|
||||
src/base/kernel/interfaces/ITcpServerListener.h
|
||||
src/base/net/http/Fetch.h
|
||||
src/base/net/http/HttpApiResponse.h
|
||||
src/base/net/http/HttpClient.h
|
||||
src/base/net/http/HttpContext.h
|
||||
@@ -151,9 +162,12 @@ if (WITH_HTTP)
|
||||
src/base/api/Httpd.cpp
|
||||
src/base/api/requests/ApiRequest.cpp
|
||||
src/base/api/requests/HttpApiRequest.cpp
|
||||
src/base/net/http/Fetch.cpp
|
||||
src/base/net/http/HttpApiResponse.cpp
|
||||
src/base/net/http/HttpClient.cpp
|
||||
src/base/net/http/HttpContext.cpp
|
||||
src/base/net/http/HttpData.cpp
|
||||
src/base/net/http/HttpListener.cpp
|
||||
src/base/net/http/HttpResponse.cpp
|
||||
src/base/net/http/HttpServer.cpp
|
||||
src/base/net/stratum/DaemonClient.cpp
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -27,12 +27,40 @@
|
||||
#include "rapidjson/document.h"
|
||||
|
||||
|
||||
void xmrig::JsonRequest::create(rapidjson::Document &doc, int64_t id, const char *method, rapidjson::Value ¶ms)
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static const char *k2_0 = "2.0";
|
||||
static const char *kId = "id";
|
||||
static const char *kJsonRPC = "jsonrpc";
|
||||
static const char *kMethod = "method";
|
||||
const char *JsonRequest::kParams = "params";
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
rapidjson::Document xmrig::JsonRequest::create(int64_t id, const char *method)
|
||||
{
|
||||
using namespace rapidjson;
|
||||
Document doc(kObjectType);
|
||||
auto &allocator = doc.GetAllocator();
|
||||
|
||||
doc.AddMember("id", id, allocator);
|
||||
doc.AddMember("jsonrpc", "2.0", allocator);
|
||||
doc.AddMember("method", rapidjson::StringRef(method), allocator);
|
||||
doc.AddMember("params", params, allocator);
|
||||
doc.AddMember(StringRef(kId), id, allocator);
|
||||
doc.AddMember(StringRef(kJsonRPC), StringRef(k2_0), allocator);
|
||||
doc.AddMember(StringRef(kMethod), StringRef(method), allocator);
|
||||
|
||||
return doc;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::JsonRequest::create(rapidjson::Document &doc, int64_t id, const char *method, rapidjson::Value ¶ms)
|
||||
{
|
||||
using namespace rapidjson;
|
||||
auto &allocator = doc.GetAllocator();
|
||||
|
||||
doc.AddMember(StringRef(kId), id, allocator);
|
||||
doc.AddMember(StringRef(kJsonRPC), StringRef(k2_0), allocator);
|
||||
doc.AddMember(StringRef(kMethod), StringRef(method), allocator);
|
||||
doc.AddMember(StringRef(kParams), params, allocator);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -35,6 +35,9 @@ namespace xmrig {
|
||||
class JsonRequest
|
||||
{
|
||||
public:
|
||||
static const char *kParams;
|
||||
|
||||
static rapidjson::Document create(int64_t id, const char *method);
|
||||
static void create(rapidjson::Document &doc, int64_t id, const char *method, rapidjson::Value ¶ms);
|
||||
};
|
||||
|
||||
|
||||
94
src/base/io/log/FileLogWriter.cpp
Normal file
94
src/base/io/log/FileLogWriter.cpp
Normal file
@@ -0,0 +1,94 @@
|
||||
/* XMRig
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "base/io/log/FileLogWriter.h"
|
||||
#include "base/kernel/Env.h"
|
||||
|
||||
|
||||
#include <cassert>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static void fsWriteCallback(uv_fs_t *req)
|
||||
{
|
||||
delete [] static_cast<char *>(req->data);
|
||||
|
||||
uv_fs_req_cleanup(req);
|
||||
delete req;
|
||||
}
|
||||
|
||||
|
||||
static const char *kNewLine = "\n";
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
bool xmrig::FileLogWriter::open(const char *fileName)
|
||||
{
|
||||
assert(fileName != nullptr);
|
||||
if (!fileName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uv_fs_t req;
|
||||
m_file = uv_fs_open(uv_default_loop(), &req, Env::expand(fileName), O_CREAT | O_APPEND | O_WRONLY, 0644, nullptr);
|
||||
uv_fs_req_cleanup(&req);
|
||||
|
||||
return isOpen();
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::FileLogWriter::write(const char *data, size_t size)
|
||||
{
|
||||
if (!isOpen()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
uv_buf_t buf = uv_buf_init(new char[size], size);
|
||||
memcpy(buf.base, data, size);
|
||||
|
||||
auto req = new uv_fs_t;
|
||||
req->data = buf.base;
|
||||
|
||||
uv_fs_write(uv_default_loop(), req, m_file, &buf, 1, -1, fsWriteCallback);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::FileLogWriter::writeLine(const char *data, size_t size)
|
||||
{
|
||||
uv_buf_t buf[2] = {
|
||||
uv_buf_init(new char[size], size),
|
||||
uv_buf_init(const_cast<char *>(kNewLine), 1)
|
||||
};
|
||||
|
||||
memcpy(buf[0].base, data, size);
|
||||
|
||||
auto req = new uv_fs_t;
|
||||
req->data = buf[0].base;
|
||||
|
||||
uv_fs_write(uv_default_loop(), req, m_file, buf, 2, -1, fsWriteCallback);
|
||||
|
||||
return true;
|
||||
}
|
||||
49
src/base/io/log/FileLogWriter.h
Normal file
49
src/base/io/log/FileLogWriter.h
Normal file
@@ -0,0 +1,49 @@
|
||||
/* XMRig
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef XMRIG_FILELOGWRITER_H
|
||||
#define XMRIG_FILELOGWRITER_H
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
class FileLogWriter
|
||||
{
|
||||
public:
|
||||
FileLogWriter() = default;
|
||||
FileLogWriter(const char *fileName) { open(fileName); }
|
||||
|
||||
inline bool isOpen() const { return m_file >= 0; }
|
||||
|
||||
bool open(const char *fileName);
|
||||
bool write(const char *data, size_t size);
|
||||
bool writeLine(const char *data, size_t size);
|
||||
|
||||
private:
|
||||
int m_file = -1;
|
||||
};
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
|
||||
#endif /* XMRIG_FILELOGWRITER_H */
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2019 Spudz76 <https://github.com/Spudz76>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -189,7 +189,7 @@ private:
|
||||
}
|
||||
|
||||
|
||||
char m_buf[4096]{};
|
||||
char m_buf[Log::kMaxBufferSize]{};
|
||||
std::mutex m_mutex;
|
||||
std::vector<ILogBackend*> m_backends;
|
||||
};
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2019 Spudz76 <https://github.com/Spudz76>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -27,6 +27,7 @@
|
||||
#define XMRIG_LOG_H
|
||||
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
@@ -52,6 +53,8 @@ public:
|
||||
DEBUG, // debug-level messages
|
||||
};
|
||||
|
||||
constexpr static size_t kMaxBufferSize = 16384;
|
||||
|
||||
static void add(ILogBackend *backend);
|
||||
static void destroy();
|
||||
static void print(const char *fmt, ...);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2019 Spudz76 <https://github.com/Spudz76>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -25,44 +25,25 @@
|
||||
|
||||
|
||||
#include "base/io/log/backends/FileLog.h"
|
||||
#include "base/kernel/Env.h"
|
||||
|
||||
|
||||
#include <cassert>
|
||||
#include <cstring>
|
||||
#include <uv.h>
|
||||
|
||||
|
||||
xmrig::FileLog::FileLog(const char *fileName)
|
||||
xmrig::FileLog::FileLog(const char *fileName) :
|
||||
m_writer(fileName)
|
||||
{
|
||||
uv_fs_t req;
|
||||
m_file = uv_fs_open(uv_default_loop(), &req, Env::expand(fileName), O_CREAT | O_APPEND | O_WRONLY, 0644, nullptr);
|
||||
uv_fs_req_cleanup(&req);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::FileLog::print(int, const char *line, size_t, size_t size, bool colors)
|
||||
{
|
||||
if (m_file < 0 || colors) {
|
||||
if (!m_writer.isOpen() || colors) {
|
||||
return;
|
||||
}
|
||||
|
||||
assert(strlen(line) == size);
|
||||
|
||||
uv_buf_t buf = uv_buf_init(new char[size], size);
|
||||
memcpy(buf.base, line, size);
|
||||
|
||||
auto req = new uv_fs_t;
|
||||
req->data = buf.base;
|
||||
|
||||
uv_fs_write(uv_default_loop(), req, m_file, &buf, 1, -1, FileLog::onWrite);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::FileLog::onWrite(uv_fs_t *req)
|
||||
{
|
||||
delete [] static_cast<char *>(req->data);
|
||||
|
||||
uv_fs_req_cleanup(req);
|
||||
delete req;
|
||||
m_writer.write(line, size);
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2019 Spudz76 <https://github.com/Spudz76>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -27,9 +27,7 @@
|
||||
#define XMRIG_FILELOG_H
|
||||
|
||||
|
||||
typedef struct uv_fs_s uv_fs_t;
|
||||
|
||||
|
||||
#include "base/io/log/FileLogWriter.h"
|
||||
#include "base/kernel/interfaces/ILogBackend.h"
|
||||
|
||||
|
||||
@@ -41,14 +39,11 @@ class FileLog : public ILogBackend
|
||||
public:
|
||||
FileLog(const char *fileName);
|
||||
|
||||
|
||||
protected:
|
||||
void print(int level, const char *line, size_t offset, size_t size, bool colors) override;
|
||||
|
||||
private:
|
||||
static void onWrite(uv_fs_t *req);
|
||||
|
||||
int m_file;
|
||||
FileLogWriter m_writer;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 Lee Clagett <https://github.com/vtnerd>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
|
||||
#include <hwloc.h>
|
||||
#include <thread>
|
||||
|
||||
|
||||
bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||
@@ -42,8 +43,11 @@ bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||
}
|
||||
|
||||
if (hwloc_set_cpubind(cpu->topology(), pu->cpuset, HWLOC_CPUBIND_THREAD | HWLOC_CPUBIND_STRICT) >= 0) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
return true;
|
||||
}
|
||||
|
||||
return hwloc_set_cpubind(cpu->topology(), pu->cpuset, HWLOC_CPUBIND_THREAD) >= 0;
|
||||
const bool result = (hwloc_set_cpubind(cpu->topology(), pu->cpuset, HWLOC_CPUBIND_THREAD) >= 0);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2016-2017 XMRig <support@xmrig.com>
|
||||
*
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,6 +28,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/resource.h>
|
||||
#include <uv.h>
|
||||
#include <thread>
|
||||
|
||||
|
||||
#include "base/kernel/Platform.h"
|
||||
@@ -67,7 +68,9 @@ bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||
thread_affinity_policy_data_t policy = { static_cast<integer_t>(cpu_id) };
|
||||
mach_thread = pthread_mach_thread_np(pthread_self());
|
||||
|
||||
return thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY, (thread_policy_t)&policy, 1) == KERN_SUCCESS;
|
||||
const bool result = (thread_policy_set(mach_thread, THREAD_AFFINITY_POLICY, (thread_policy_t)&policy, 1) == KERN_SUCCESS);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2016-2018 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <sys/resource.h>
|
||||
#include <unistd.h>
|
||||
#include <uv.h>
|
||||
#include <thread>
|
||||
|
||||
|
||||
#include "base/kernel/Platform.h"
|
||||
@@ -92,10 +93,13 @@ bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||
CPU_SET(cpu_id, &mn);
|
||||
|
||||
# ifndef __ANDROID__
|
||||
return pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &mn) == 0;
|
||||
const bool result = (pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &mn) == 0);
|
||||
# else
|
||||
return sched_setaffinity(gettid(), sizeof(cpu_set_t), &mn) == 0;
|
||||
const bool result = (sched_setaffinity(gettid(), sizeof(cpu_set_t), &mn) == 0);
|
||||
# endif
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -4,9 +4,8 @@
|
||||
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -98,7 +97,9 @@ bool xmrig::Platform::setThreadAffinity(uint64_t cpu_id)
|
||||
LOG_ERR("Unable to set affinity. Windows supports only affinity up to 63.");
|
||||
}
|
||||
|
||||
return SetThreadAffinityMask(GetCurrentThread(), 1ULL << cpu_id) != 0;
|
||||
const bool result = (SetThreadAffinityMask(GetCurrentThread(), 1ULL << cpu_id) != 0);
|
||||
Sleep(1);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -176,6 +176,9 @@ void xmrig::BaseTransform::transform(rapidjson::Document &doc, int key, const ch
|
||||
case IConfig::SelfSelectKey: /* --self-select */
|
||||
return add(doc, Pools::kPools, Pool::kSelfSelect, arg);
|
||||
|
||||
case IConfig::ProxyKey: /* --proxy */
|
||||
return add(doc, Pools::kPools, Pool::kSOCKS5, arg);
|
||||
|
||||
case IConfig::LogFileKey: /* --log-file */
|
||||
return set(doc, BaseConfig::kLogFile, arg);
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -39,6 +39,7 @@ class Algorithm;
|
||||
class Job;
|
||||
class JobResult;
|
||||
class Pool;
|
||||
class ProxyUrl;
|
||||
class String;
|
||||
|
||||
|
||||
@@ -79,6 +80,7 @@ public:
|
||||
virtual void setAlgo(const Algorithm &algo) = 0;
|
||||
virtual void setEnabled(bool enabled) = 0;
|
||||
virtual void setPool(const Pool &pool) = 0;
|
||||
virtual void setProxy(const ProxyUrl &proxy) = 0;
|
||||
virtual void setQuiet(bool quiet) = 0;
|
||||
virtual void setRetries(int retries) = 0;
|
||||
virtual void setRetryPause(uint64_t ms) = 0;
|
||||
|
||||
@@ -66,6 +66,7 @@ public:
|
||||
UserAgentKey = 1008,
|
||||
UserKey = 'u',
|
||||
UserpassKey = 'O',
|
||||
ProxyKey = 'x',
|
||||
VerboseKey = 1100,
|
||||
TlsKey = 1013,
|
||||
FingerprintKey = 1014,
|
||||
@@ -96,6 +97,7 @@ public:
|
||||
CPUMaxThreadsKey = 1026,
|
||||
MemoryPoolKey = 1027,
|
||||
YieldKey = 1030,
|
||||
AstroBWTMaxSizeKey = 1034,
|
||||
|
||||
// xmrig amd
|
||||
OclPlatformKey = 1400,
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -35,6 +35,7 @@ namespace xmrig {
|
||||
class Algorithm;
|
||||
class IClient;
|
||||
class JobResult;
|
||||
class ProxyUrl;
|
||||
|
||||
|
||||
class IStrategy
|
||||
@@ -48,6 +49,7 @@ public:
|
||||
virtual void connect() = 0;
|
||||
virtual void resume() = 0;
|
||||
virtual void setAlgo(const Algorithm &algo) = 0;
|
||||
virtual void setProxy(const ProxyUrl &proxy) = 0;
|
||||
virtual void stop() = 0;
|
||||
virtual void tick(uint64_t now) = 0;
|
||||
};
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -50,13 +50,14 @@ xmrig::DnsRecord::DnsRecord(const addrinfo *addr) :
|
||||
sockaddr *xmrig::DnsRecord::addr(uint16_t port) const
|
||||
{
|
||||
if (m_type == A) {
|
||||
sockaddr_in *addr = new sockaddr_in();
|
||||
auto addr = new sockaddr_in();
|
||||
uv_ip4_addr(m_ip.data(), port, addr);
|
||||
|
||||
return reinterpret_cast<sockaddr *>(addr);
|
||||
}
|
||||
else if (m_type == AAAA) {
|
||||
sockaddr_in6 *addr = new sockaddr_in6();
|
||||
|
||||
if (m_type == AAAA) {
|
||||
auto addr = new sockaddr_in6();
|
||||
uv_ip6_addr(m_ip.data(), port, addr);
|
||||
|
||||
return reinterpret_cast<sockaddr *>(addr);
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
AAAA
|
||||
};
|
||||
|
||||
inline DnsRecord() : m_type(Unknown) {}
|
||||
DnsRecord() = default;
|
||||
DnsRecord(const addrinfo *addr);
|
||||
|
||||
sockaddr *addr(uint16_t port = 0) const;
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
inline Type type() const { return m_type; }
|
||||
|
||||
private:
|
||||
Type m_type;
|
||||
Type m_type = Unknown;
|
||||
String m_ip;
|
||||
};
|
||||
|
||||
|
||||
155
src/base/net/http/Fetch.cpp
Normal file
155
src/base/net/http/Fetch.cpp
Normal file
@@ -0,0 +1,155 @@
|
||||
/* XMRig
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "base/net/http/Fetch.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/net/http/HttpClient.h"
|
||||
#include "base/net/stratum/Pool.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson/stringbuffer.h"
|
||||
#include "rapidjson/writer.h"
|
||||
|
||||
|
||||
#ifdef XMRIG_FEATURE_TLS
|
||||
# include "base/net/http/HttpsClient.h"
|
||||
#endif
|
||||
|
||||
|
||||
xmrig::FetchRequest::FetchRequest(http_method method, const String &host, uint16_t port, const String &path, bool tls, bool quiet, const char *data, size_t size, const char *contentType) :
|
||||
quiet(quiet),
|
||||
tls(tls),
|
||||
method(method),
|
||||
host(host),
|
||||
path(path),
|
||||
port(port)
|
||||
{
|
||||
assert(port > 0);
|
||||
|
||||
setBody(data, size, contentType);
|
||||
}
|
||||
|
||||
|
||||
xmrig::FetchRequest::FetchRequest(http_method method, const String &host, uint16_t port, const String &path, const rapidjson::Document &doc, bool tls, bool quiet) :
|
||||
quiet(quiet),
|
||||
tls(tls),
|
||||
method(method),
|
||||
host(host),
|
||||
path(path),
|
||||
port(port)
|
||||
{
|
||||
assert(port > 0);
|
||||
|
||||
setBody(doc);
|
||||
}
|
||||
|
||||
|
||||
xmrig::FetchRequest::FetchRequest(int method, const Pool &pool, const String &path, bool quiet, const char *data, size_t size, const char *contentType) :
|
||||
quiet(quiet),
|
||||
tls(pool.isTLS()),
|
||||
method(static_cast<http_method>(method)),
|
||||
fingerprint(pool.fingerprint()),
|
||||
host(pool.host()),
|
||||
path(path),
|
||||
port(pool.port())
|
||||
{
|
||||
assert(pool.isValid());
|
||||
|
||||
setBody(data, size, contentType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
xmrig::FetchRequest::FetchRequest(int method, const Pool &pool, const String &path, const rapidjson::Document &doc, bool quiet) :
|
||||
quiet(quiet),
|
||||
tls(pool.isTLS()),
|
||||
method(static_cast<http_method>(method)),
|
||||
fingerprint(pool.fingerprint()),
|
||||
host(pool.host()),
|
||||
path(path),
|
||||
port(pool.port())
|
||||
{
|
||||
assert(pool.isValid());
|
||||
|
||||
setBody(doc);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void xmrig::FetchRequest::setBody(const char *data, size_t size, const char *contentType)
|
||||
{
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
|
||||
assert(method != HTTP_GET && method != HTTP_HEAD);
|
||||
|
||||
if (method == HTTP_GET || method == HTTP_HEAD) {
|
||||
return;
|
||||
}
|
||||
|
||||
body = size ? std::string(data, size) : data;
|
||||
if (contentType) {
|
||||
headers.insert({ HttpData::kContentType, contentType });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void xmrig::FetchRequest::setBody(const rapidjson::Document &doc)
|
||||
{
|
||||
assert(method != HTTP_GET && method != HTTP_HEAD);
|
||||
|
||||
if (method == HTTP_GET || method == HTTP_HEAD) {
|
||||
return;
|
||||
}
|
||||
|
||||
using namespace rapidjson;
|
||||
|
||||
StringBuffer buffer(nullptr, 512);
|
||||
Writer<StringBuffer> writer(buffer);
|
||||
doc.Accept(writer);
|
||||
|
||||
setBody(buffer.GetString(), buffer.GetSize(), HttpData::kApplicationJson.c_str());
|
||||
}
|
||||
|
||||
|
||||
void xmrig::fetch(FetchRequest &&req, const std::weak_ptr<IHttpListener> &listener, int type)
|
||||
{
|
||||
# ifdef APP_DEBUG
|
||||
LOG_DEBUG(CYAN("http%s://%s:%u ") MAGENTA_BOLD("\"%s %s\"") BLACK_BOLD(" body: ") CYAN_BOLD("%zu") BLACK_BOLD(" bytes"),
|
||||
req.tls ? "s" : "", req.host.data(), req.port, http_method_str(req.method), req.path.data(), req.body.size());
|
||||
|
||||
if (req.hasBody() && req.body.size() < (Log::kMaxBufferSize - 1024) && req.headers.count(HttpData::kContentType) && req.headers.at(HttpData::kContentType) == HttpData::kApplicationJson) {
|
||||
Log::print(BLUE_BG_BOLD("%s:") BLACK_BOLD_S " %.*s", req.headers.at(HttpData::kContentType).c_str(), static_cast<int>(req.body.size()), req.body.c_str());
|
||||
}
|
||||
# endif
|
||||
|
||||
HttpClient *client;
|
||||
# ifdef XMRIG_FEATURE_TLS
|
||||
if (req.tls) {
|
||||
client = new HttpsClient(std::move(req), listener);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
{
|
||||
client = new HttpClient(std::move(req), listener);
|
||||
}
|
||||
|
||||
client->userType = type;
|
||||
client->connect();
|
||||
}
|
||||
74
src/base/net/http/Fetch.h
Normal file
74
src/base/net/http/Fetch.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/* XMRig
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef XMRIG_FETCH_H
|
||||
#define XMRIG_FETCH_H
|
||||
|
||||
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "base/tools/String.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
class IHttpListener;
|
||||
class Pool;
|
||||
|
||||
|
||||
class FetchRequest
|
||||
{
|
||||
public:
|
||||
FetchRequest() = default;
|
||||
FetchRequest(http_method method, const String &host, uint16_t port, const String &path, bool tls = false, bool quiet = false, const char *data = nullptr, size_t size = 0, const char *contentType = nullptr);
|
||||
FetchRequest(http_method method, const String &host, uint16_t port, const String &path, const rapidjson::Document &doc, bool tls = false, bool quiet = false);
|
||||
FetchRequest(int method, const Pool &pool, const String &path, bool quiet = false, const char *data = nullptr, size_t size = 0, const char *contentType = nullptr);
|
||||
FetchRequest(int method, const Pool &pool, const String &path, const rapidjson::Document &doc, bool quiet = false);
|
||||
|
||||
void setBody(const char *data, size_t size, const char *contentType = nullptr);
|
||||
void setBody(const rapidjson::Document &doc);
|
||||
|
||||
inline bool hasBody() const { return method != HTTP_GET && method != HTTP_HEAD && !body.empty(); }
|
||||
|
||||
bool quiet = false;
|
||||
bool tls = false;
|
||||
http_method method = HTTP_GET;
|
||||
std::map<const std::string, const std::string> headers;
|
||||
std::string body;
|
||||
String fingerprint;
|
||||
String host;
|
||||
String path;
|
||||
uint16_t port = 0;
|
||||
};
|
||||
|
||||
|
||||
void fetch(FetchRequest &&req, const std::weak_ptr<IHttpListener> &listener, int type = 0);
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
#endif // XMRIG_FETCH_H
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2014-2019 heapwolf <https://github.com/heapwolf>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -24,8 +24,9 @@
|
||||
*/
|
||||
|
||||
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "base/net/http/HttpApiResponse.h"
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "base/net/http/HttpData.h"
|
||||
#include "rapidjson/prettywriter.h"
|
||||
#include "rapidjson/stringbuffer.h"
|
||||
|
||||
@@ -75,7 +76,7 @@ void xmrig::HttpApiResponse::end()
|
||||
return HttpResponse::end();
|
||||
}
|
||||
|
||||
setHeader("Content-Type", "application/json");
|
||||
setHeader(HttpData::kContentType, HttpData::kApplicationJson);
|
||||
|
||||
StringBuffer buffer(nullptr, 4096);
|
||||
PrettyWriter<StringBuffer> writer(buffer);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2014-2019 heapwolf <https://github.com/heapwolf>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2014-2019 heapwolf <https://github.com/heapwolf>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -24,70 +24,60 @@
|
||||
*/
|
||||
|
||||
|
||||
#include <sstream>
|
||||
|
||||
|
||||
#include "base/net/http/HttpClient.h"
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/kernel/Platform.h"
|
||||
#include "base/net/dns/Dns.h"
|
||||
#include "base/net/http/HttpClient.h"
|
||||
#include "base/tools/Baton.h"
|
||||
|
||||
|
||||
#include <sstream>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
static const char *kCRLF = "\r\n";
|
||||
|
||||
|
||||
class ClientWriteBaton : public Baton<uv_write_t>
|
||||
class HttpClientWriteBaton : public Baton<uv_write_t>
|
||||
{
|
||||
public:
|
||||
inline ClientWriteBaton(const std::string &header, std::string &&body) :
|
||||
inline HttpClientWriteBaton(const std::string &header, std::string &&body) :
|
||||
m_body(std::move(body)),
|
||||
m_header(header)
|
||||
{
|
||||
bufs[0].len = m_header.size();
|
||||
bufs[0].base = const_cast<char *>(m_header.c_str());
|
||||
|
||||
if (!m_body.empty()) {
|
||||
bufs[1].len = m_body.size();
|
||||
bufs[1].base = const_cast<char *>(m_body.c_str());
|
||||
}
|
||||
else {
|
||||
bufs[1].base = nullptr;
|
||||
bufs[1].len = 0;
|
||||
}
|
||||
m_bufs[0] = uv_buf_init(const_cast<char *>(m_header.c_str()), m_header.size());
|
||||
m_bufs[1] = m_body.empty() ? uv_buf_init(nullptr, 0) : uv_buf_init(const_cast<char *>(m_body.c_str()), m_body.size());
|
||||
}
|
||||
|
||||
|
||||
inline size_t count() const { return bufs[1].base == nullptr ? 1 : 2; }
|
||||
inline size_t size() const { return bufs[0].len + bufs[1].len; }
|
||||
inline static void onWrite(uv_write_t *req, int) { delete reinterpret_cast<ClientWriteBaton *>(req->data); }
|
||||
|
||||
|
||||
uv_buf_t bufs[2]{};
|
||||
void write(uv_stream_t *stream)
|
||||
{
|
||||
uv_write(&req, stream, m_bufs, nbufs(), [](uv_write_t *req, int) { delete reinterpret_cast<HttpClientWriteBaton *>(req->data); });
|
||||
}
|
||||
|
||||
private:
|
||||
inline size_t nbufs() const { return m_bufs[1].len > 0 ? 2 : 1; }
|
||||
|
||||
std::string m_body;
|
||||
std::string m_header;
|
||||
uv_buf_t m_bufs[2]{};
|
||||
};
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
xmrig::HttpClient::HttpClient(int method, const String &url, IHttpListener *listener, const char *data, size_t size) :
|
||||
HttpContext(HTTP_RESPONSE, listener)
|
||||
xmrig::HttpClient::HttpClient(FetchRequest &&req, const std::weak_ptr<IHttpListener> &listener) :
|
||||
HttpContext(HTTP_RESPONSE, listener),
|
||||
m_req(std::move(req))
|
||||
{
|
||||
this->method = method;
|
||||
this->url = url;
|
||||
|
||||
if (data) {
|
||||
body = size ? std::string(data, size) : data;
|
||||
}
|
||||
|
||||
m_dns = new Dns(this);
|
||||
method = m_req.method;
|
||||
url = std::move(m_req.path);
|
||||
body = std::move(m_req.body);
|
||||
headers = std::move(m_req.headers);
|
||||
m_dns = new Dns(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,17 +87,9 @@ xmrig::HttpClient::~HttpClient()
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::HttpClient::connect(const String &host, uint16_t port)
|
||||
bool xmrig::HttpClient::connect()
|
||||
{
|
||||
m_port = port;
|
||||
|
||||
return m_dns->resolve(host);
|
||||
}
|
||||
|
||||
|
||||
const xmrig::String &xmrig::HttpClient::host() const
|
||||
{
|
||||
return m_dns->host();
|
||||
return m_dns->resolve(m_req.host);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,25 +98,27 @@ void xmrig::HttpClient::onResolved(const Dns &dns, int status)
|
||||
this->status = status;
|
||||
|
||||
if (status < 0 && dns.isEmpty()) {
|
||||
if (!m_quiet) {
|
||||
LOG_ERR("[%s:%d] DNS error: \"%s\"", dns.host().data(), m_port, uv_strerror(status));
|
||||
if (!isQuiet()) {
|
||||
LOG_ERR("[%s:%d] DNS error: \"%s\"", dns.host().data(), port(), uv_strerror(status));
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
sockaddr *addr = dns.get().addr(m_port);
|
||||
sockaddr *addr = dns.get().addr(port());
|
||||
|
||||
auto req = new uv_connect_t;
|
||||
req->data = this;
|
||||
|
||||
uv_tcp_connect(req, m_tcp, addr, onConnect);
|
||||
|
||||
delete addr;
|
||||
}
|
||||
|
||||
|
||||
void xmrig::HttpClient::handshake()
|
||||
{
|
||||
headers.insert({ "Host", m_dns->host().data() });
|
||||
headers.insert({ "Host", host() });
|
||||
headers.insert({ "Connection", "close" });
|
||||
headers.insert({ "User-Agent", Platform::userAgent() });
|
||||
|
||||
@@ -167,8 +151,8 @@ void xmrig::HttpClient::read(const char *data, size_t size)
|
||||
|
||||
void xmrig::HttpClient::write(const std::string &header)
|
||||
{
|
||||
auto baton = new ClientWriteBaton(header, std::move(body));
|
||||
uv_write(&baton->req, stream(), baton->bufs, baton->count(), ClientWriteBaton::onWrite);
|
||||
auto baton = new HttpClientWriteBaton(header, std::move(body));
|
||||
baton->write(stream());
|
||||
}
|
||||
|
||||
|
||||
@@ -181,8 +165,8 @@ void xmrig::HttpClient::onConnect(uv_connect_t *req, int status)
|
||||
}
|
||||
|
||||
if (status < 0) {
|
||||
if (!client->m_quiet) {
|
||||
LOG_ERR("[%s:%d] connect error: \"%s\"", client->m_dns->host().data(), client->m_port, uv_strerror(status));
|
||||
if (!client->isQuiet()) {
|
||||
LOG_ERR("[%s:%d] connect error: \"%s\"", client->m_dns->host().data(), client->port(), uv_strerror(status));
|
||||
}
|
||||
|
||||
delete req;
|
||||
@@ -194,12 +178,7 @@ void xmrig::HttpClient::onConnect(uv_connect_t *req, int status)
|
||||
[](uv_handle_t *, size_t suggested_size, uv_buf_t *buf)
|
||||
{
|
||||
buf->base = new char[suggested_size];
|
||||
|
||||
# ifdef _WIN32
|
||||
buf->len = static_cast<unsigned int>(suggested_size);
|
||||
# else
|
||||
buf->len = suggested_size;
|
||||
# endif
|
||||
buf->len = suggested_size;
|
||||
},
|
||||
[](uv_stream_t *tcp, ssize_t nread, const uv_buf_t *buf)
|
||||
{
|
||||
@@ -208,8 +187,8 @@ void xmrig::HttpClient::onConnect(uv_connect_t *req, int status)
|
||||
if (nread >= 0) {
|
||||
client->read(buf->base, static_cast<size_t>(nread));
|
||||
} else {
|
||||
if (!client->m_quiet && nread != UV_EOF) {
|
||||
LOG_ERR("[%s:%d] read error: \"%s\"", client->m_dns->host().data(), client->m_port, uv_strerror(static_cast<int>(nread)));
|
||||
if (!client->isQuiet() && nread != UV_EOF) {
|
||||
LOG_ERR("[%s:%d] read error: \"%s\"", client->m_dns->host().data(), client->port(), uv_strerror(static_cast<int>(nread)));
|
||||
}
|
||||
|
||||
client->close(static_cast<int>(nread));
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2014-2019 heapwolf <https://github.com/heapwolf>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,8 +28,9 @@
|
||||
#define XMRIG_HTTPCLIENT_H
|
||||
|
||||
|
||||
#include "base/net/http/HttpContext.h"
|
||||
#include "base/kernel/interfaces/IDnsListener.h"
|
||||
#include "base/net/http/Fetch.h"
|
||||
#include "base/net/http/HttpContext.h"
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
@@ -44,14 +45,14 @@ class HttpClient : public HttpContext, public IDnsListener
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(HttpClient);
|
||||
|
||||
HttpClient(int method, const String &url, IHttpListener *listener, const char *data = nullptr, size_t size = 0);
|
||||
HttpClient(FetchRequest &&req, const std::weak_ptr<IHttpListener> &listener);
|
||||
~HttpClient() override;
|
||||
|
||||
inline uint16_t port() const { return m_port; }
|
||||
inline void setQuiet(bool quiet) { m_quiet = quiet; }
|
||||
inline bool isQuiet() const { return m_req.quiet; }
|
||||
inline const char *host() const override { return m_req.host; }
|
||||
inline uint16_t port() const override { return m_req.port; }
|
||||
|
||||
bool connect(const String &host, uint16_t port);
|
||||
const String &host() const;
|
||||
bool connect();
|
||||
|
||||
protected:
|
||||
void onResolved(const Dns &dns, int status) override;
|
||||
@@ -60,13 +61,14 @@ protected:
|
||||
virtual void read(const char *data, size_t size);
|
||||
virtual void write(const std::string &header);
|
||||
|
||||
bool m_quiet = false;
|
||||
protected:
|
||||
inline const FetchRequest &req() const { return m_req; }
|
||||
|
||||
private:
|
||||
static void onConnect(uv_connect_t *req, int status);
|
||||
|
||||
Dns *m_dns;
|
||||
uint16_t m_port = 0;
|
||||
FetchRequest m_req;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2014-2019 heapwolf <https://github.com/heapwolf>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -45,7 +45,7 @@ static uint64_t SEQUENCE = 0;
|
||||
} // namespace xmrig
|
||||
|
||||
|
||||
xmrig::HttpContext::HttpContext(int parser_type, IHttpListener *listener) :
|
||||
xmrig::HttpContext::HttpContext(int parser_type, const std::weak_ptr<IHttpListener> &listener) :
|
||||
HttpData(SEQUENCE++),
|
||||
m_timestamp(Chrono::steadyMSecs()),
|
||||
m_listener(listener)
|
||||
@@ -75,6 +75,12 @@ xmrig::HttpContext::~HttpContext()
|
||||
}
|
||||
|
||||
|
||||
bool xmrig::HttpContext::isRequest() const
|
||||
{
|
||||
return m_parser->type == HTTP_REQUEST;
|
||||
}
|
||||
|
||||
|
||||
size_t xmrig::HttpContext::parse(const char *data, size_t size)
|
||||
{
|
||||
return http_parser_execute(m_parser, &http_settings, data, size);
|
||||
@@ -107,15 +113,14 @@ uint64_t xmrig::HttpContext::elapsed() const
|
||||
|
||||
void xmrig::HttpContext::close(int status)
|
||||
{
|
||||
if (status < 0 && m_listener) {
|
||||
auto listener = httpListener();
|
||||
|
||||
if (status < 0 && listener) {
|
||||
this->status = status;
|
||||
m_listener->onHttpData(*this);
|
||||
listener->onHttpData(*this);
|
||||
}
|
||||
|
||||
auto it = storage.find(id());
|
||||
if (it != storage.end()) {
|
||||
storage.erase(it);
|
||||
}
|
||||
storage.erase(id());
|
||||
|
||||
if (!uv_is_closing(handle())) {
|
||||
uv_close(handle(), [](uv_handle_t *handle) -> void { delete reinterpret_cast<HttpContext*>(handle->data); });
|
||||
@@ -135,7 +140,7 @@ xmrig::HttpContext *xmrig::HttpContext::get(uint64_t id)
|
||||
|
||||
void xmrig::HttpContext::closeAll()
|
||||
{
|
||||
for (auto kv : storage) {
|
||||
for (auto &kv : storage) {
|
||||
if (!uv_is_closing(kv.second->handle())) {
|
||||
uv_close(kv.second->handle(), [](uv_handle_t *handle) -> void { delete reinterpret_cast<HttpContext*>(handle->data); });
|
||||
}
|
||||
@@ -217,9 +222,13 @@ void xmrig::HttpContext::attach(http_parser_settings *settings)
|
||||
|
||||
settings->on_message_complete = [](http_parser *parser) -> int
|
||||
{
|
||||
auto ctx = static_cast<HttpContext*>(parser->data);
|
||||
ctx->m_listener->onHttpData(*ctx);
|
||||
ctx->m_listener = nullptr;
|
||||
auto ctx = static_cast<HttpContext*>(parser->data);
|
||||
auto listener = ctx->httpListener();
|
||||
|
||||
if (listener) {
|
||||
listener->onHttpData(*ctx);
|
||||
ctx->m_listener.reset();
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2014-2019 heapwolf <https://github.com/heapwolf>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -40,6 +40,9 @@ using uv_tcp_t = struct uv_tcp_s;
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
@@ -51,14 +54,20 @@ class HttpContext : public HttpData
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(HttpContext)
|
||||
|
||||
HttpContext(int parser_type, IHttpListener *listener);
|
||||
virtual ~HttpContext();
|
||||
HttpContext(int parser_type, const std::weak_ptr<IHttpListener> &listener);
|
||||
~HttpContext() override;
|
||||
|
||||
inline uv_stream_t *stream() const { return reinterpret_cast<uv_stream_t *>(m_tcp); }
|
||||
inline uv_handle_t *handle() const { return reinterpret_cast<uv_handle_t *>(m_tcp); }
|
||||
|
||||
inline const char *host() const override { return nullptr; }
|
||||
inline const char *tlsFingerprint() const override { return nullptr; }
|
||||
inline const char *tlsVersion() const override { return nullptr; }
|
||||
inline uint16_t port() const override { return 0; }
|
||||
|
||||
bool isRequest() const override;
|
||||
size_t parse(const char *data, size_t size);
|
||||
std::string ip() const;
|
||||
std::string ip() const override;
|
||||
uint64_t elapsed() const;
|
||||
void close(int status = 0);
|
||||
|
||||
@@ -69,6 +78,8 @@ protected:
|
||||
uv_tcp_t *m_tcp;
|
||||
|
||||
private:
|
||||
inline IHttpListener *httpListener() const { return m_listener.expired() ? nullptr : m_listener.lock().get(); }
|
||||
|
||||
static int onHeaderField(http_parser *parser, const char *at, size_t length);
|
||||
static int onHeaderValue(http_parser *parser, const char *at, size_t length);
|
||||
static void attach(http_parser_settings *settings);
|
||||
@@ -78,9 +89,9 @@ private:
|
||||
bool m_wasHeaderValue = false;
|
||||
const uint64_t m_timestamp;
|
||||
http_parser *m_parser;
|
||||
IHttpListener *m_listener;
|
||||
std::string m_lastHeaderField;
|
||||
std::string m_lastHeaderValue;
|
||||
std::weak_ptr<IHttpListener> m_listener;
|
||||
};
|
||||
|
||||
|
||||
|
||||
31
src/base/net/http/HttpData.cpp
Normal file
31
src/base/net/http/HttpData.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
/* XMRig
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "base/net/http/HttpData.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
const std::string HttpData::kApplicationJson = "application/json";
|
||||
const std::string HttpData::kContentType = "Content-Type";
|
||||
const std::string HttpData::kContentTypeL = "content-type";
|
||||
|
||||
|
||||
} // namespace xmrig
|
||||
@@ -6,8 +6,8 @@
|
||||
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
|
||||
* Copyright 2017-2018 XMR-Stak <https://github.com/fireice-uk>, <https://github.com/psychocrypt>
|
||||
* Copyright 2014-2019 heapwolf <https://github.com/heapwolf>
|
||||
* Copyright 2018-2019 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2019 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -28,6 +28,9 @@
|
||||
#define XMRIG_HTTPDATA_H
|
||||
|
||||
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
@@ -38,12 +41,28 @@ namespace xmrig {
|
||||
class HttpData
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(HttpData)
|
||||
|
||||
static const std::string kApplicationJson;
|
||||
static const std::string kContentType;
|
||||
static const std::string kContentTypeL;
|
||||
|
||||
|
||||
inline HttpData(uint64_t id) : m_id(id) {}
|
||||
virtual ~HttpData() = default;
|
||||
|
||||
inline uint64_t id() const { return m_id; }
|
||||
|
||||
int method = 0;
|
||||
int status = 0;
|
||||
virtual bool isRequest() const = 0;
|
||||
virtual const char *host() const = 0;
|
||||
virtual const char *tlsFingerprint() const = 0;
|
||||
virtual const char *tlsVersion() const = 0;
|
||||
virtual std::string ip() const = 0;
|
||||
virtual uint16_t port() const = 0;
|
||||
|
||||
int method = 0;
|
||||
int status = 0;
|
||||
int userType = 0;
|
||||
std::map<const std::string, const std::string> headers;
|
||||
std::string body;
|
||||
std::string url;
|
||||
|
||||
41
src/base/net/http/HttpListener.cpp
Normal file
41
src/base/net/http/HttpListener.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
/* XMRig
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include "base/net/http/HttpListener.h"
|
||||
#include "3rdparty/http-parser/http_parser.h"
|
||||
#include "base/io/log/Log.h"
|
||||
#include "base/net/http/HttpData.h"
|
||||
|
||||
|
||||
void xmrig::HttpListener::onHttpData(const HttpData &data)
|
||||
{
|
||||
# ifdef APP_DEBUG
|
||||
if (!data.isRequest()) {
|
||||
LOG_DEBUG(CYAN("http%s://%s:%u ") MAGENTA_BOLD("\"%s %s\" ") CSI "1;%dm%d" CLEAR BLACK_BOLD(" received: ") CYAN_BOLD("%zu") BLACK_BOLD(" bytes"),
|
||||
data.tlsVersion() ? "s" : "", data.host(), data.port(), http_method_str(static_cast<http_method>(data.method)), data.url.data(),
|
||||
data.status >= 400 ? 31 : 32, data.status, data.body.size());
|
||||
|
||||
if (data.body.size() < (Log::kMaxBufferSize - 1024) && data.headers.count(HttpData::kContentTypeL) && data.headers.at(HttpData::kContentTypeL) == HttpData::kApplicationJson) {
|
||||
Log::print(BLUE_BG_BOLD("%s:") BLACK_BOLD_S " %.*s", data.headers.at(HttpData::kContentTypeL).c_str(), static_cast<int>(data.body.size()), data.body.c_str());
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
m_listener->onHttpData(data);
|
||||
}
|
||||
45
src/base/net/http/HttpListener.h
Normal file
45
src/base/net/http/HttpListener.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* XMRig
|
||||
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
|
||||
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef XMRIG_HTTPLISTENER_H
|
||||
#define XMRIG_HTTPLISTENER_H
|
||||
|
||||
|
||||
#include "base/kernel/interfaces/IHttpListener.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
class HttpListener : public IHttpListener
|
||||
{
|
||||
public:
|
||||
inline HttpListener(IHttpListener *listener) : m_listener(listener) {}
|
||||
|
||||
protected:
|
||||
void onHttpData(const HttpData &data) override;
|
||||
|
||||
private:
|
||||
IHttpListener *m_listener;
|
||||
};
|
||||
|
||||
|
||||
} /* namespace xmrig */
|
||||
|
||||
|
||||
#endif // XMRIG_HTTPLISTENER_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user