From b093d39a273d070ba763e32065d14bc637f4de1c Mon Sep 17 00:00:00 2001 From: zhupengfei Date: Mon, 22 Jul 2019 20:10:47 +0800 Subject: [PATCH] kernel: Add IPC Recorder to KernelSystem Refer to the previous commit message for reasons why this is in kernel. --- src/core/hle/kernel/kernel.cpp | 10 ++++++++++ src/core/hle/kernel/kernel.h | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index f480f6362e..ceb2f14f5f 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -5,6 +5,7 @@ #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/config_mem.h" #include "core/hle/kernel/handle_table.h" +#include "core/hle/kernel/ipc_debugger/recorder.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/memory.h" #include "core/hle/kernel/process.h" @@ -25,6 +26,7 @@ KernelSystem::KernelSystem(Memory::MemorySystem& memory, Core::Timing& timing, resource_limits = std::make_unique(*this); thread_manager = std::make_unique(*this); timer_manager = std::make_unique(timing); + ipc_recorder = std::make_unique(); } /// Shutdown the kernel @@ -87,6 +89,14 @@ const SharedPage::Handler& KernelSystem::GetSharedPageHandler() const { return *shared_page_handler; } +IPCDebugger::Recorder& KernelSystem::GetIPCRecorder() { + return *ipc_recorder; +} + +const IPCDebugger::Recorder& KernelSystem::GetIPCRecorder() const { + return *ipc_recorder; +} + void KernelSystem::AddNamedPort(std::string name, std::shared_ptr port) { named_ports.emplace(std::move(name), std::move(port)); } diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 38045a4255..58f63938be 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -32,6 +32,10 @@ namespace Core { class Timing; } +namespace IPCDebugger { +class Recorder; +} + namespace Kernel { class AddressArbiter; @@ -222,6 +226,9 @@ public: SharedPage::Handler& GetSharedPageHandler(); const SharedPage::Handler& GetSharedPageHandler() const; + IPCDebugger::Recorder& GetIPCRecorder(); + const IPCDebugger::Recorder& GetIPCRecorder() const; + MemoryRegionInfo* GetMemoryRegion(MemoryRegion region); void HandleSpecialMapping(VMManager& address_space, const AddressMapping& mapping); @@ -274,6 +281,8 @@ private: std::unique_ptr config_mem_handler; std::unique_ptr shared_page_handler; + + std::unique_ptr ipc_recorder; }; } // namespace Kernel