hos::Version: rename enum members
This commit is contained in:
@@ -308,7 +308,7 @@ namespace ams::boot2 {
|
||||
|
||||
/* Wait for other atmosphere mitm modules to initialize. */
|
||||
R_ABORT_UNLESS(sm::mitm::WaitMitm(sm::ServiceName::Encode("set:sys")));
|
||||
if (hos::GetVersion() >= hos::Version_200) {
|
||||
if (hos::GetVersion() >= hos::Version_2_0_0) {
|
||||
R_ABORT_UNLESS(sm::mitm::WaitMitm(sm::ServiceName::Encode("bpc")));
|
||||
} else {
|
||||
R_ABORT_UNLESS(sm::mitm::WaitMitm(sm::ServiceName::Encode("bpc:c")));
|
||||
@@ -337,7 +337,7 @@ namespace ams::boot2 {
|
||||
if (maintenance) {
|
||||
LaunchList(AdditionalMaintenanceLaunchPrograms, NumAdditionalMaintenanceLaunchPrograms);
|
||||
/* Starting in 7.0.0, npns is launched during maintenance boot. */
|
||||
if (hos::GetVersion() >= hos::Version_700) {
|
||||
if (hos::GetVersion() >= hos::Version_7_0_0) {
|
||||
LaunchProgram(nullptr, ncm::ProgramLocation::Make(ncm::SystemProgramId::Npns, ncm::StorageId::BuiltInSystem), 0);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace ams::cfg {
|
||||
/* SD card helpers. */
|
||||
void GetPrivilegedProcessIdRange(os::ProcessId *out_min, os::ProcessId *out_max) {
|
||||
os::ProcessId min = os::InvalidProcessId, max = os::InvalidProcessId;
|
||||
if (hos::GetVersion() >= hos::Version_500) {
|
||||
if (hos::GetVersion() >= hos::Version_5_0_0) {
|
||||
/* On 5.0.0+, we can get precise limits from svcGetSystemInfo. */
|
||||
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) {
|
||||
} else if (hos::GetVersion() >= hos::Version_4_0_0) {
|
||||
/* On 4.0.0-4.1.0, we can get the precise limits from normal svcGetInfo. */
|
||||
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));
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace ams::erpt::srv {
|
||||
R_TRY(fs::GetSaveDataAvailableSize(std::addressof(cur_savedata_size), SystemSaveDataId));
|
||||
|
||||
if (cur_journal_size < SystemSaveDataJournalSize || cur_savedata_size < SystemSaveDataSize) {
|
||||
if (hos::GetVersion() >= hos::Version_300) {
|
||||
if (hos::GetVersion() >= hos::Version_3_0_0) {
|
||||
R_TRY(fs::ExtendSaveData(fs::SaveDataSpaceId::System, SystemSaveDataId, SystemSaveDataSize, SystemSaveDataJournalSize));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace ams::erpt::srv {
|
||||
|
||||
Result Reporter::CollectUniqueReportFields() {
|
||||
this->occurrence_tick = os::GetSystemTick();
|
||||
if (hos::GetVersion() >= hos::Version_300) {
|
||||
if (hos::GetVersion() >= hos::Version_3_0_0) {
|
||||
this->steady_clock_internal_offset_seconds = time::GetStandardSteadyClockInternalOffset().GetSeconds();
|
||||
} else {
|
||||
this->steady_clock_internal_offset_seconds = 0;
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace ams::fs {
|
||||
bool IsSignedSystemPartitionOnSdCardValidDeprecated() {
|
||||
/* Ensure we only call with correct version. */
|
||||
auto version = hos::GetVersion();
|
||||
AMS_ABORT_UNLESS(hos::Version_400 <= version && version < hos::Version_800);
|
||||
AMS_ABORT_UNLESS(hos::Version_4_0_0 <= version && version < hos::Version_8_0_0);
|
||||
|
||||
/* Check that the partition is valid. */
|
||||
bool is_valid;
|
||||
|
||||
@@ -37,37 +37,37 @@ namespace ams::hos {
|
||||
|
||||
switch (exosphere::GetApiInfo().GetTargetFirmware()) {
|
||||
case exosphere::TargetFirmware_100:
|
||||
g_hos_version = hos::Version_100;
|
||||
g_hos_version = hos::Version_1_0_0;
|
||||
break;
|
||||
case exosphere::TargetFirmware_200:
|
||||
g_hos_version = hos::Version_200;
|
||||
g_hos_version = hos::Version_2_0_0;
|
||||
break;
|
||||
case exosphere::TargetFirmware_300:
|
||||
g_hos_version = hos::Version_300;
|
||||
g_hos_version = hos::Version_3_0_0;
|
||||
break;
|
||||
case exosphere::TargetFirmware_400:
|
||||
g_hos_version = hos::Version_400;
|
||||
g_hos_version = hos::Version_4_0_0;
|
||||
break;
|
||||
case exosphere::TargetFirmware_500:
|
||||
g_hos_version = hos::Version_500;
|
||||
g_hos_version = hos::Version_5_0_0;
|
||||
break;
|
||||
case exosphere::TargetFirmware_600:
|
||||
case exosphere::TargetFirmware_620:
|
||||
g_hos_version = hos::Version_600;
|
||||
g_hos_version = hos::Version_6_0_0;
|
||||
break;
|
||||
case exosphere::TargetFirmware_700:
|
||||
g_hos_version = hos::Version_700;
|
||||
g_hos_version = hos::Version_7_0_0;
|
||||
break;
|
||||
case exosphere::TargetFirmware_800:
|
||||
g_hos_version = hos::Version_800;
|
||||
g_hos_version = hos::Version_8_0_0;
|
||||
break;
|
||||
case exosphere::TargetFirmware_810:
|
||||
g_hos_version = hos::Version_810;
|
||||
g_hos_version = hos::Version_8_1_0;
|
||||
break;
|
||||
case exosphere::TargetFirmware_900:
|
||||
g_hos_version = hos::Version_900;
|
||||
g_hos_version = hos::Version_9_0_0;
|
||||
case exosphere::TargetFirmware_910:
|
||||
g_hos_version = hos::Version_910;
|
||||
g_hos_version = hos::Version_9_1_0;
|
||||
break;
|
||||
AMS_UNREACHABLE_DEFAULT_CASE();
|
||||
}
|
||||
@@ -85,56 +85,56 @@ namespace ams::hos {
|
||||
void SetVersionForLibnx() {
|
||||
u32 major = 0, minor = 0, micro = 0;
|
||||
switch (hos::GetVersion()) {
|
||||
case hos::Version_100:
|
||||
case hos::Version_1_0_0:
|
||||
major = 1;
|
||||
minor = 0;
|
||||
micro = 0;
|
||||
break;
|
||||
case hos::Version_200:
|
||||
case hos::Version_2_0_0:
|
||||
major = 2;
|
||||
minor = 0;
|
||||
micro = 0;
|
||||
break;
|
||||
case hos::Version_300:
|
||||
case hos::Version_3_0_0:
|
||||
major = 3;
|
||||
minor = 0;
|
||||
micro = 0;
|
||||
break;
|
||||
case hos::Version_400:
|
||||
case hos::Version_4_0_0:
|
||||
major = 4;
|
||||
minor = 0;
|
||||
micro = 0;
|
||||
break;
|
||||
case hos::Version_500:
|
||||
case hos::Version_5_0_0:
|
||||
major = 5;
|
||||
minor = 0;
|
||||
micro = 0;
|
||||
break;
|
||||
case hos::Version_600:
|
||||
case hos::Version_6_0_0:
|
||||
major = 6;
|
||||
minor = 0;
|
||||
micro = 0;
|
||||
break;
|
||||
case hos::Version_700:
|
||||
case hos::Version_7_0_0:
|
||||
major = 7;
|
||||
minor = 0;
|
||||
micro = 0;
|
||||
break;
|
||||
case hos::Version_800:
|
||||
case hos::Version_8_0_0:
|
||||
major = 8;
|
||||
minor = 0;
|
||||
micro = 0;
|
||||
break;
|
||||
case hos::Version_810:
|
||||
case hos::Version_8_1_0:
|
||||
major = 8;
|
||||
minor = 1;
|
||||
micro = 0;
|
||||
break;
|
||||
case hos::Version_900:
|
||||
case hos::Version_9_0_0:
|
||||
major = 9;
|
||||
minor = 0;
|
||||
micro = 0;
|
||||
case hos::Version_910:
|
||||
case hos::Version_9_1_0:
|
||||
major = 9;
|
||||
minor = 1;
|
||||
micro = 0;
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace ams::lr {
|
||||
/* Storage for RegisteredData entries by data id. */
|
||||
RegisteredStorages<ncm::DataId, 0x800> registered_storages;
|
||||
public:
|
||||
AddOnContentLocationResolverImpl() : registered_storages(hos::GetVersion() < hos::Version_900 ? 0x800 : 0x2) { /* ... */ }
|
||||
AddOnContentLocationResolverImpl() : registered_storages(hos::GetVersion() < hos::Version_9_0_0 ? 0x800 : 0x2) { /* ... */ }
|
||||
|
||||
/* Actual commands. */
|
||||
virtual Result ResolveAddOnContentPath(sf::Out<Path> out, ncm::DataId id) override;
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace ams::lr {
|
||||
|
||||
Result RegisteredLocationResolverImpl::RefreshImpl(const ncm::ProgramId *excluding_ids, size_t num_ids) {
|
||||
/* On < 9.0.0, exclusion lists were not supported yet, so simply clear and return. */
|
||||
if (hos::GetVersion() < hos::Version_900) {
|
||||
if (hos::GetVersion() < hos::Version_9_0_0) {
|
||||
this->ClearRedirections();
|
||||
return ResultSuccess();
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace ams::lr {
|
||||
static_assert(MaxRegisteredLocations >= MaxRegisteredLocationsDeprecated);
|
||||
private:
|
||||
static ALWAYS_INLINE size_t GetMaxRegisteredLocations() {
|
||||
if (hos::GetVersion() >= hos::Version_900) {
|
||||
if (hos::GetVersion() >= hos::Version_9_0_0) {
|
||||
return MaxRegisteredLocations;
|
||||
} else {
|
||||
return MaxRegisteredLocationsDeprecated;
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace ams::map {
|
||||
R_TRY(svcGetInfo(&out->heap_size, InfoType_HeapRegionSize, process_h, 0));
|
||||
R_TRY(svcGetInfo(&out->alias_base, InfoType_AliasRegionAddress, process_h, 0));
|
||||
R_TRY(svcGetInfo(&out->alias_size, InfoType_AliasRegionSize, process_h, 0));
|
||||
if (hos::GetVersion() >= hos::Version_200) {
|
||||
if (hos::GetVersion() >= hos::Version_2_0_0) {
|
||||
R_TRY(svcGetInfo(&out->aslr_base, InfoType_AslrRegionAddress, process_h, 0));
|
||||
R_TRY(svcGetInfo(&out->aslr_size, InfoType_AslrRegionSize, process_h, 0));
|
||||
} else {
|
||||
@@ -184,7 +184,7 @@ namespace ams::map {
|
||||
}
|
||||
|
||||
Result LocateMappableSpace(uintptr_t *out_address, size_t size) {
|
||||
if (hos::GetVersion() >= hos::Version_200) {
|
||||
if (hos::GetVersion() >= hos::Version_2_0_0) {
|
||||
return LocateMappableSpaceModern(out_address, size);
|
||||
} else {
|
||||
return LocateMappableSpaceDeprecated(out_address, size);
|
||||
@@ -192,7 +192,7 @@ namespace ams::map {
|
||||
}
|
||||
|
||||
Result MapCodeMemoryInProcess(MappedCodeMemory &out_mcm, Handle process_handle, uintptr_t base_address, size_t size) {
|
||||
if (hos::GetVersion() >= hos::Version_200) {
|
||||
if (hos::GetVersion() >= hos::Version_2_0_0) {
|
||||
return MapCodeMemoryInProcessModern(out_mcm, process_handle, base_address, size);
|
||||
} else {
|
||||
return MapCodeMemoryInProcessDeprecated(out_mcm, process_handle, base_address, size);
|
||||
|
||||
@@ -101,12 +101,12 @@ namespace ams::ncm {
|
||||
|
||||
/* Deprecated API. */
|
||||
Result CloseContentStorageForcibly(StorageId storage_id) {
|
||||
AMS_ABORT_UNLESS(hos::GetVersion() == hos::Version_100);
|
||||
AMS_ABORT_UNLESS(hos::GetVersion() == hos::Version_1_0_0);
|
||||
return g_content_manager->CloseContentStorageForcibly(storage_id);
|
||||
}
|
||||
|
||||
Result CloseContentMetaDatabaseForcibly(StorageId storage_id) {
|
||||
AMS_ABORT_UNLESS(hos::GetVersion() == hos::Version_100);
|
||||
AMS_ABORT_UNLESS(hos::GetVersion() == hos::Version_1_0_0);
|
||||
return g_content_manager->CloseContentMetaDatabaseForcibly(storage_id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,11 +113,11 @@ namespace ams::ncm {
|
||||
|
||||
ALWAYS_INLINE bool IsSignedSystemPartitionOnSdCardValid(const char *bis_mount_name) {
|
||||
/* Signed system partition should never be checked on < 4.0.0, as it did not exist before then. */
|
||||
AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_400);
|
||||
AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_4_0_0);
|
||||
|
||||
/* If we're importing from system on SD, make sure that the signed system partition is valid. */
|
||||
const auto version = hos::GetVersion();
|
||||
if (version >= hos::Version_800) {
|
||||
if (version >= hos::Version_8_0_0) {
|
||||
/* On >= 8.0.0, a simpler method was added to check validity. */
|
||||
/* This also works on < 4.0.0 (though the system partition will never be on-sd there), */
|
||||
/* and so this will always return false. */
|
||||
@@ -156,7 +156,7 @@ namespace ams::ncm {
|
||||
R_CATCH(fs::ResultTargetNotFound) {
|
||||
/* On 1.0.0, not all flags existed. Mask when appropriate. */
|
||||
constexpr u32 SaveDataFlags100Mask = fs::SaveDataFlags_KeepAfterResettingSystemSaveData;
|
||||
const u32 flags = (hos::GetVersion() >= hos::Version_200) ? (info.flags) : (info.flags & SaveDataFlags100Mask);
|
||||
const u32 flags = (hos::GetVersion() >= hos::Version_2_0_0) ? (info.flags) : (info.flags & SaveDataFlags100Mask);
|
||||
R_TRY(fs::CreateSystemSaveData(info.space_id, info.id, OwnerId, info.size, info.journal_size, flags));
|
||||
R_TRY(fs::MountSystemSaveData(mount_name, info.space_id, info.id));
|
||||
}
|
||||
@@ -275,7 +275,7 @@ namespace ams::ncm {
|
||||
}
|
||||
|
||||
Result ContentManagerImpl::BuildContentMetaDatabase(StorageId storage_id) {
|
||||
if (hos::GetVersion() <= hos::Version_400) {
|
||||
if (hos::GetVersion() <= hos::Version_4_0_0) {
|
||||
/* Temporarily activate the database. */
|
||||
R_TRY(this->ActivateContentMetaDatabase(storage_id));
|
||||
ON_SCOPE_EXIT { this->InactivateContentMetaDatabase(storage_id); };
|
||||
@@ -357,7 +357,7 @@ namespace ams::ncm {
|
||||
/* Ensure correct flags on the BuiltInSystem save data. */
|
||||
/* NOTE: Nintendo does not check this succeeds, and it does on older system versions. */
|
||||
/* We will not check the error, either, even though this kind of defeats the call's purpose. */
|
||||
if (hos::GetVersion() >= hos::Version_200) {
|
||||
if (hos::GetVersion() >= hos::Version_2_0_0) {
|
||||
EnsureBuiltInSystemSaveDataFlags();
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ namespace ams::ncm {
|
||||
ContentStorageRoot *root;
|
||||
R_TRY(this->GetContentStorageRoot(std::addressof(root), storage_id));
|
||||
|
||||
if (hos::GetVersion() >= hos::Version_200) {
|
||||
if (hos::GetVersion() >= hos::Version_2_0_0) {
|
||||
/* Obtain the content storage if already active. */
|
||||
R_UNLESS(root->content_storage, GetContentStorageNotActiveResult(storage_id));
|
||||
} else {
|
||||
@@ -493,7 +493,7 @@ namespace ams::ncm {
|
||||
ContentMetaDatabaseRoot *root;
|
||||
R_TRY(this->GetContentMetaDatabaseRoot(&root, storage_id));
|
||||
|
||||
if (hos::GetVersion() >= hos::Version_200) {
|
||||
if (hos::GetVersion() >= hos::Version_2_0_0) {
|
||||
/* Obtain the content meta database if already active. */
|
||||
R_UNLESS(root->content_meta_database, GetContentMetaDatabaseNotActiveResult(storage_id));
|
||||
} else {
|
||||
|
||||
@@ -425,7 +425,7 @@ namespace ams::ncm {
|
||||
break;
|
||||
case ContentMetaType::Application:
|
||||
/* As of 9.0.0, applications can be dependent on a specific base application version. */
|
||||
AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_900);
|
||||
AMS_ABORT_UNLESS(hos::GetVersion() >= hos::Version_9_0_0);
|
||||
required_version = reader.GetExtendedHeader<ApplicationMetaExtendedHeader>()->required_application_version;
|
||||
break;
|
||||
AMS_UNREACHABLE_DEFAULT_CASE();
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace ams::ncm {
|
||||
R_SUCCEED_IF(max_level <= 0);
|
||||
|
||||
/* On 1.0.0, NotRequireFileSize was not a valid open mode. */
|
||||
const auto open_dir_mode = hos::GetVersion() >= hos::Version_200 ? (fs::OpenDirectoryMode_All | fs::OpenDirectoryMode_NotRequireFileSize) : (fs::OpenDirectoryMode_All);
|
||||
const auto open_dir_mode = hos::GetVersion() >= hos::Version_2_0_0 ? (fs::OpenDirectoryMode_All | fs::OpenDirectoryMode_NotRequireFileSize) : (fs::OpenDirectoryMode_All);
|
||||
|
||||
/* Retry traversal upon request. */
|
||||
bool retry_dir_read = true;
|
||||
@@ -153,7 +153,7 @@ namespace ams::ncm {
|
||||
}
|
||||
|
||||
Result CleanDirectoryRecursively(const PathString &path) {
|
||||
if (hos::GetVersion() >= hos::Version_300) {
|
||||
if (hos::GetVersion() >= hos::Version_3_0_0) {
|
||||
R_TRY(fs::CleanDirectoryRecursively(path));
|
||||
} else {
|
||||
/* CleanDirectoryRecursively didn't exist on < 3.0.0, so we will polyfill it. */
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace ams::ncm {
|
||||
}
|
||||
|
||||
static Result GetRightsId(ncm::RightsId *out_rights_id, const Path &path) {
|
||||
if (hos::GetVersion() >= hos::Version_300) {
|
||||
if (hos::GetVersion() >= hos::Version_3_0_0) {
|
||||
R_TRY(fs::GetRightsId(std::addressof(out_rights_id->id), std::addressof(out_rights_id->key_generation), path.str));
|
||||
} else {
|
||||
R_TRY(fs::GetRightsId(std::addressof(out_rights_id->id), path.str));
|
||||
|
||||
@@ -129,7 +129,7 @@ namespace ams::os::impl {
|
||||
}
|
||||
|
||||
void ThreadManagerHorizonImpl::YieldThread() {
|
||||
if (hos::GetVersion() >= hos::Version_400) {
|
||||
if (hos::GetVersion() >= hos::Version_4_0_0) {
|
||||
svc::SleepThread(svc::YieldType_WithCoreMigration);
|
||||
} else {
|
||||
svc::SleepThread(svc::YieldType_WithoutCoreMigration);
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace ams::psc {
|
||||
R_ABORT_UNLESS(res);
|
||||
R_UNLESS(this->initialized, psc::ResultNotInitialized());
|
||||
|
||||
if (hos::GetVersion() >= hos::Version_600) {
|
||||
if (hos::GetVersion() >= hos::Version_6_0_0) {
|
||||
return this->intf->AcknowledgeEx(state);
|
||||
} else {
|
||||
return this->intf->Acknowledge();
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace ams::sf::cmif {
|
||||
Result impl::ServiceDispatchTableBase::ProcessMessageImpl(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data, const ServiceCommandMeta *entries, const size_t entry_count) const {
|
||||
/* Get versioning info. */
|
||||
const auto hos_version = hos::GetVersion();
|
||||
const u32 max_cmif_version = hos_version >= hos::Version_500 ? 1 : 0;
|
||||
const u32 max_cmif_version = hos_version >= hos::Version_5_0_0 ? 1 : 0;
|
||||
|
||||
/* Parse the CMIF in header. */
|
||||
const CmifInHeader *in_header = reinterpret_cast<const CmifInHeader *>(in_raw_data.GetPointer());
|
||||
@@ -60,7 +60,7 @@ namespace ams::sf::cmif {
|
||||
Result impl::ServiceDispatchTableBase::ProcessMessageForMitmImpl(ServiceDispatchContext &ctx, const cmif::PointerAndSize &in_raw_data, const ServiceCommandMeta *entries, const size_t entry_count) const {
|
||||
/* Get versioning info. */
|
||||
const auto hos_version = hos::GetVersion();
|
||||
const u32 max_cmif_version = hos_version >= hos::Version_500 ? 1 : 0;
|
||||
const u32 max_cmif_version = hos_version >= hos::Version_5_0_0 ? 1 : 0;
|
||||
|
||||
/* Parse the CMIF in header. */
|
||||
const CmifInHeader *in_header = reinterpret_cast<const CmifInHeader *>(in_raw_data.GetPointer());
|
||||
|
||||
Reference in New Issue
Block a user