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.
This commit is contained in:
parent
6fbfa5bb89
commit
ff443fa835
4 changed files with 56 additions and 3 deletions
|
@ -8,6 +8,10 @@
|
|||
#include <string>
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class Process;
|
||||
}
|
||||
|
@ -36,6 +40,23 @@ enum : VAddr {
|
|||
KERNEL_REGION_END = KERNEL_REGION_VADDR + KERNEL_REGION_SIZE,
|
||||
};
|
||||
|
||||
/// Central class that handles all memory operations and state.
|
||||
class Memory {
|
||||
public:
|
||||
explicit Memory(Core::System& system);
|
||||
~Memory();
|
||||
|
||||
Memory(const Memory&) = delete;
|
||||
Memory& operator=(const Memory&) = delete;
|
||||
|
||||
Memory(Memory&&) = default;
|
||||
Memory& operator=(Memory&&) = default;
|
||||
|
||||
private:
|
||||
struct Impl;
|
||||
std::unique_ptr<Impl> impl;
|
||||
};
|
||||
|
||||
/// Changes the currently active page table to that of
|
||||
/// the given process instance.
|
||||
void SetCurrentPageTable(Kernel::Process& process);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue