Merge pull request #1766 from Subv/log_cpu

Kernel/Threading: Warn when a thread can be scheduled in the Syscore (Core 1)
This commit is contained in:
bunnei 2016-05-08 15:03:08 -04:00
commit 282a2ad539
3 changed files with 10 additions and 0 deletions

View file

@ -107,6 +107,8 @@ public:
ProcessFlags flags;
/// Kernel compatibility version for this process
u16 kernel_version = 0;
/// The default CPU for this process, threads are scheduled on this cpu by default.
u8 ideal_processor = 0;
/// The id of this process
u32 process_id = next_process_id++;

View file

@ -496,6 +496,11 @@ static ResultCode CreateThread(Handle* out_handle, s32 priority, u32 entry_point
break;
}
if (processor_id == THREADPROCESSORID_1 || processor_id == THREADPROCESSORID_ALL ||
(processor_id == THREADPROCESSORID_DEFAULT && Kernel::g_current_process->ideal_processor == THREADPROCESSORID_1)) {
LOG_WARNING(Kernel_SVC, "Newly created thread is allowed to be run in the SysCore, unimplemented.");
}
CASCADE_RESULT(SharedPtr<Thread> thread, Kernel::Thread::Create(
name, entry_point, priority, arg, processor_id, stack_top));
CASCADE_RESULT(*out_handle, Kernel::g_handle_table.Create(std::move(thread)));