PRODINFO: Revamp blanking/write disallow policy. (#913)
* exo/fusee: hookup new prodinfo settings * fusee: new scheme doesn't need FLAGS_DEFAULT * fusee: fix c/p errors * ams.mitm: completely revamp prodinfo backup mechanism * ams.mitm: Implement revamped blanking/write policy * strat: make early boot more debuggable * exo: condense flag logic
This commit is contained in:
@@ -51,19 +51,32 @@ namespace ams::exosphere {
|
||||
|
||||
namespace {
|
||||
|
||||
inline Result GetRcmBugPatched(bool *out) {
|
||||
u64 tmp = 0;
|
||||
R_TRY(spl::smc::ConvertResult(spl::smc::GetConfig(&tmp, 1, SplConfigItem_ExosphereHasRcmBugPatch)));
|
||||
*out = (tmp != 0);
|
||||
return ResultSuccess();
|
||||
inline u64 GetU64ConfigItem(spl::ConfigItem cfg) {
|
||||
u64 tmp;
|
||||
R_ABORT_UNLESS(spl::smc::ConvertResult(spl::smc::GetConfig(std::addressof(tmp), 1, static_cast<::SplConfigItem>(cfg))));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
inline bool GetBooleanConfigItem(spl::ConfigItem cfg) {
|
||||
return GetU64ConfigItem(cfg) != 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
bool IsRcmBugPatched() {
|
||||
bool rcm_bug_patched;
|
||||
R_ABORT_UNLESS(GetRcmBugPatched(&rcm_bug_patched));
|
||||
return rcm_bug_patched;
|
||||
return GetBooleanConfigItem(spl::ConfigItem::ExosphereHasRcmBugPatch);
|
||||
}
|
||||
|
||||
bool ShouldBlankProdInfo() {
|
||||
return GetBooleanConfigItem(spl::ConfigItem::ExosphereBlankProdInfo);
|
||||
}
|
||||
|
||||
bool ShouldAllowWritesToProdInfo() {
|
||||
return GetBooleanConfigItem(spl::ConfigItem::ExosphereAllowCalWrites);
|
||||
}
|
||||
|
||||
u64 GetDeviceId() {
|
||||
return GetU64ConfigItem(spl::ConfigItem::DeviceId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user