kern: add version bounds checking

This commit is contained in:
Michael Scire 2020-08-18 04:03:01 -07:00 committed by SciresM
parent 56ec55f3c4
commit 47f2e93a42
5 changed files with 79 additions and 4 deletions

View file

@ -354,6 +354,10 @@ namespace ams::kern {
constexpr bool CanForceDebug() const {
return this->debug_capabilities.Get<DebugFlags::ForceDebug>();
}
constexpr u32 GetIntendedKernelMajorVersion() const { return this->intended_kernel_version.Get<KernelVersion::MajorVersion>(); }
constexpr u32 GetIntendedKernelMinorVersion() const { return this->intended_kernel_version.Get<KernelVersion::MinorVersion>(); }
constexpr u32 GetIntendedKernelVersion() const { return ams::svc::EncodeKernelVersion(this->GetIntendedKernelMajorVersion(), this->GetIntendedKernelMinorVersion()); }
};
}