diff options
author | Lioncash <mathew1800@gmail.com> | 2019-03-05 18:28:10 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-03-05 21:47:03 +0100 |
commit | c161389a0f0b0fe3b9d6400c45fd87152f2cb14c (patch) | |
tree | b050bdbd77611a1205028b6307f4aca72e1c7417 /src/core/hle/kernel/kernel.cpp | |
parent | kernel/address_arbiter: Minor tidying up (diff) | |
download | yuzu-c161389a0f0b0fe3b9d6400c45fd87152f2cb14c.tar yuzu-c161389a0f0b0fe3b9d6400c45fd87152f2cb14c.tar.gz yuzu-c161389a0f0b0fe3b9d6400c45fd87152f2cb14c.tar.bz2 yuzu-c161389a0f0b0fe3b9d6400c45fd87152f2cb14c.tar.lz yuzu-c161389a0f0b0fe3b9d6400c45fd87152f2cb14c.tar.xz yuzu-c161389a0f0b0fe3b9d6400c45fd87152f2cb14c.tar.zst yuzu-c161389a0f0b0fe3b9d6400c45fd87152f2cb14c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index b771a33a6..04ea9349e 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -87,11 +87,13 @@ static void ThreadWakeupCallback(u64 thread_handle, [[maybe_unused]] int cycles_ } struct KernelCore::Impl { - void Initialize(KernelCore& kernel, Core::Timing::CoreTiming& core_timing) { + explicit Impl(Core::System& system) : address_arbiter{system}, system{system} {} + + void Initialize(KernelCore& kernel) { Shutdown(); InitializeSystemResourceLimit(kernel); - InitializeThreads(core_timing); + InitializeThreads(); } void Shutdown() { @@ -123,9 +125,9 @@ struct KernelCore::Impl { ASSERT(system_resource_limit->SetLimitValue(ResourceType::Sessions, 900).IsSuccess()); } - void InitializeThreads(Core::Timing::CoreTiming& core_timing) { + void InitializeThreads() { thread_wakeup_event_type = - core_timing.RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback); + system.CoreTiming().RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback); } std::atomic<u32> next_object_id{0}; @@ -148,15 +150,18 @@ struct KernelCore::Impl { /// Map of named ports managed by the kernel, which can be retrieved using /// the ConnectToPort SVC. NamedPortTable named_ports; + + // System context + Core::System& system; }; -KernelCore::KernelCore() : impl{std::make_unique<Impl>()} {} +KernelCore::KernelCore(Core::System& system) : impl{std::make_unique<Impl>(system)} {} KernelCore::~KernelCore() { Shutdown(); } -void KernelCore::Initialize(Core::Timing::CoreTiming& core_timing) { - impl->Initialize(*this, core_timing); +void KernelCore::Initialize() { + impl->Initialize(*this); } void KernelCore::Shutdown() { |