1
0
Fork 0
forked from suyu/suyu

hle: kernel: KSystemControl: Update to reflect board-specific behavior.

This commit is contained in:
bunnei 2021-02-18 18:38:23 -08:00
parent a439867f2c
commit 5762517728
4 changed files with 41 additions and 10 deletions

View file

@ -141,6 +141,8 @@ add_library(core STATIC
hardware_interrupt_manager.h hardware_interrupt_manager.h
hle/ipc.h hle/ipc.h
hle/ipc_helpers.h hle/ipc_helpers.h
hle/kernel/board/nintendo/nx/k_system_control.cpp
hle/kernel/board/nintendo/nx/k_system_control.h
hle/kernel/client_port.cpp hle/kernel/client_port.cpp
hle/kernel/client_port.h hle/kernel/client_port.h
hle/kernel/client_session.cpp hle/kernel/client_session.cpp
@ -198,7 +200,6 @@ add_library(core STATIC
hle/kernel/k_spin_lock.h hle/kernel/k_spin_lock.h
hle/kernel/k_synchronization_object.cpp hle/kernel/k_synchronization_object.cpp
hle/kernel/k_synchronization_object.h hle/kernel/k_synchronization_object.h
hle/kernel/k_system_control.cpp
hle/kernel/k_system_control.h hle/kernel/k_system_control.h
hle/kernel/k_thread.cpp hle/kernel/k_thread.cpp
hle/kernel/k_thread.h hle/kernel/k_thread.h

View file

@ -6,7 +6,11 @@
#include "core/hle/kernel/k_system_control.h" #include "core/hle/kernel/k_system_control.h"
namespace Kernel { namespace Kernel::Board::Nintendo::Nx {
bool KSystemControl::Init::ShouldIncreaseThreadResourceLimit() {
return true;
}
namespace { namespace {
template <typename F> template <typename F>
@ -39,4 +43,4 @@ u64 KSystemControl::GenerateRandomRange(u64 min, u64 max) {
return GenerateUniformRange(min, max, GenerateRandomU64); return GenerateUniformRange(min, max, GenerateRandomU64);
} }
} // namespace Kernel } // namespace Kernel::Board::Nintendo::Nx

View file

@ -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::Nx

View file

@ -6,14 +6,18 @@
#include "common/common_types.h" #include "common/common_types.h"
#define BOARD_NINTENDO_NX
#ifdef BOARD_NINTENDO_NX
#include "core/hle/kernel/board/nintendo/nx/k_system_control.h"
namespace Kernel { namespace Kernel {
class KSystemControl { using Kernel::Board::Nintendo::Nx::KSystemControl;
public:
KSystemControl() = default;
static u64 GenerateRandomRange(u64 min, u64 max);
static u64 GenerateRandomU64();
};
} // namespace Kernel } // namespace Kernel
#else
#error "Unknown board for KSystemControl"
#endif