diff --git a/libstratosphere/source/ams/ams_environment.cpp b/libstratosphere/source/ams/ams_environment.cpp index ce4237f6..04f8f4d1 100644 --- a/libstratosphere/source/ams/ams_environment.cpp +++ b/libstratosphere/source/ams/ams_environment.cpp @@ -74,9 +74,6 @@ namespace ams { ams_ctx.pc = ctx->pc.x; ams_ctx.pstate = ctx->pstate; ams_ctx.afsr0 = static_cast(::ams::exosphere::GetVersion(ATMOSPHERE_RELEASE_VERSION)); - if (svc::IsKernelMesosphere()) { - ams_ctx.afsr0 |= (static_cast('M') << (BITSIZEOF(u32) - BITSIZEOF(u8))); - } ams_ctx.afsr1 = static_cast(hos::GetVersion()); ams_ctx.far = ctx->far.x; ams_ctx.report_identifier = armGetSystemTick(); diff --git a/libstratosphere/source/boot2/boot2_api.cpp b/libstratosphere/source/boot2/boot2_api.cpp index 1605d3e9..3ba67a2a 100644 --- a/libstratosphere/source/boot2/boot2_api.cpp +++ b/libstratosphere/source/boot2/boot2_api.cpp @@ -462,7 +462,7 @@ namespace ams::boot2 { DetectAndDeclareFutureMitms(); /* Device whether to launch tma or htc. */ - if (svc::IsKernelMesosphere() && IsHtcEnabled()) { + if (IsHtcEnabled()) { LaunchProgram(nullptr, ncm::ProgramLocation::Make(ncm::SystemProgramId::Htc, ncm::StorageId::None), 0); LaunchProgram(nullptr, ncm::ProgramLocation::Make(ncm::SystemProgramId::Cs, ncm::StorageId::None), 0); } else { diff --git a/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp b/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp index 28c2f859..80e03c9c 100644 --- a/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp +++ b/libstratosphere/source/erpt/srv/erpt_srv_reporter.cpp @@ -219,10 +219,8 @@ namespace ams::erpt::srv { } void SubmitResourceLimitContexts() { - if (hos::GetVersion() >= hos::Version_11_0_0 || svc::IsKernelMesosphere()) { - SubmitResourceLimitLimitContext(); - SubmitResourceLimitPeakContext(); - } + SubmitResourceLimitLimitContext(); + SubmitResourceLimitPeakContext(); } Result ValidateCreateReportContext(const ContextEntry *ctx) { diff --git a/libstratosphere/source/hos/hos_stratosphere_api.cpp b/libstratosphere/source/hos/hos_stratosphere_api.cpp index 10af44f2..90bf78ca 100644 --- a/libstratosphere/source/hos/hos_stratosphere_api.cpp +++ b/libstratosphere/source/hos/hos_stratosphere_api.cpp @@ -40,6 +40,9 @@ namespace ams::hos { /* Initialize hos::Version API. */ hos::SetVersionForLibnxInternal(); + + /* Check that we're running under mesosphere. */ + AMS_ABORT_UNLESS(svc::IsKernelMesosphere()); } void InitializeForStratosphereDebug(hos::Version debug_version) { @@ -48,6 +51,9 @@ namespace ams::hos { /* Initialize hos::Version API. */ hos::SetVersionForLibnxInternalDebug(debug_version); + + /* Check that we're running under mesosphere. */ + AMS_ABORT_UNLESS(svc::IsKernelMesosphere()); } } diff --git a/libstratosphere/source/os/impl/os_aslr_space_manager_impl.os.horizon.hpp b/libstratosphere/source/os/impl/os_aslr_space_manager_impl.os.horizon.hpp index ca1a7a4c..76bcbd06 100644 --- a/libstratosphere/source/os/impl/os_aslr_space_manager_impl.os.horizon.hpp +++ b/libstratosphere/source/os/impl/os_aslr_space_manager_impl.os.horizon.hpp @@ -56,27 +56,11 @@ namespace ams::os::impl { } static u64 GetAslrSpaceBeginAddress() { - if (hos::GetVersion() >= hos::Version_2_0_0 || svc::IsKernelMesosphere()) { - return GetAslrInfo(svc::InfoType_AslrRegionAddress); - } else { - if (GetHeapSpaceBeginAddress() < AslrBase64BitDeprecated || GetAliasSpaceBeginAddress() < AslrBase64BitDeprecated) { - return AslrBase32Bit; - } else { - return AslrBase64BitDeprecated; - } - } + return GetAslrInfo(svc::InfoType_AslrRegionAddress); } static u64 GetAslrSpaceEndAddress() { - if (hos::GetVersion() >= hos::Version_2_0_0 || svc::IsKernelMesosphere()) { - return GetAslrInfo(svc::InfoType_AslrRegionAddress) + GetAslrInfo(svc::InfoType_AslrRegionSize); - } else { - if (GetHeapSpaceBeginAddress() < AslrBase64BitDeprecated || GetAliasSpaceBeginAddress() < AslrBase64BitDeprecated) { - return AslrBase32Bit + AslrSize32Bit; - } else { - return AslrBase64BitDeprecated + AslrSize64BitDeprecated; - } - } + return GetAslrInfo(svc::InfoType_AslrRegionAddress) + GetAslrInfo(svc::InfoType_AslrRegionSize); } };