diff --git a/src/core/hle/kernel/k_thread.cpp b/src/core/hle/kernel/k_thread.cpp index 17bdb7b6fa..36a374a78a 100644 --- a/src/core/hle/kernel/k_thread.cpp +++ b/src/core/hle/kernel/k_thread.cpp @@ -77,11 +77,13 @@ namespace Kernel { std::atomic_uint16_t interrupt_flag; std::atomic_uint8_t cache_maintenance_flag; std::atomic_int64_t thread_cpu_time; + std::atomic_uint32_t current_thread_handle; }; static_assert(offsetof(ThreadLocalRegion, disable_count) == 0x100); static_assert(offsetof(ThreadLocalRegion, interrupt_flag) == 0x102); static_assert(offsetof(ThreadLocalRegion, cache_maintenance_flag) == 0x104); static_assert(offsetof(ThreadLocalRegion, thread_cpu_time) == 0x108); + static_assert(offsetof(ThreadLocalRegion, current_thread_handle) == 0x110); class ThreadQueueImplForKThreadSleep final : public KThreadQueueWithoutEndWait { public: @@ -129,24 +131,24 @@ namespace Kernel { // Next, assert things based on the type. switch (type) { - case ThreadType::Main: - ASSERT(arg == 0); - [[fallthrough]]; - case ThreadType::User: - ASSERT(((owner == nullptr) || - (owner->GetCoreMask() | (1ULL << virt_core)) == owner->GetCoreMask())); - ASSERT(((owner == nullptr) || (prio > Svc::LowestThreadPriority) || - (owner->GetPriorityMask() | (1ULL << prio)) == owner->GetPriorityMask())); - break; - case ThreadType::HighPriority: - case ThreadType::Dummy: - break; - case ThreadType::Kernel: - UNIMPLEMENTED(); - break; - default: - ASSERT_MSG(false, "KThread::Initialize: Unknown ThreadType {}", static_cast(type)); - break; + case ThreadType::Main: + ASSERT(arg == 0); + [[fallthrough]]; + case ThreadType::User: + ASSERT(((owner == nullptr) || + (owner->GetCoreMask() | (1ULL << virt_core)) == owner->GetCoreMask())); + ASSERT(((owner == nullptr) || (prio > Svc::LowestThreadPriority) || + (owner->GetPriorityMask() | (1ULL << prio)) == owner->GetPriorityMask())); + break; + case ThreadType::HighPriority: + case ThreadType::Dummy: + break; + case ThreadType::Kernel: + UNIMPLEMENTED(); + break; + default: + ASSERT_MSG(false, "KThread::Initialize: Unknown ThreadType {}", static_cast(type)); + break; } m_thread_type = type; diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp index 5adb023963..0ed6d28dd4 100644 --- a/src/core/hle/service/set/system_settings_server.cpp +++ b/src/core/hle/service/set/system_settings_server.cpp @@ -1433,13 +1433,12 @@ Result ISystemSettingsServer::GetAccountUserSettings( OutLargeData out_settings) { LOG_WARNING(Service_SET, "(STUBBED) called"); - *out_count = 1; + *out_count = 0; *out_settings = {}; R_SUCCEED(); } -Result ISystemSettingsServer::GetDefaultAccountUserSettings( - OutLargeData out_settings) { +Result ISystemSettingsServer::GetDefaultAccountUserSettings(Out out_settings) { LOG_WARNING(Service_SET, "(STUBBED) called"); *out_settings = {}; diff --git a/src/core/hle/service/set/system_settings_server.h b/src/core/hle/service/set/system_settings_server.h index 91104495fe..2a160dfc6b 100644 --- a/src/core/hle/service/set/system_settings_server.h +++ b/src/core/hle/service/set/system_settings_server.h @@ -164,8 +164,7 @@ public: Result GetAccountUserSettings( Out out_count, OutLargeData out_settings); - Result GetDefaultAccountUserSettings( - OutLargeData out_settings); + Result GetDefaultAccountUserSettings(Out out_settings); private: bool LoadSettingsFile(std::filesystem::path& path, auto&& default_func);