diff options
| author | 2019-11-26 12:33:20 -0500 | |
|---|---|---|
| committer | 2019-11-26 21:53:34 -0500 | |
| commit | 4c2ed2706e3579ec1304907dad0d45673768e1fc (patch) | |
| tree | 89f72c13ad6ab374a4e2d2d475b1e03320de7066 /src/core/memory.h | |
| parent | Merge pull request #3143 from ReinUsesLisp/indexing-bug (diff) | |
| download | yuzu-4c2ed2706e3579ec1304907dad0d45673768e1fc.tar.gz yuzu-4c2ed2706e3579ec1304907dad0d45673768e1fc.tar.xz yuzu-4c2ed2706e3579ec1304907dad0d45673768e1fc.zip | |
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.
Diffstat (limited to 'src/core/memory.h')
| -rw-r--r-- | src/core/memory.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/memory.h b/src/core/memory.h index 09008e1dd..c690df3c3 100644 --- a/src/core/memory.h +++ b/src/core/memory.h | |||
| @@ -8,6 +8,10 @@ | |||
| 8 | #include <string> | 8 | #include <string> |
| 9 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 10 | 10 | ||
| 11 | namespace Core { | ||
| 12 | class System; | ||
| 13 | } | ||
| 14 | |||
| 11 | namespace Kernel { | 15 | namespace Kernel { |
| 12 | class Process; | 16 | class Process; |
| 13 | } | 17 | } |
| @@ -36,6 +40,23 @@ enum : VAddr { | |||
| 36 | KERNEL_REGION_END = KERNEL_REGION_VADDR + KERNEL_REGION_SIZE, | 40 | KERNEL_REGION_END = KERNEL_REGION_VADDR + KERNEL_REGION_SIZE, |
| 37 | }; | 41 | }; |
| 38 | 42 | ||
| 43 | /// Central class that handles all memory operations and state. | ||
| 44 | class Memory { | ||
| 45 | public: | ||
| 46 | explicit Memory(Core::System& system); | ||
| 47 | ~Memory(); | ||
| 48 | |||
| 49 | Memory(const Memory&) = delete; | ||
| 50 | Memory& operator=(const Memory&) = delete; | ||
| 51 | |||
| 52 | Memory(Memory&&) = default; | ||
| 53 | Memory& operator=(Memory&&) = default; | ||
| 54 | |||
| 55 | private: | ||
| 56 | struct Impl; | ||
| 57 | std::unique_ptr<Impl> impl; | ||
| 58 | }; | ||
| 59 | |||
| 39 | /// Changes the currently active page table to that of | 60 | /// Changes the currently active page table to that of |
| 40 | /// the given process instance. | 61 | /// the given process instance. |
| 41 | void SetCurrentPageTable(Kernel::Process& process); | 62 | void SetCurrentPageTable(Kernel::Process& process); |