Memory: replace Core::CPU

This commit is contained in:
Weiyi Wang 2019-02-01 12:43:55 -05:00
parent 5f6d9f1915
commit 9573ee46bd
3 changed files with 14 additions and 2 deletions

View file

@ -189,6 +189,7 @@ System::ResultStatus System::Init(EmuWindow& emu_window, u32 system_mode) {
} }
kernel->GetThreadManager().SetCPU(*cpu_core); kernel->GetThreadManager().SetCPU(*cpu_core);
memory->SetCPU(*cpu_core);
if (Settings::values.enable_dsp_lle) { if (Settings::values.enable_dsp_lle) {
dsp_core = std::make_unique<AudioCore::DspLle>(*memory, dsp_core = std::make_unique<AudioCore::DspLle>(*memory,

View file

@ -65,15 +65,21 @@ public:
PageTable* current_page_table = nullptr; PageTable* current_page_table = nullptr;
RasterizerCacheMarker cache_marker; RasterizerCacheMarker cache_marker;
std::vector<PageTable*> page_table_list; std::vector<PageTable*> page_table_list;
ARM_Interface* cpu = nullptr;
}; };
MemorySystem::MemorySystem() : impl(std::make_unique<Impl>()) {} MemorySystem::MemorySystem() : impl(std::make_unique<Impl>()) {}
MemorySystem::~MemorySystem() = default; MemorySystem::~MemorySystem() = default;
void MemorySystem::SetCPU(ARM_Interface& cpu) {
impl->cpu = &cpu;
}
void MemorySystem::SetCurrentPageTable(PageTable* page_table) { void MemorySystem::SetCurrentPageTable(PageTable* page_table) {
impl->current_page_table = page_table; impl->current_page_table = page_table;
if (Core::System::GetInstance().IsPoweredOn()) { if (impl->cpu != nullptr) {
Core::CPU().PageTableChanged(); impl->cpu->PageTableChanged();
} }
} }

View file

@ -12,6 +12,8 @@
#include "common/common_types.h" #include "common/common_types.h"
#include "core/mmio.h" #include "core/mmio.h"
class ARM_Interface;
namespace Kernel { namespace Kernel {
class Process; class Process;
} }
@ -214,6 +216,9 @@ public:
MemorySystem(); MemorySystem();
~MemorySystem(); ~MemorySystem();
/// Sets CPU to notify page table change
void SetCPU(ARM_Interface& cpu);
/** /**
* Maps an allocated buffer onto a region of the emulated process address space. * Maps an allocated buffer onto a region of the emulated process address space.
* *