hle: kernel: Migrate more of KThread to KAutoObject.

This commit is contained in:
bunnei 2021-04-03 19:11:46 -07:00
parent 6fca1c82fd
commit da7e9553de
18 changed files with 451 additions and 294 deletions

View file

@ -13,6 +13,7 @@
#include "core/hardware_properties.h"
#include "core/hle/kernel/memory_types.h"
#include "core/hle/kernel/object.h"
#include "core/hle/kernel/k_auto_object.h"
namespace Core {
class CPUInterruptHandler;
@ -30,6 +31,7 @@ namespace Kernel {
class ClientPort;
class GlobalSchedulerContext;
class HandleTable;
class KAutoObjectWithListContainer;
class KMemoryManager;
class KResourceLimit;
class KScheduler;
@ -86,7 +88,7 @@ public:
std::shared_ptr<KResourceLimit> GetSystemResourceLimit() const;
/// Retrieves a shared pointer to a Thread instance within the thread wakeup handle table.
std::shared_ptr<KThread> RetrieveThreadFromGlobalHandleTable(Handle handle) const;
KScopedAutoObject<KThread> RetrieveThreadFromGlobalHandleTable(Handle handle) const;
/// Adds the given shared pointer to an internal list of active processes.
void AppendNewProcess(std::shared_ptr<Process> process);
@ -143,6 +145,10 @@ public:
const Core::ExclusiveMonitor& GetExclusiveMonitor() const;
KAutoObjectWithListContainer& ObjectListContainer();
const KAutoObjectWithListContainer& ObjectListContainer() const;
std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES>& Interrupts();
const std::array<Core::CPUInterruptHandler, Core::Hardware::NUM_CPU_CORES>& Interrupts() const;
@ -243,6 +249,9 @@ public:
bool IsPhantomModeForSingleCore() const;
void SetIsPhantomModeForSingleCore(bool value);
Core::System& System();
const Core::System& System() const;
private:
friend class Object;
friend class Process;