Minecraft_THREADPROCESSORID_2

This commit is contained in:
citra 2017-10-18 18:39:35 +01:00
parent 219bf6d2c2
commit a34f43e3ea
3 changed files with 31 additions and 5 deletions

View File

@ -213,6 +213,9 @@ std::vector<std::unique_ptr<WaitTreeItem>> WaitTreeThread::GetChildren() const {
case ThreadProcessorId::THREADPROCESSORID_1:
processor = tr("SysCore");
break;
case ThreadProcessorId::THREADPROCESSORID_2:
processor = tr("SysCore2");
break;
default:
processor = tr("Unknown processor %1").arg(thread.processor_id);
break;

View File

@ -27,6 +27,7 @@ enum ThreadProcessorId : s32 {
THREADPROCESSORID_ALL = -1, ///< Run thread on either core
THREADPROCESSORID_0 = 0, ///< Run thread on core 0 (AppCore)
THREADPROCESSORID_1 = 1, ///< Run thread on core 1 (SysCore)
THREADPROCESSORID_2 = 2, ///< Run thread on core 2 (SysCore)
THREADPROCESSORID_MAX = 2, ///< Processor ID must be less than this
};

View File

@ -705,6 +705,7 @@ static ResultCode CreateThread(Kernel::Handle* out_handle, u32 priority, u32 ent
case THREADPROCESSORID_DEFAULT:
case THREADPROCESSORID_0:
case THREADPROCESSORID_1:
case THREADPROCESSORID_2:
break;
default:
// TODO(bunnei): Implement support for other processor IDs
@ -717,10 +718,20 @@ static ResultCode CreateThread(Kernel::Handle* out_handle, u32 priority, u32 ent
"Newly created thread is allowed to be run in any Core, unimplemented.");
}
if (processor_id == THREADPROCESSORID_DEFAULT &&
Kernel::g_current_process->ideal_processor == THREADPROCESSORID_0) {
LOG_WARNING(Kernel_SVC,
"Newly created thread is allowed to be run in the AppCore, unimplemented.");
}
if (processor_id == THREADPROCESSORID_0) {
LOG_ERROR(Kernel_SVC,
"Newly created thread must run in the AppCore, unimplemented.");
}
if (processor_id == THREADPROCESSORID_DEFAULT &&
Kernel::g_current_process->ideal_processor == THREADPROCESSORID_1) {
LOG_WARNING(
Kernel_SVC,
LOG_WARNING(Kernel_SVC,
"Newly created thread is allowed to be run in the SysCore (Core1), unimplemented.");
}
@ -729,6 +740,17 @@ static ResultCode CreateThread(Kernel::Handle* out_handle, u32 priority, u32 ent
"Newly created thread must run in the SysCore (Core1), unimplemented.");
}
if (processor_id == THREADPROCESSORID_DEFAULT &&
Kernel::g_current_process->ideal_processor == THREADPROCESSORID_2) {
LOG_WARNING(Kernel_SVC,
"Newly created thread is allowed to be run in the SysCore (Core2), unimplemented.");
}
if (processor_id == THREADPROCESSORID_2) {
LOG_ERROR(Kernel_SVC,
"Newly created thread must run in the SysCore (Core2), unimplemented.");
}
CASCADE_RESULT(SharedPtr<Thread> thread,
Kernel::Thread::Create(name, entry_point, priority, arg, processor_id, stack_top,
Kernel::g_current_process));