ams: revamp assertion system
This commit is contained in:
@@ -84,8 +84,6 @@ namespace ams::cfg {
|
||||
.override_any_app = true,
|
||||
};
|
||||
|
||||
bool g_loaded_override_config = false;
|
||||
|
||||
char g_hbl_sd_path[0x100] = "/atmosphere/hbl.nsp";
|
||||
|
||||
/* Helpers. */
|
||||
|
||||
@@ -35,12 +35,12 @@ namespace ams::cfg {
|
||||
os::ProcessId min = os::InvalidProcessId, max = os::InvalidProcessId;
|
||||
if (hos::GetVersion() >= hos::Version_500) {
|
||||
/* On 5.0.0+, we can get precise limits from svcGetSystemInfo. */
|
||||
R_ASSERT(svcGetSystemInfo(reinterpret_cast<u64 *>(&min), SystemInfoType_InitialProcessIdRange, INVALID_HANDLE, InitialProcessIdRangeInfo_Minimum));
|
||||
R_ASSERT(svcGetSystemInfo(reinterpret_cast<u64 *>(&max), SystemInfoType_InitialProcessIdRange, INVALID_HANDLE, InitialProcessIdRangeInfo_Maximum));
|
||||
R_ABORT_UNLESS(svcGetSystemInfo(reinterpret_cast<u64 *>(&min), SystemInfoType_InitialProcessIdRange, INVALID_HANDLE, InitialProcessIdRangeInfo_Minimum));
|
||||
R_ABORT_UNLESS(svcGetSystemInfo(reinterpret_cast<u64 *>(&max), SystemInfoType_InitialProcessIdRange, INVALID_HANDLE, InitialProcessIdRangeInfo_Maximum));
|
||||
} else if (hos::GetVersion() >= hos::Version_400) {
|
||||
/* On 4.0.0-4.1.0, we can get the precise limits from normal svcGetInfo. */
|
||||
R_ASSERT(svcGetInfo(reinterpret_cast<u64 *>(&min), InfoType_InitialProcessIdRange, INVALID_HANDLE, InitialProcessIdRangeInfo_Minimum));
|
||||
R_ASSERT(svcGetInfo(reinterpret_cast<u64 *>(&max), InfoType_InitialProcessIdRange, INVALID_HANDLE, InitialProcessIdRangeInfo_Maximum));
|
||||
R_ABORT_UNLESS(svcGetInfo(reinterpret_cast<u64 *>(&min), InfoType_InitialProcessIdRange, INVALID_HANDLE, InitialProcessIdRangeInfo_Minimum));
|
||||
R_ABORT_UNLESS(svcGetInfo(reinterpret_cast<u64 *>(&max), InfoType_InitialProcessIdRange, INVALID_HANDLE, InitialProcessIdRangeInfo_Maximum));
|
||||
} else {
|
||||
/* On < 4.0.0, we just use hardcoded extents. */
|
||||
min = InitialProcessIdMinDeprecated;
|
||||
|
||||
@@ -49,20 +49,20 @@ namespace ams::cfg {
|
||||
|
||||
void WaitSdCardServicesReadyImpl() {
|
||||
for (size_t i = 0; i < NumRequiredServicesForSdCardAccess; i++) {
|
||||
R_ASSERT(sm::WaitService(RequiredServicesForSdCardAccess[i]));
|
||||
R_ABORT_UNLESS(sm::WaitService(RequiredServicesForSdCardAccess[i]));
|
||||
}
|
||||
}
|
||||
|
||||
Result TryInitializeSdCard() {
|
||||
R_TRY(CheckSdCardServicesReady());
|
||||
R_ASSERT(fsOpenSdCardFileSystem(&g_sd_card_filesystem));
|
||||
R_ABORT_UNLESS(fsOpenSdCardFileSystem(&g_sd_card_filesystem));
|
||||
g_sd_card_initialized = true;
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
void InitializeSdCard() {
|
||||
WaitSdCardServicesReadyImpl();
|
||||
R_ASSERT(fsOpenSdCardFileSystem(&g_sd_card_filesystem));
|
||||
R_ABORT_UNLESS(fsOpenSdCardFileSystem(&g_sd_card_filesystem));
|
||||
g_sd_card_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user