aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-27 12:20:28 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-27 12:20:28 -0400
commit4441d54b2aa5a3efc2caabed6e40fd40d626d9ae (patch)
tree7b5604a736af1544bbd80f0c54a90dd967927716
parentad38a7d9f0a370fde7bc616ca191ca7894ede4f5 (diff)
kernel: stub Switch 2 svcGetInfo ids 29, 30 and 33
nnosInitialize queries ids 29/30 between the alias (2/3) and ASLR (12/13) regions and aborts if they fail; report an empty region after the alias region. VammManager::Initialize (enabled when the system resource size is non-zero) queries id 33 and passes it to MapPhysicalMemory as a size, so return 2 MiB. Both are logged as stubs; the real meanings are unknown.
-rw-r--r--src/core/hle/kernel/svc/svc_info.cpp19
-rw-r--r--src/core/hle/kernel/svc_types.h7
2 files changed, 26 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc/svc_info.cpp b/src/core/hle/kernel/svc/svc_info.cpp
index 863bb58fa8..aec31ca148 100644
--- a/src/core/hle/kernel/svc/svc_info.cpp
+++ b/src/core/hle/kernel/svc/svc_info.cpp
@@ -40,6 +40,9 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle
case InfoType::UsedNonSystemMemorySize:
case InfoType::IsApplication:
case InfoType::FreeThreadCount:
+ case InfoType::Nx2RegionAddress:
+ case InfoType::Nx2RegionSize:
+ case InfoType::Nx2VammSize:
case InfoType::AliasRegionExtraSize: {
R_UNLESS(info_sub_id == 0, ResultInvalidEnumValue);
@@ -66,6 +69,22 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle
case InfoType::HeapRegionSize:
*result = process->GetPageTable().GetHeapRegionSize();
R_SUCCEED();
+ case InfoType::Nx2RegionAddress:
+ // Unknown Switch 2 region; report an empty one just past the alias region.
+ *result = GetInteger(process->GetPageTable().GetAliasRegionStart()) +
+ process->GetPageTable().GetAliasRegionSize();
+ LOG_WARNING(Kernel_SVC, "(STUBBED) Switch 2 InfoType 29, returning {:#x}", *result);
+ R_SUCCEED();
+ case InfoType::Nx2RegionSize:
+ LOG_WARNING(Kernel_SVC, "(STUBBED) Switch 2 InfoType 30, returning 0");
+ *result = 0;
+ R_SUCCEED();
+ case InfoType::Nx2VammSize:
+ // Used as the size of VAMM's initial MapPhysicalMemory, so it must be non-zero.
+ // The real value is unknown; 2 MiB is the smallest size that keeps it block-aligned.
+ *result = 0x200000;
+ LOG_WARNING(Kernel_SVC, "(STUBBED) Switch 2 InfoType 33, returning {:#x}", *result);
+ R_SUCCEED();
case InfoType::AslrRegionAddress:
*result = GetInteger(process->GetPageTable().GetAliasCodeRegionStart());
R_SUCCEED();
diff --git a/src/core/hle/kernel/svc_types.h b/src/core/hle/kernel/svc_types.h
index b0f4796da4..4734522b35 100644
--- a/src/core/hle/kernel/svc_types.h
+++ b/src/core/hle/kernel/svc_types.h
@@ -157,6 +157,13 @@ enum class InfoType : u32 {
IsSvcPermitted = 26,
IoRegionHint = 27,
AliasRegionExtraSize = 28,
+ // Switch 2 kernels: address/size of a region the SDK queries between the alias and
+ // ASLR regions during nnosInitialize. Meaning not known yet.
+ Nx2RegionAddress = 29,
+ Nx2RegionSize = 30,
+ // Switch 2 kernels: queried by nn::os::detail::VammManager::Initialize and used as the size
+ // of its first MapPhysicalMemory. Meaning not known yet.
+ Nx2VammSize = 33,
TransferMemoryHint = 34,