Improve get_current_cpu_thread()

This commit is contained in:
Eladash 2021-05-20 07:00:22 +03:00
parent 04cac6cd33
commit 638f20c80f
8 changed files with 58 additions and 25 deletions

View file

@ -1666,16 +1666,11 @@ s32 error_code::error_report(s32 result, const char* fmt, const fmt_type_info* s
logs::channel* channel = &sys_log;
const char* func = "Unknown function";
if (auto thread = get_current_cpu_thread())
if (auto ppu = get_current_cpu_thread<ppu_thread>())
{
if (thread->id_type() == 1)
if (ppu->current_function)
{
auto& ppu = static_cast<ppu_thread&>(*thread);
if (ppu.current_function)
{
func = ppu.current_function;
}
func = ppu->current_function;
}
}