VERY experimental Nintendo Switch 2 emulator
C++
hle: kernel: KSystemControl: Update to reflect board-specific behavior.
bunnei0e413fe7822d
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txtindex 299f1ed135..6cf7ff81fc 100644--- a/src/core/CMakeLists.txt+++ b/src/core/CMakeLists.txt@@ -141,6 +141,8 @@ add_library(core STATIChardware_interrupt_manager.hhle/ipc.hhle/ipc_helpers.h+ hle/kernel/board/nintendo/nx/k_system_control.cpp+ hle/kernel/board/nintendo/nx/k_system_control.hhle/kernel/client_port.cpphle/kernel/client_port.hhle/kernel/client_session.cpp@@ -198,7 +200,6 @@ add_library(core STATIChle/kernel/k_spin_lock.hhle/kernel/k_synchronization_object.cpphle/kernel/k_synchronization_object.h- hle/kernel/k_system_control.cpphle/kernel/k_system_control.hhle/kernel/k_thread.cpphle/kernel/k_thread.hdiff --git a/src/core/hle/kernel/k_system_control.cpp b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cppsimilarity index 87%rename from src/core/hle/kernel/k_system_control.cpprename to src/core/hle/kernel/board/nintendo/nx/k_system_control.cppindex aa1682f69c..0f41c41106 100644--- a/src/core/hle/kernel/k_system_control.cpp+++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.cpp@@ -6,7 +6,11 @@#include "core/hle/kernel/k_system_control.h"-namespace Kernel {+namespace Kernel::Board::Nintendo::Nx {++bool KSystemControl::Init::ShouldIncreaseThreadResourceLimit() {+ return true;+}namespace {template <typename F>@@ -39,4 +43,4 @@ u64 KSystemControl::GenerateRandomRange(u64 min, u64 max) {return GenerateUniformRange(min, max, GenerateRandomU64);}-} // namespace Kernel+} // namespace Kernel::Board::Nintendo::Nxdiff --git a/src/core/hle/kernel/board/nintendo/nx/k_system_control.h b/src/core/hle/kernel/board/nintendo/nx/k_system_control.hnew file mode 100644index 0000000000..3fde619717--- /dev/null+++ b/src/core/hle/kernel/board/nintendo/nx/k_system_control.h@@ -0,0 +1,22 @@+// Copyright 2021 yuzu Emulator Project+// Licensed under GPLv2 or any later version+// Refer to the license.txt file included.++#pragma once++#include "common/common_types.h"++namespace Kernel::Board::Nintendo::Nx {++class KSystemControl {+public:+ class Init {+ public:+ static bool ShouldIncreaseThreadResourceLimit();+ };++ static u64 GenerateRandomRange(u64 min, u64 max);+ static u64 GenerateRandomU64();+};++} // namespace Kernel::Board::Nintendo::Nxdiff --git a/src/core/hle/kernel/k_system_control.h b/src/core/hle/kernel/k_system_control.hindex 1d5b64ffaa..d755082c24 100644--- a/src/core/hle/kernel/k_system_control.h+++ b/src/core/hle/kernel/k_system_control.h@@ -6,14 +6,18 @@#include "common/common_types.h"-namespace Kernel {+#define BOARD_NINTENDO_NX++#ifdef BOARD_NINTENDO_NX-class KSystemControl {-public:- KSystemControl() = default;+#include "core/hle/kernel/board/nintendo/nx/k_system_control.h"- static u64 GenerateRandomRange(u64 min, u64 max);- static u64 GenerateRandomU64();-};+namespace Kernel {++using Kernel::Board::Nintendo::Nx::KSystemControl;} // namespace Kernel++#else+#error "Unknown board for KSystemControl"+#endif