mirror of
https://github.com/xmrig/xmrig.git
synced 2025-01-26 20:46:20 +00:00
commit
41b92740ea
7 changed files with 53 additions and 14 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
# v2.4.4
|
||||||
|
- Added libmicrohttpd version to --version output.
|
||||||
|
- Fixed bug in singal handler, in some cases miner wasn't shutdown properly.
|
||||||
|
- Fixed recent MSVC 2017 version detection.
|
||||||
|
- [#279](https://github.com/xmrig/xmrig/pull/279) Fixed build on some macOS versions.
|
||||||
|
|
||||||
# v2.4.3
|
# v2.4.3
|
||||||
- [#94](https://github.com/xmrig/xmrig/issues/94#issuecomment-342019257) [#216](https://github.com/xmrig/xmrig/issues/216) Added **ARMv8** and **ARMv7** support. Hardware AES supported, thanks [Imran Yusuff](https://github.com/imranyusuff).
|
- [#94](https://github.com/xmrig/xmrig/issues/94#issuecomment-342019257) [#216](https://github.com/xmrig/xmrig/issues/216) Added **ARMv8** and **ARMv7** support. Hardware AES supported, thanks [Imran Yusuff](https://github.com/imranyusuff).
|
||||||
- [#157](https://github.com/xmrig/xmrig/issues/157) [#196](https://github.com/xmrig/xmrig/issues/196) Fixed Linux compile issues.
|
- [#157](https://github.com/xmrig/xmrig/issues/157) [#196](https://github.com/xmrig/xmrig/issues/196) Fixed Linux compile issues.
|
||||||
|
|
|
@ -195,6 +195,7 @@ if (WITH_HTTPD)
|
||||||
message(FATAL_ERROR "microhttpd NOT found: use `-DWITH_HTTPD=OFF` to build without http deamon support")
|
message(FATAL_ERROR "microhttpd NOT found: use `-DWITH_HTTPD=OFF` to build without http deamon support")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
set(MHD_LIBRARY "")
|
||||||
add_definitions(/DXMRIG_NO_HTTPD)
|
add_definitions(/DXMRIG_NO_HTTPD)
|
||||||
add_definitions(/DXMRIG_NO_API)
|
add_definitions(/DXMRIG_NO_API)
|
||||||
endif()
|
endif()
|
||||||
|
|
28
src/App.cpp
28
src/App.cpp
|
@ -113,7 +113,7 @@ App::~App()
|
||||||
int App::exec()
|
int App::exec()
|
||||||
{
|
{
|
||||||
if (!m_options) {
|
if (!m_options) {
|
||||||
return 0;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
uv_signal_start(&m_sigHUP, App::onSignal, SIGHUP);
|
uv_signal_start(&m_sigHUP, App::onSignal, SIGHUP);
|
||||||
|
@ -130,6 +130,13 @@ int App::exec()
|
||||||
Mem::allocate(m_options->algo(), m_options->threads(), m_options->doubleHash(), m_options->hugePages());
|
Mem::allocate(m_options->algo(), m_options->threads(), m_options->doubleHash(), m_options->hugePages());
|
||||||
Summary::print();
|
Summary::print();
|
||||||
|
|
||||||
|
if (m_options->dryRun()) {
|
||||||
|
LOG_NOTICE("OK");
|
||||||
|
release();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
# ifndef XMRIG_NO_API
|
# ifndef XMRIG_NO_API
|
||||||
Api::start();
|
Api::start();
|
||||||
# endif
|
# endif
|
||||||
|
@ -146,12 +153,7 @@ int App::exec()
|
||||||
const int r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
|
const int r = uv_run(uv_default_loop(), UV_RUN_DEFAULT);
|
||||||
uv_loop_close(uv_default_loop());
|
uv_loop_close(uv_default_loop());
|
||||||
|
|
||||||
delete m_network;
|
release();
|
||||||
|
|
||||||
Options::release();
|
|
||||||
Mem::release();
|
|
||||||
Platform::release();
|
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,6 +202,18 @@ void App::close()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void App::release()
|
||||||
|
{
|
||||||
|
if (m_network) {
|
||||||
|
delete m_network;
|
||||||
|
}
|
||||||
|
|
||||||
|
Options::release();
|
||||||
|
Mem::release();
|
||||||
|
Platform::release();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void App::onSignal(uv_signal_t *handle, int signum)
|
void App::onSignal(uv_signal_t *handle, int signum)
|
||||||
{
|
{
|
||||||
switch (signum)
|
switch (signum)
|
||||||
|
|
|
@ -51,6 +51,7 @@ protected:
|
||||||
private:
|
private:
|
||||||
void background();
|
void background();
|
||||||
void close();
|
void close();
|
||||||
|
void release();
|
||||||
|
|
||||||
static void onSignal(uv_signal_t *handle, int signum);
|
static void onSignal(uv_signal_t *handle, int signum);
|
||||||
|
|
||||||
|
|
|
@ -101,12 +101,16 @@ static char const short_options[] = "a:c:khBp:Px:r:R:s:t:T:o:u:O:v:Vl:S";
|
||||||
|
|
||||||
static struct option const options[] = {
|
static struct option const options[] = {
|
||||||
{ "algo", 1, nullptr, 'a' },
|
{ "algo", 1, nullptr, 'a' },
|
||||||
|
{ "api-access-token", 1, nullptr, 4001 },
|
||||||
|
{ "api-port", 1, nullptr, 4000 },
|
||||||
|
{ "api-worker-id", 1, nullptr, 4002 },
|
||||||
{ "av", 1, nullptr, 'v' },
|
{ "av", 1, nullptr, 'v' },
|
||||||
{ "background", 0, nullptr, 'B' },
|
{ "background", 0, nullptr, 'B' },
|
||||||
{ "config", 1, nullptr, 'c' },
|
{ "config", 1, nullptr, 'c' },
|
||||||
{ "cpu-affinity", 1, nullptr, 1020 },
|
{ "cpu-affinity", 1, nullptr, 1020 },
|
||||||
{ "cpu-priority", 1, nullptr, 1021 },
|
{ "cpu-priority", 1, nullptr, 1021 },
|
||||||
{ "donate-level", 1, nullptr, 1003 },
|
{ "donate-level", 1, nullptr, 1003 },
|
||||||
|
{ "dry-run", 0, nullptr, 5000 },
|
||||||
{ "help", 0, nullptr, 'h' },
|
{ "help", 0, nullptr, 'h' },
|
||||||
{ "keepalive", 0, nullptr ,'k' },
|
{ "keepalive", 0, nullptr ,'k' },
|
||||||
{ "log-file", 1, nullptr, 'l' },
|
{ "log-file", 1, nullptr, 'l' },
|
||||||
|
@ -126,9 +130,6 @@ static struct option const options[] = {
|
||||||
{ "user-agent", 1, nullptr, 1008 },
|
{ "user-agent", 1, nullptr, 1008 },
|
||||||
{ "userpass", 1, nullptr, 'O' },
|
{ "userpass", 1, nullptr, 'O' },
|
||||||
{ "version", 0, nullptr, 'V' },
|
{ "version", 0, nullptr, 'V' },
|
||||||
{ "api-port", 1, nullptr, 4000 },
|
|
||||||
{ "api-access-token", 1, nullptr, 4001 },
|
|
||||||
{ "api-worker-id", 1, nullptr, 4002 },
|
|
||||||
{ 0, 0, 0, 0 }
|
{ 0, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -141,6 +142,7 @@ static struct option const config_options[] = {
|
||||||
{ "cpu-affinity", 1, nullptr, 1020 },
|
{ "cpu-affinity", 1, nullptr, 1020 },
|
||||||
{ "cpu-priority", 1, nullptr, 1021 },
|
{ "cpu-priority", 1, nullptr, 1021 },
|
||||||
{ "donate-level", 1, nullptr, 1003 },
|
{ "donate-level", 1, nullptr, 1003 },
|
||||||
|
{ "dry-run", 0, nullptr, 5000 },
|
||||||
{ "huge-pages", 0, nullptr, 1009 },
|
{ "huge-pages", 0, nullptr, 1009 },
|
||||||
{ "log-file", 1, nullptr, 'l' },
|
{ "log-file", 1, nullptr, 'l' },
|
||||||
{ "max-cpu-usage", 1, nullptr, 1004 },
|
{ "max-cpu-usage", 1, nullptr, 1004 },
|
||||||
|
@ -205,6 +207,7 @@ Options::Options(int argc, char **argv) :
|
||||||
m_background(false),
|
m_background(false),
|
||||||
m_colors(true),
|
m_colors(true),
|
||||||
m_doubleHash(false),
|
m_doubleHash(false),
|
||||||
|
m_dryRun(false),
|
||||||
m_hugePages(true),
|
m_hugePages(true),
|
||||||
m_ready(false),
|
m_ready(false),
|
||||||
m_safe(false),
|
m_safe(false),
|
||||||
|
@ -384,6 +387,7 @@ bool Options::parseArg(int key, const char *arg)
|
||||||
case 'S': /* --syslog */
|
case 'S': /* --syslog */
|
||||||
case 1005: /* --safe */
|
case 1005: /* --safe */
|
||||||
case 1006: /* --nicehash */
|
case 1006: /* --nicehash */
|
||||||
|
case 5000: /* --dry-run */
|
||||||
return parseBoolean(key, true);
|
return parseBoolean(key, true);
|
||||||
|
|
||||||
case 1002: /* --no-color */
|
case 1002: /* --no-color */
|
||||||
|
@ -557,6 +561,10 @@ bool Options::parseBoolean(int key, bool enable)
|
||||||
m_colors = enable;
|
m_colors = enable;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 5000: /* --dry-run */
|
||||||
|
m_dryRun = enable;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ public:
|
||||||
inline bool background() const { return m_background; }
|
inline bool background() const { return m_background; }
|
||||||
inline bool colors() const { return m_colors; }
|
inline bool colors() const { return m_colors; }
|
||||||
inline bool doubleHash() const { return m_doubleHash; }
|
inline bool doubleHash() const { return m_doubleHash; }
|
||||||
|
inline bool dryRun() const { return m_dryRun; }
|
||||||
inline bool hugePages() const { return m_hugePages; }
|
inline bool hugePages() const { return m_hugePages; }
|
||||||
inline bool syslog() const { return m_syslog; }
|
inline bool syslog() const { return m_syslog; }
|
||||||
inline const char *apiToken() const { return m_apiToken; }
|
inline const char *apiToken() const { return m_apiToken; }
|
||||||
|
@ -110,6 +111,7 @@ private:
|
||||||
bool m_background;
|
bool m_background;
|
||||||
bool m_colors;
|
bool m_colors;
|
||||||
bool m_doubleHash;
|
bool m_doubleHash;
|
||||||
|
bool m_dryRun;
|
||||||
bool m_hugePages;
|
bool m_hugePages;
|
||||||
bool m_ready;
|
bool m_ready;
|
||||||
bool m_safe;
|
bool m_safe;
|
||||||
|
|
|
@ -91,10 +91,17 @@ alignas(16) const uint8_t saes_sbox[256] = saes_data(saes_h0);
|
||||||
|
|
||||||
static inline __m128i soft_aesenc(__m128i in, __m128i key)
|
static inline __m128i soft_aesenc(__m128i in, __m128i key)
|
||||||
{
|
{
|
||||||
const uint32_t x0 = _mm_cvtsi128_si32(in);
|
#if defined(_MSC_VER)
|
||||||
const uint32_t x1 = _mm_cvtsi128_si32(_mm_shuffle_epi32(in, 0x55));
|
const uint32_t x0 = in.m128i_u32[0];
|
||||||
const uint32_t x2 = _mm_cvtsi128_si32(_mm_shuffle_epi32(in, 0xAA));
|
const uint32_t x1 = in.m128i_u32[1];
|
||||||
const uint32_t x3 = _mm_cvtsi128_si32(_mm_shuffle_epi32(in, 0xFF));
|
const uint32_t x2 = in.m128i_u32[2];
|
||||||
|
const uint32_t x3 = in.m128i_u32[3];
|
||||||
|
#else
|
||||||
|
const uint32_t x0 = _mm_cvtsi128_si32(in);
|
||||||
|
const uint32_t x1 = _mm_cvtsi128_si32(_mm_shuffle_epi32(in, 0x55));
|
||||||
|
const uint32_t x2 = _mm_cvtsi128_si32(_mm_shuffle_epi32(in, 0xAA));
|
||||||
|
const uint32_t x3 = _mm_cvtsi128_si32(_mm_shuffle_epi32(in, 0xFF));
|
||||||
|
#endif
|
||||||
|
|
||||||
__m128i out = _mm_set_epi32(
|
__m128i out = _mm_set_epi32(
|
||||||
(saes_table[0][x3 & 0xff] ^ saes_table[1][(x0 >> 8) & 0xff] ^ saes_table[2][(x1 >> 16) & 0xff] ^ saes_table[3][x2 >> 24]),
|
(saes_table[0][x3 & 0xff] ^ saes_table[1][(x0 >> 8) & 0xff] ^ saes_table[2][(x1 >> 16) & 0xff] ^ saes_table[3][x2 >> 24]),
|
||||||
|
|
Loading…
Reference in a new issue