diff options
| author | 2018-05-02 22:36:51 -0400 | |
|---|---|---|
| committer | 2018-05-10 19:34:46 -0400 | |
| commit | a434fdcb102e96ddf564dc0973d7073d49bf19fc (patch) | |
| tree | de758b0cc5ebcb67146397a74474fb898c0be51a /src/core/hle/kernel | |
| parent | core: Create a thread for each CPU core, keep in lock-step with a barrier. (diff) | |
| download | yuzu-a434fdcb102e96ddf564dc0973d7073d49bf19fc.tar.gz yuzu-a434fdcb102e96ddf564dc0973d7073d49bf19fc.tar.xz yuzu-a434fdcb102e96ddf564dc0973d7073d49bf19fc.zip | |
core: Implement multicore support.
Diffstat (limited to 'src/core/hle/kernel')
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 43 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc_wrap.h | 24 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 16 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/vm_manager.cpp | 23 |
5 files changed, 65 insertions, 45 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 72b5c05f2..520510b61 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -485,22 +485,28 @@ static void ExitProcess() { | |||
| 485 | 485 | ||
| 486 | Core::CurrentProcess()->status = ProcessStatus::Exited; | 486 | Core::CurrentProcess()->status = ProcessStatus::Exited; |
| 487 | 487 | ||
| 488 | // Stop all the process threads that are currently waiting for objects. | 488 | auto stop_threads = [](const std::vector<SharedPtr<Thread>>& thread_list) { |
| 489 | auto& thread_list = Core::System::GetInstance().Scheduler().GetThreadList(); | 489 | for (auto& thread : thread_list) { |
| 490 | for (auto& thread : thread_list) { | 490 | if (thread->owner_process != Core::CurrentProcess()) |
| 491 | if (thread->owner_process != Core::CurrentProcess()) | 491 | continue; |
| 492 | continue; | ||
| 493 | 492 | ||
| 494 | if (thread == GetCurrentThread()) | 493 | if (thread == GetCurrentThread()) |
| 495 | continue; | 494 | continue; |
| 496 | 495 | ||
| 497 | // TODO(Subv): When are the other running/ready threads terminated? | 496 | // TODO(Subv): When are the other running/ready threads terminated? |
| 498 | ASSERT_MSG(thread->status == THREADSTATUS_WAIT_SYNCH_ANY || | 497 | ASSERT_MSG(thread->status == THREADSTATUS_WAIT_SYNCH_ANY || |
| 499 | thread->status == THREADSTATUS_WAIT_SYNCH_ALL, | 498 | thread->status == THREADSTATUS_WAIT_SYNCH_ALL, |
| 500 | "Exiting processes with non-waiting threads is currently unimplemented"); | 499 | "Exiting processes with non-waiting threads is currently unimplemented"); |
| 501 | 500 | ||
| 502 | thread->Stop(); | 501 | thread->Stop(); |
| 503 | } | 502 | } |
| 503 | }; | ||
| 504 | |||
| 505 | auto& system = Core::System::GetInstance(); | ||
| 506 | stop_threads(system.Scheduler(0)->GetThreadList()); | ||
| 507 | stop_threads(system.Scheduler(1)->GetThreadList()); | ||
| 508 | stop_threads(system.Scheduler(2)->GetThreadList()); | ||
| 509 | stop_threads(system.Scheduler(3)->GetThreadList()); | ||
| 504 | 510 | ||
| 505 | // Kill the current thread | 511 | // Kill the current thread |
| 506 | GetCurrentThread()->Stop(); | 512 | GetCurrentThread()->Stop(); |
| @@ -530,14 +536,9 @@ static ResultCode CreateThread(Handle* out_handle, VAddr entry_point, u64 arg, V | |||
| 530 | 536 | ||
| 531 | switch (processor_id) { | 537 | switch (processor_id) { |
| 532 | case THREADPROCESSORID_0: | 538 | case THREADPROCESSORID_0: |
| 533 | break; | ||
| 534 | case THREADPROCESSORID_1: | 539 | case THREADPROCESSORID_1: |
| 535 | case THREADPROCESSORID_2: | 540 | case THREADPROCESSORID_2: |
| 536 | case THREADPROCESSORID_3: | 541 | case THREADPROCESSORID_3: |
| 537 | // TODO(bunnei): Implement support for other processor IDs | ||
| 538 | NGLOG_ERROR(Kernel_SVC, | ||
| 539 | "Newly created thread must run in another thread ({}), unimplemented.", | ||
| 540 | processor_id); | ||
| 541 | break; | 542 | break; |
| 542 | default: | 543 | default: |
| 543 | ASSERT_MSG(false, "Unsupported thread processor ID: {}", processor_id); | 544 | ASSERT_MSG(false, "Unsupported thread processor ID: {}", processor_id); |
| @@ -576,7 +577,7 @@ static ResultCode StartThread(Handle thread_handle) { | |||
| 576 | 577 | ||
| 577 | /// Called when a thread exits | 578 | /// Called when a thread exits |
| 578 | static void ExitThread() { | 579 | static void ExitThread() { |
| 579 | NGLOG_TRACE(Kernel_SVC, "called, pc=0x{:08X}", Core::CPU().GetPC()); | 580 | NGLOG_TRACE(Kernel_SVC, "called, pc=0x{:08X}", Core::CurrentArmInterface().GetPC()); |
| 580 | 581 | ||
| 581 | ExitCurrentThread(); | 582 | ExitCurrentThread(); |
| 582 | Core::System::GetInstance().PrepareReschedule(); | 583 | Core::System::GetInstance().PrepareReschedule(); |
| @@ -588,7 +589,7 @@ static void SleepThread(s64 nanoseconds) { | |||
| 588 | 589 | ||
| 589 | // Don't attempt to yield execution if there are no available threads to run, | 590 | // Don't attempt to yield execution if there are no available threads to run, |
| 590 | // this way we avoid a useless reschedule to the idle thread. | 591 | // this way we avoid a useless reschedule to the idle thread. |
| 591 | if (nanoseconds == 0 && !Core::System::GetInstance().Scheduler().HaveReadyThreads()) | 592 | if (nanoseconds == 0 && !Core::System::GetInstance().CurrentScheduler().HaveReadyThreads()) |
| 592 | return; | 593 | return; |
| 593 | 594 | ||
| 594 | // Sleep current thread and check for next thread to schedule | 595 | // Sleep current thread and check for next thread to schedule |
| @@ -634,7 +635,7 @@ static ResultCode SignalProcessWideKey(VAddr condition_variable_addr, s32 target | |||
| 634 | condition_variable_addr, target); | 635 | condition_variable_addr, target); |
| 635 | 636 | ||
| 636 | u32 processed = 0; | 637 | u32 processed = 0; |
| 637 | auto& thread_list = Core::System::GetInstance().Scheduler().GetThreadList(); | 638 | auto& thread_list = Core::System::GetInstance().CurrentScheduler().GetThreadList(); |
| 638 | 639 | ||
| 639 | for (auto& thread : thread_list) { | 640 | for (auto& thread : thread_list) { |
| 640 | if (thread->condvar_wait_address != condition_variable_addr) | 641 | if (thread->condvar_wait_address != condition_variable_addr) |
diff --git a/src/core/hle/kernel/svc_wrap.h b/src/core/hle/kernel/svc_wrap.h index c86ad3e04..40aa88cc1 100644 --- a/src/core/hle/kernel/svc_wrap.h +++ b/src/core/hle/kernel/svc_wrap.h | |||
| @@ -13,14 +13,14 @@ | |||
| 13 | 13 | ||
| 14 | namespace Kernel { | 14 | namespace Kernel { |
| 15 | 15 | ||
| 16 | #define PARAM(n) Core::CPU().GetReg(n) | 16 | #define PARAM(n) Core::CurrentArmInterface().GetReg(n) |
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| 19 | * HLE a function return from the current ARM userland process | 19 | * HLE a function return from the current ARM userland process |
| 20 | * @param res Result to return | 20 | * @param res Result to return |
| 21 | */ | 21 | */ |
| 22 | static inline void FuncReturn(u64 res) { | 22 | static inline void FuncReturn(u64 res) { |
| 23 | Core::CPU().SetReg(0, res); | 23 | Core::CurrentArmInterface().SetReg(0, res); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 26 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| @@ -45,7 +45,7 @@ template <ResultCode func(u32*, u32)> | |||
| 45 | void SvcWrap() { | 45 | void SvcWrap() { |
| 46 | u32 param_1 = 0; | 46 | u32 param_1 = 0; |
| 47 | u32 retval = func(¶m_1, (u32)PARAM(1)).raw; | 47 | u32 retval = func(¶m_1, (u32)PARAM(1)).raw; |
| 48 | Core::CPU().SetReg(1, param_1); | 48 | Core::CurrentArmInterface().SetReg(1, param_1); |
| 49 | FuncReturn(retval); | 49 | FuncReturn(retval); |
| 50 | } | 50 | } |
| 51 | 51 | ||
| @@ -53,7 +53,7 @@ template <ResultCode func(u32*, u64)> | |||
| 53 | void SvcWrap() { | 53 | void SvcWrap() { |
| 54 | u32 param_1 = 0; | 54 | u32 param_1 = 0; |
| 55 | u32 retval = func(¶m_1, PARAM(1)).raw; | 55 | u32 retval = func(¶m_1, PARAM(1)).raw; |
| 56 | Core::CPU().SetReg(1, param_1); | 56 | Core::CurrentArmInterface().SetReg(1, param_1); |
| 57 | FuncReturn(retval); | 57 | FuncReturn(retval); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| @@ -66,7 +66,7 @@ template <ResultCode func(u64*, u64)> | |||
| 66 | void SvcWrap() { | 66 | void SvcWrap() { |
| 67 | u64 param_1 = 0; | 67 | u64 param_1 = 0; |
| 68 | u32 retval = func(¶m_1, PARAM(1)).raw; | 68 | u32 retval = func(¶m_1, PARAM(1)).raw; |
| 69 | Core::CPU().SetReg(1, param_1); | 69 | Core::CurrentArmInterface().SetReg(1, param_1); |
| 70 | FuncReturn(retval); | 70 | FuncReturn(retval); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| @@ -85,8 +85,8 @@ void SvcWrap() { | |||
| 85 | u32 param_1 = 0; | 85 | u32 param_1 = 0; |
| 86 | u64 param_2 = 0; | 86 | u64 param_2 = 0; |
| 87 | ResultCode retval = func((u32)(PARAM(2) & 0xFFFFFFFF), ¶m_1, ¶m_2); | 87 | ResultCode retval = func((u32)(PARAM(2) & 0xFFFFFFFF), ¶m_1, ¶m_2); |
| 88 | Core::CPU().SetReg(1, param_1); | 88 | Core::CurrentArmInterface().SetReg(1, param_1); |
| 89 | Core::CPU().SetReg(2, param_2); | 89 | Core::CurrentArmInterface().SetReg(2, param_2); |
| 90 | FuncReturn(retval.raw); | 90 | FuncReturn(retval.raw); |
| 91 | } | 91 | } |
| 92 | 92 | ||
| @@ -120,7 +120,7 @@ template <ResultCode func(u32*, u64, u64, s64)> | |||
| 120 | void SvcWrap() { | 120 | void SvcWrap() { |
| 121 | u32 param_1 = 0; | 121 | u32 param_1 = 0; |
| 122 | ResultCode retval = func(¶m_1, PARAM(1), (u32)(PARAM(2) & 0xFFFFFFFF), (s64)PARAM(3)); | 122 | ResultCode retval = func(¶m_1, PARAM(1), (u32)(PARAM(2) & 0xFFFFFFFF), (s64)PARAM(3)); |
| 123 | Core::CPU().SetReg(1, param_1); | 123 | Core::CurrentArmInterface().SetReg(1, param_1); |
| 124 | FuncReturn(retval.raw); | 124 | FuncReturn(retval.raw); |
| 125 | } | 125 | } |
| 126 | 126 | ||
| @@ -133,7 +133,7 @@ template <ResultCode func(u64*, u64, u64, u64)> | |||
| 133 | void SvcWrap() { | 133 | void SvcWrap() { |
| 134 | u64 param_1 = 0; | 134 | u64 param_1 = 0; |
| 135 | u32 retval = func(¶m_1, PARAM(1), PARAM(2), PARAM(3)).raw; | 135 | u32 retval = func(¶m_1, PARAM(1), PARAM(2), PARAM(3)).raw; |
| 136 | Core::CPU().SetReg(1, param_1); | 136 | Core::CurrentArmInterface().SetReg(1, param_1); |
| 137 | FuncReturn(retval); | 137 | FuncReturn(retval); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| @@ -143,7 +143,7 @@ void SvcWrap() { | |||
| 143 | u32 retval = | 143 | u32 retval = |
| 144 | func(¶m_1, PARAM(1), PARAM(2), PARAM(3), (u32)PARAM(4), (s32)(PARAM(5) & 0xFFFFFFFF)) | 144 | func(¶m_1, PARAM(1), PARAM(2), PARAM(3), (u32)PARAM(4), (s32)(PARAM(5) & 0xFFFFFFFF)) |
| 145 | .raw; | 145 | .raw; |
| 146 | Core::CPU().SetReg(1, param_1); | 146 | Core::CurrentArmInterface().SetReg(1, param_1); |
| 147 | FuncReturn(retval); | 147 | FuncReturn(retval); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| @@ -166,7 +166,7 @@ template <ResultCode func(u32*, u64, u64, u32)> | |||
| 166 | void SvcWrap() { | 166 | void SvcWrap() { |
| 167 | u32 param_1 = 0; | 167 | u32 param_1 = 0; |
| 168 | u32 retval = func(¶m_1, PARAM(1), PARAM(2), (u32)(PARAM(3) & 0xFFFFFFFF)).raw; | 168 | u32 retval = func(¶m_1, PARAM(1), PARAM(2), (u32)(PARAM(3) & 0xFFFFFFFF)).raw; |
| 169 | Core::CPU().SetReg(1, param_1); | 169 | Core::CurrentArmInterface().SetReg(1, param_1); |
| 170 | FuncReturn(retval); | 170 | FuncReturn(retval); |
| 171 | } | 171 | } |
| 172 | 172 | ||
| @@ -175,7 +175,7 @@ void SvcWrap() { | |||
| 175 | u32 param_1 = 0; | 175 | u32 param_1 = 0; |
| 176 | u32 retval = | 176 | u32 retval = |
| 177 | func(¶m_1, PARAM(1), (u32)(PARAM(2) & 0xFFFFFFFF), (u32)(PARAM(3) & 0xFFFFFFFF)).raw; | 177 | func(¶m_1, PARAM(1), (u32)(PARAM(2) & 0xFFFFFFFF), (u32)(PARAM(3) & 0xFFFFFFFF)).raw; |
| 178 | Core::CPU().SetReg(1, param_1); | 178 | Core::CurrentArmInterface().SetReg(1, param_1); |
| 179 | FuncReturn(retval); | 179 | FuncReturn(retval); |
| 180 | } | 180 | } |
| 181 | 181 | ||
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 1bd5d9ebf..0a5441684 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -64,7 +64,7 @@ void Thread::Stop() { | |||
| 64 | // Clean up thread from ready queue | 64 | // Clean up thread from ready queue |
| 65 | // This is only needed when the thread is termintated forcefully (SVC TerminateProcess) | 65 | // This is only needed when the thread is termintated forcefully (SVC TerminateProcess) |
| 66 | if (status == THREADSTATUS_READY) { | 66 | if (status == THREADSTATUS_READY) { |
| 67 | Core::System::GetInstance().Scheduler().UnscheduleThread(this, current_priority); | 67 | scheduler->UnscheduleThread(this, current_priority); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | status = THREADSTATUS_DEAD; | 70 | status = THREADSTATUS_DEAD; |
| @@ -92,7 +92,7 @@ void WaitCurrentThread_Sleep() { | |||
| 92 | void ExitCurrentThread() { | 92 | void ExitCurrentThread() { |
| 93 | Thread* thread = GetCurrentThread(); | 93 | Thread* thread = GetCurrentThread(); |
| 94 | thread->Stop(); | 94 | thread->Stop(); |
| 95 | Core::System::GetInstance().Scheduler().RemoveThread(thread); | 95 | Core::System::GetInstance().CurrentScheduler().RemoveThread(thread); |
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | /** | 98 | /** |
| @@ -188,7 +188,7 @@ void Thread::ResumeFromWait() { | |||
| 188 | wakeup_callback = nullptr; | 188 | wakeup_callback = nullptr; |
| 189 | 189 | ||
| 190 | status = THREADSTATUS_READY; | 190 | status = THREADSTATUS_READY; |
| 191 | Core::System::GetInstance().Scheduler().ScheduleThread(this, current_priority); | 191 | scheduler->ScheduleThread(this, current_priority); |
| 192 | Core::System::GetInstance().PrepareReschedule(); | 192 | Core::System::GetInstance().PrepareReschedule(); |
| 193 | } | 193 | } |
| 194 | 194 | ||
| @@ -259,8 +259,6 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 259 | 259 | ||
| 260 | SharedPtr<Thread> thread(new Thread); | 260 | SharedPtr<Thread> thread(new Thread); |
| 261 | 261 | ||
| 262 | Core::System::GetInstance().Scheduler().AddThread(thread, priority); | ||
| 263 | |||
| 264 | thread->thread_id = NewThreadId(); | 262 | thread->thread_id = NewThreadId(); |
| 265 | thread->status = THREADSTATUS_DORMANT; | 263 | thread->status = THREADSTATUS_DORMANT; |
| 266 | thread->entry_point = entry_point; | 264 | thread->entry_point = entry_point; |
| @@ -275,6 +273,8 @@ ResultVal<SharedPtr<Thread>> Thread::Create(std::string name, VAddr entry_point, | |||
| 275 | thread->name = std::move(name); | 273 | thread->name = std::move(name); |
| 276 | thread->callback_handle = wakeup_callback_handle_table.Create(thread).Unwrap(); | 274 | thread->callback_handle = wakeup_callback_handle_table.Create(thread).Unwrap(); |
| 277 | thread->owner_process = owner_process; | 275 | thread->owner_process = owner_process; |
| 276 | thread->scheduler = Core::System().GetInstance().Scheduler(static_cast<size_t>(processor_id)); | ||
| 277 | thread->scheduler->AddThread(thread, priority); | ||
| 278 | 278 | ||
| 279 | // Find the next available TLS index, and mark it as used | 279 | // Find the next available TLS index, and mark it as used |
| 280 | auto& tls_slots = owner_process->tls_slots; | 280 | auto& tls_slots = owner_process->tls_slots; |
| @@ -337,7 +337,7 @@ void Thread::SetPriority(u32 priority) { | |||
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | void Thread::BoostPriority(u32 priority) { | 339 | void Thread::BoostPriority(u32 priority) { |
| 340 | Core::System::GetInstance().Scheduler().SetThreadPriority(this, priority); | 340 | scheduler->SetThreadPriority(this, priority); |
| 341 | current_priority = priority; | 341 | current_priority = priority; |
| 342 | } | 342 | } |
| 343 | 343 | ||
| @@ -406,7 +406,7 @@ void Thread::UpdatePriority() { | |||
| 406 | if (new_priority == current_priority) | 406 | if (new_priority == current_priority) |
| 407 | return; | 407 | return; |
| 408 | 408 | ||
| 409 | Core::System::GetInstance().Scheduler().SetThreadPriority(this, new_priority); | 409 | scheduler->SetThreadPriority(this, new_priority); |
| 410 | 410 | ||
| 411 | current_priority = new_priority; | 411 | current_priority = new_priority; |
| 412 | 412 | ||
| @@ -421,7 +421,7 @@ void Thread::UpdatePriority() { | |||
| 421 | * Gets the current thread | 421 | * Gets the current thread |
| 422 | */ | 422 | */ |
| 423 | Thread* GetCurrentThread() { | 423 | Thread* GetCurrentThread() { |
| 424 | return Core::System::GetInstance().Scheduler().GetCurrentThread(); | 424 | return Core::System::GetInstance().CurrentScheduler().GetCurrentThread(); |
| 425 | } | 425 | } |
| 426 | 426 | ||
| 427 | void ThreadingInit() { | 427 | void ThreadingInit() { |
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index e0a3c0934..0a3bb1183 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <memory> | ||
| 7 | #include <string> | 8 | #include <string> |
| 8 | #include <unordered_map> | 9 | #include <unordered_map> |
| 9 | #include <vector> | 10 | #include <vector> |
| @@ -56,6 +57,7 @@ enum class ThreadWakeupReason { | |||
| 56 | namespace Kernel { | 57 | namespace Kernel { |
| 57 | 58 | ||
| 58 | class Process; | 59 | class Process; |
| 60 | class Scheduler; | ||
| 59 | 61 | ||
| 60 | class Thread final : public WaitObject { | 62 | class Thread final : public WaitObject { |
| 61 | public: | 63 | public: |
| @@ -240,6 +242,8 @@ public: | |||
| 240 | // available. In case of a timeout, the object will be nullptr. | 242 | // available. In case of a timeout, the object will be nullptr. |
| 241 | std::function<WakeupCallback> wakeup_callback; | 243 | std::function<WakeupCallback> wakeup_callback; |
| 242 | 244 | ||
| 245 | std::shared_ptr<Scheduler> scheduler; | ||
| 246 | |||
| 243 | private: | 247 | private: |
| 244 | Thread(); | 248 | Thread(); |
| 245 | ~Thread() override; | 249 | ~Thread() override; |
diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 2f0044c11..676e5b282 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp | |||
| @@ -104,8 +104,15 @@ ResultVal<VMManager::VMAHandle> VMManager::MapMemoryBlock(VAddr target, | |||
| 104 | VirtualMemoryArea& final_vma = vma_handle->second; | 104 | VirtualMemoryArea& final_vma = vma_handle->second; |
| 105 | ASSERT(final_vma.size == size); | 105 | ASSERT(final_vma.size == size); |
| 106 | 106 | ||
| 107 | Core::CPU().MapBackingMemory(target, size, block->data() + offset, | 107 | auto& system = Core::System::GetInstance(); |
| 108 | VMAPermission::ReadWriteExecute); | 108 | system.ArmInterface(0).MapBackingMemory(target, size, block->data() + offset, |
| 109 | VMAPermission::ReadWriteExecute); | ||
| 110 | system.ArmInterface(1).MapBackingMemory(target, size, block->data() + offset, | ||
| 111 | VMAPermission::ReadWriteExecute); | ||
| 112 | system.ArmInterface(2).MapBackingMemory(target, size, block->data() + offset, | ||
| 113 | VMAPermission::ReadWriteExecute); | ||
| 114 | system.ArmInterface(3).MapBackingMemory(target, size, block->data() + offset, | ||
| 115 | VMAPermission::ReadWriteExecute); | ||
| 109 | 116 | ||
| 110 | final_vma.type = VMAType::AllocatedMemoryBlock; | 117 | final_vma.type = VMAType::AllocatedMemoryBlock; |
| 111 | final_vma.permissions = VMAPermission::ReadWrite; | 118 | final_vma.permissions = VMAPermission::ReadWrite; |
| @@ -126,7 +133,11 @@ ResultVal<VMManager::VMAHandle> VMManager::MapBackingMemory(VAddr target, u8* me | |||
| 126 | VirtualMemoryArea& final_vma = vma_handle->second; | 133 | VirtualMemoryArea& final_vma = vma_handle->second; |
| 127 | ASSERT(final_vma.size == size); | 134 | ASSERT(final_vma.size == size); |
| 128 | 135 | ||
| 129 | Core::CPU().MapBackingMemory(target, size, memory, VMAPermission::ReadWriteExecute); | 136 | auto& system = Core::System::GetInstance(); |
| 137 | system.ArmInterface(0).MapBackingMemory(target, size, memory, VMAPermission::ReadWriteExecute); | ||
| 138 | system.ArmInterface(1).MapBackingMemory(target, size, memory, VMAPermission::ReadWriteExecute); | ||
| 139 | system.ArmInterface(2).MapBackingMemory(target, size, memory, VMAPermission::ReadWriteExecute); | ||
| 140 | system.ArmInterface(3).MapBackingMemory(target, size, memory, VMAPermission::ReadWriteExecute); | ||
| 130 | 141 | ||
| 131 | final_vma.type = VMAType::BackingMemory; | 142 | final_vma.type = VMAType::BackingMemory; |
| 132 | final_vma.permissions = VMAPermission::ReadWrite; | 143 | final_vma.permissions = VMAPermission::ReadWrite; |
| @@ -184,7 +195,11 @@ ResultCode VMManager::UnmapRange(VAddr target, u64 size) { | |||
| 184 | 195 | ||
| 185 | ASSERT(FindVMA(target)->second.size >= size); | 196 | ASSERT(FindVMA(target)->second.size >= size); |
| 186 | 197 | ||
| 187 | Core::CPU().UnmapMemory(target, size); | 198 | auto& system = Core::System::GetInstance(); |
| 199 | system.ArmInterface(0).UnmapMemory(target, size); | ||
| 200 | system.ArmInterface(1).UnmapMemory(target, size); | ||
| 201 | system.ArmInterface(2).UnmapMemory(target, size); | ||
| 202 | system.ArmInterface(3).UnmapMemory(target, size); | ||
| 188 | 203 | ||
| 189 | return RESULT_SUCCESS; | 204 | return RESULT_SUCCESS; |
| 190 | } | 205 | } |