mirror of
https://github.com/Atmosphere-NX/Atmosphere-libs.git
synced 2025-06-27 21:42:49 +02:00
kern/pm: support for 5.x under mesosphere
This commit is contained in:
parent
8741ee24a0
commit
8836a5385c
@ -294,6 +294,19 @@ namespace ams::kern::svc {
|
|||||||
R_TRY(GetInitialProcessIdRange(out, static_cast<ams::svc::InitialProcessIdRangeInfo>(info_subtype)));
|
R_TRY(GetInitialProcessIdRange(out, static_cast<ams::svc::InitialProcessIdRangeInfo>(info_subtype)));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ams::svc::SystemInfoType_IsMesosphere:
|
||||||
|
{
|
||||||
|
/* Verify the handle is invalid. */
|
||||||
|
R_UNLESS(handle == ams::svc::InvalidHandle, svc::ResultInvalidHandle());
|
||||||
|
|
||||||
|
/* Verify that the sub-type is zero. */
|
||||||
|
R_UNLESS(info_subtype == 0, svc::ResultInvalidCombination());
|
||||||
|
|
||||||
|
/* We don't actually have any data to return. */
|
||||||
|
/* Clear the output. */
|
||||||
|
*out = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return svc::ResultInvalidEnumValue();
|
return svc::ResultInvalidEnumValue();
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,13 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX) && defined(ATMOSPHERE_ARCH_ARM64)
|
#if defined(ATMOSPHERE_BOARD_NINTENDO_NX)
|
||||||
|
|
||||||
namespace ams::svc::aarch64::lp64 {
|
namespace ams::svc {
|
||||||
|
|
||||||
|
#if defined(ATMOSPHERE_ARCH_ARM64)
|
||||||
|
|
||||||
|
namespace aarch64::lp64 {
|
||||||
|
|
||||||
ALWAYS_INLINE Result SetHeapSize(::ams::svc::Address *out_address, ::ams::svc::Size size) {
|
ALWAYS_INLINE Result SetHeapSize(::ams::svc::Address *out_address, ::ams::svc::Size size) {
|
||||||
return ::svcSetHeapSize(reinterpret_cast<void **>(out_address), size);
|
return ::svcSetHeapSize(reinterpret_cast<void **>(out_address), size);
|
||||||
@ -493,3 +497,12 @@ namespace ams::svc::aarch64::lp64 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
ALWAYS_INLINE bool IsKernelMesosphere() {
|
||||||
|
uint64_t dummy;
|
||||||
|
return R_SUCCEEDED(::ams::svc::GetSystemInfo(std::addressof(dummy), ::ams::svc::SystemInfoType_IsMesosphere, ::ams::svc::InvalidHandle, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
@ -173,6 +173,9 @@ namespace ams::svc {
|
|||||||
SystemInfoType_TotalPhysicalMemorySize = 0,
|
SystemInfoType_TotalPhysicalMemorySize = 0,
|
||||||
SystemInfoType_UsedPhysicalMemorySize = 1,
|
SystemInfoType_UsedPhysicalMemorySize = 1,
|
||||||
SystemInfoType_InitialProcessIdRange = 2,
|
SystemInfoType_InitialProcessIdRange = 2,
|
||||||
|
|
||||||
|
/* NOTE: This is potentially temporary, and highly subject to change. */
|
||||||
|
SystemInfoType_IsMesosphere = 0xF0000000,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum InitialProcessIdRangeInfo : u64 {
|
enum InitialProcessIdRangeInfo : u64 {
|
||||||
|
Loading…
Reference in New Issue
Block a user