mirror of
https://github.com/Atmosphere-NX/Atmosphere-libs.git
synced 2025-07-01 07:12:14 +02:00
Add RCM bug detection util
This commit is contained in:
parent
37b74c7d75
commit
b6ca2d89ae
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <switch.h>
|
#include <switch.h>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
static inline void RebootToRcm() {
|
static inline void RebootToRcm() {
|
||||||
SecmonArgs args = {0};
|
SecmonArgs args = {0};
|
||||||
@ -79,3 +80,20 @@ static inline Result SmcGetConfig(SplConfigItem config_item, u64 *out_config) {
|
|||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline Result GetRcmBugPatched(bool *out) {
|
||||||
|
u64 tmp = 0;
|
||||||
|
Result rc = SmcGetConfig((SplConfigItem)65004, &tmp);
|
||||||
|
if (R_SUCCEEDED(rc)) {
|
||||||
|
*out = (tmp != 0);
|
||||||
|
}
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline bool IsRcmBugPatched() {
|
||||||
|
bool rcm_bug_patched;
|
||||||
|
if (R_FAILED(GetRcmBugPatched(&rcm_bug_patched))) {
|
||||||
|
std::abort();
|
||||||
|
}
|
||||||
|
return rcm_bug_patched;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user