From 7ad20154fc9bf1094f78721fed13fac1436bef17 Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 10 Jan 2018 00:58:25 -0500 Subject: Threads: Added enum values for the Switch's 4 cpu cores and implemented svcGetInfo(AllowedCpuIdBitmask) --- src/core/hle/kernel/svc.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/core/hle/kernel/svc.cpp') diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index bfe1907e3..a1eaab649 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -296,8 +296,14 @@ static ResultCode GetInfo(u64* result, u64 info_id, u64 handle, u64 info_sub_id) LOG_TRACE(Kernel_SVC, "called info_id=0x%X, info_sub_id=0x%X, handle=0x%08X", info_id, info_sub_id, handle); + ASSERT(handle == 0 || handle == CurrentProcess); + auto& vm_manager = g_current_process->vm_manager; + switch (static_cast(info_id)) { + case GetInfoType::AllowedCpuIdBitmask: + *result = g_current_process->allowed_processor_mask; + break; case GetInfoType::TotalMemoryUsage: *result = vm_manager.GetTotalMemoryUsage(); break; @@ -455,16 +461,15 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V switch (processor_id) { case THREADPROCESSORID_0: break; - case THREADPROCESSORID_ALL: - LOG_INFO(Kernel_SVC, - "Newly created thread is allowed to be run in any Core, unimplemented."); - break; case THREADPROCESSORID_1: + case THREADPROCESSORID_2: + case THREADPROCESSORID_3: + // TODO(bunnei): Implement support for other processor IDs LOG_ERROR(Kernel_SVC, - "Newly created thread must run in the SysCore (Core1), unimplemented."); + "Newly created thread must run in another thread (%u), unimplemented.", + processor_id); break; default: - // TODO(bunnei): Implement support for other processor IDs ASSERT_MSG(false, "Unsupported thread processor ID: %d", processor_id); break; } -- cgit v1.2.3