From 4c2ed2706e3579ec1304907dad0d45673768e1fc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Nov 2019 12:33:20 -0500 Subject: core/memory: Introduce skeleton of Memory class Currently, the main memory management code is one of the remaining places where we have global state. The next series of changes will aim to rectify this. This change simply introduces the main skeleton of the class that will contain all the necessary state. --- src/core/memory.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/core/memory.cpp') diff --git a/src/core/memory.cpp b/src/core/memory.cpp index fa49f3dd0..2098f13f7 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -24,6 +24,18 @@ namespace Memory { static Common::PageTable* current_page_table = nullptr; +// Implementation class used to keep the specifics of the memory subsystem hidden +// from outside classes. This also allows modification to the internals of the memory +// subsystem without needing to rebuild all files that make use of the memory interface. +struct Memory::Impl { + explicit Impl(Core::System& system_) : system{system_} {} + + Core::System& system; +}; + +Memory::Memory(Core::System& system) : impl{std::make_unique(system)} {} +Memory::~Memory() = default; + void SetCurrentPageTable(Kernel::Process& process) { current_page_table = &process.VMManager().page_table; -- cgit v1.2.3