kern: add new unknown DebugThreadParam

This commit is contained in:
Alula committed 2026-09-15 17:04:50 +02:00
1 parent 0f15010ba5
commit 289ba7104e
3 files changed
+12

No files matched your search

@@ -341,6 +341,7 @@ namespace ams::kern {
bool m_debug_attached; bool m_debug_attached;
s8 m_priority_inheritance_count; s8 m_priority_inheritance_count;
bool m_resource_limit_release_hint; bool m_resource_limit_release_hint;
bool m_debug_unknown5;
public: public:
constexpr explicit KThread(util::ConstantInitializeTag) constexpr explicit KThread(util::ConstantInitializeTag)
: KAutoObjectWithSlabHeapAndContainer<KThread, KWorkerTask>(util::ConstantInitialize), KTimerTask(util::ConstantInitialize), : KAutoObjectWithSlabHeapAndContainer<KThread, KWorkerTask>(util::ConstantInitialize), KTimerTask(util::ConstantInitialize),
@@ -683,6 +684,9 @@ namespace ams::kern {
constexpr void SetDebugAttached() { m_debug_attached = true; } constexpr void SetDebugAttached() { m_debug_attached = true; }
constexpr bool IsAttachedToDebugger() const { return m_debug_attached; } constexpr bool IsAttachedToDebugger() const { return m_debug_attached; }
constexpr void SetDebugUnknown5(bool value) { m_debug_unknown5 = value; }
constexpr bool IsDebugUnknown5() const { return m_debug_unknown5; }
void AddCpuTime(s32 core_id, s64 amount) { void AddCpuTime(s32 core_id, s64 amount) {
m_cpu_time += amount; m_cpu_time += amount;
/* TODO: Debug kernels track per-core tick counts. Should we? */ /* TODO: Debug kernels track per-core tick counts. Should we? */
@@ -970,6 +970,9 @@ namespace ams::kern {
/* Initialize the thread. */ /* Initialize the thread. */
R_TRY(KThread::InitializeUserThread(main_thread, reinterpret_cast<KThreadFunction>(GetVoidPointer(this->GetEntryPoint())), 0, stack_top, priority, m_ideal_core_id, this)); R_TRY(KThread::InitializeUserThread(main_thread, reinterpret_cast<KThreadFunction>(GetVoidPointer(this->GetEntryPoint())), 0, stack_top, priority, m_ideal_core_id, this));
/* TODO: what is this? */
main_thread->SetDebugUnknown5(true);
/* Register the thread, and commit our reservation. */ /* Register the thread, and commit our reservation. */
KThread::Register(main_thread); KThread::Register(main_thread);
thread_reservation.Commit(); thread_reservation.Commit();
@@ -429,6 +429,11 @@ namespace ams::kern::svc {
*out_32 = affinity_mask; *out_32 = affinity_mask;
} }
break; break;
case ams::svc::DebugThreadParam_Unknown5:
{
*out_32 = thread->IsDebugUnknown5();
}
break;
default: default:
R_THROW(ams::svc::ResultInvalidEnumValue()); R_THROW(ams::svc::ResultInvalidEnumValue());
} }