mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-18 10:01:06 +00:00
Fixed --randomx-wrmsr option without parameters.
This commit is contained in:
parent
5ab17fcd46
commit
4fb3086c1c
3 changed files with 12 additions and 2 deletions
|
@ -170,6 +170,10 @@ void xmrig::ConfigTransform::transform(rapidjson::Document &doc, int key, const
|
||||||
return set(doc, kRandomX, "1gb-pages", true);
|
return set(doc, kRandomX, "1gb-pages", true);
|
||||||
|
|
||||||
case IConfig::RandomXWrmsrKey: /* --randomx-wrmsr */
|
case IConfig::RandomXWrmsrKey: /* --randomx-wrmsr */
|
||||||
|
if (arg == nullptr) {
|
||||||
|
return set(doc, kRandomX, "wrmsr", true);
|
||||||
|
}
|
||||||
|
|
||||||
return set(doc, kRandomX, "wrmsr", static_cast<int64_t>(strtol(arg, nullptr, 10)));
|
return set(doc, kRandomX, "wrmsr", static_cast<int64_t>(strtol(arg, nullptr, 10)));
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ static const option options[] = {
|
||||||
{ "randomx-mode", 1, nullptr, IConfig::RandomXModeKey },
|
{ "randomx-mode", 1, nullptr, IConfig::RandomXModeKey },
|
||||||
{ "randomx-1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey },
|
{ "randomx-1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey },
|
||||||
{ "1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey },
|
{ "1gb-pages", 0, nullptr, IConfig::RandomX1GbPagesKey },
|
||||||
{ "randomx-wrmsr", 1, nullptr, IConfig::RandomXWrmsrKey },
|
{ "randomx-wrmsr", 2, nullptr, IConfig::RandomXWrmsrKey },
|
||||||
# endif
|
# endif
|
||||||
# ifdef XMRIG_FEATURE_OPENCL
|
# ifdef XMRIG_FEATURE_OPENCL
|
||||||
{ "opencl", 0, nullptr, IConfig::OclKey },
|
{ "opencl", 0, nullptr, IConfig::OclKey },
|
||||||
|
|
|
@ -109,7 +109,13 @@ rapidjson::Value xmrig::RxConfig::toJSON(rapidjson::Document &doc) const
|
||||||
obj.AddMember(StringRef(kInit), m_threads, allocator);
|
obj.AddMember(StringRef(kInit), m_threads, allocator);
|
||||||
obj.AddMember(StringRef(kMode), StringRef(modeName()), allocator);
|
obj.AddMember(StringRef(kMode), StringRef(modeName()), allocator);
|
||||||
obj.AddMember(StringRef(kOneGbPages), m_oneGbPages, allocator);
|
obj.AddMember(StringRef(kOneGbPages), m_oneGbPages, allocator);
|
||||||
obj.AddMember(StringRef(kWrmsr), m_wrmsr < 0 ? Value(kFalseType) : Value(m_wrmsr), allocator);
|
|
||||||
|
if (m_wrmsr < 0 || m_wrmsr == 6) {
|
||||||
|
obj.AddMember(StringRef(kWrmsr), m_wrmsr == 6, allocator);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj.AddMember(StringRef(kWrmsr), m_wrmsr, allocator);
|
||||||
|
}
|
||||||
|
|
||||||
# ifdef XMRIG_FEATURE_HWLOC
|
# ifdef XMRIG_FEATURE_HWLOC
|
||||||
if (!m_nodeset.empty()) {
|
if (!m_nodeset.empty()) {
|
||||||
|
|
Loading…
Reference in a new issue