mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 09:47:57 -05:00
kernel/handle_table: Remove usages of the global system instance
Removes even more usages of the global system instance, trimming away more dependencies on global variables and making them explicit in the interface.
This commit is contained in:
@ -8,8 +8,9 @@
|
||||
#include "core/core.h"
|
||||
#include "core/hle/kernel/errors.h"
|
||||
#include "core/hle/kernel/handle_table.h"
|
||||
#include "core/hle/kernel/scheduler.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/kernel/process.h"
|
||||
#include "core/hle/kernel/scheduler.h"
|
||||
#include "core/hle/kernel/thread.h"
|
||||
|
||||
namespace Kernel {
|
||||
@ -23,7 +24,7 @@ constexpr u16 GetGeneration(Handle handle) {
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
HandleTable::HandleTable() {
|
||||
HandleTable::HandleTable(KernelCore& kernel) : kernel{kernel} {
|
||||
Clear();
|
||||
}
|
||||
|
||||
@ -104,9 +105,9 @@ bool HandleTable::IsValid(Handle handle) const {
|
||||
|
||||
std::shared_ptr<Object> HandleTable::GetGeneric(Handle handle) const {
|
||||
if (handle == CurrentThread) {
|
||||
return SharedFrom(Core::System::GetInstance().CurrentScheduler().GetCurrentThread());
|
||||
return SharedFrom(kernel.CurrentScheduler().GetCurrentThread());
|
||||
} else if (handle == CurrentProcess) {
|
||||
return SharedFrom(Core::System::GetInstance().CurrentProcess());
|
||||
return SharedFrom(kernel.CurrentProcess());
|
||||
}
|
||||
|
||||
if (!IsValid(handle)) {
|
||||
|
Reference in New Issue
Block a user