diff options
| author | 2020-03-01 12:14:17 -0400 | |
|---|---|---|
| committer | 2020-06-27 11:35:58 -0400 | |
| commit | 1567824d2da8e9b49b433f3d1d753d8ad84e65f9 (patch) | |
| tree | c9553bb3f1693e430054695737d2f87ba4b58955 /src/core/core.cpp | |
| parent | Core: Refactor ARM Interface. (diff) | |
| download | yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.gz yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.tar.xz yuzu-1567824d2da8e9b49b433f3d1d753d8ad84e65f9.zip | |
General: Move ARM_Interface into Threads.
Diffstat (limited to 'src/core/core.cpp')
| -rw-r--r-- | src/core/core.cpp | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 2ca9c0be5..40eea297e 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -119,14 +119,6 @@ struct System::Impl { | |||
| 119 | : kernel{system}, fs_controller{system}, memory{system}, | 119 | : kernel{system}, fs_controller{system}, memory{system}, |
| 120 | cpu_manager{system}, reporter{system}, applet_manager{system} {} | 120 | cpu_manager{system}, reporter{system}, applet_manager{system} {} |
| 121 | 121 | ||
| 122 | Kernel::PhysicalCore& CurrentPhysicalCore() { | ||
| 123 | return kernel.CurrentPhysicalCore(); | ||
| 124 | } | ||
| 125 | |||
| 126 | Kernel::PhysicalCore& GetPhysicalCore(std::size_t index) { | ||
| 127 | return kernel.PhysicalCore(index); | ||
| 128 | } | ||
| 129 | |||
| 130 | ResultStatus Run() { | 122 | ResultStatus Run() { |
| 131 | status = ResultStatus::Success; | 123 | status = ResultStatus::Success; |
| 132 | 124 | ||
| @@ -443,7 +435,7 @@ bool System::IsPoweredOn() const { | |||
| 443 | } | 435 | } |
| 444 | 436 | ||
| 445 | void System::PrepareReschedule() { | 437 | void System::PrepareReschedule() { |
| 446 | impl->CurrentPhysicalCore().Stop(); | 438 | //impl->CurrentPhysicalCore().Stop(); |
| 447 | } | 439 | } |
| 448 | 440 | ||
| 449 | void System::PrepareReschedule(const u32 core_index) { | 441 | void System::PrepareReschedule(const u32 core_index) { |
| @@ -463,11 +455,11 @@ const TelemetrySession& System::TelemetrySession() const { | |||
| 463 | } | 455 | } |
| 464 | 456 | ||
| 465 | ARM_Interface& System::CurrentArmInterface() { | 457 | ARM_Interface& System::CurrentArmInterface() { |
| 466 | return impl->CurrentPhysicalCore().ArmInterface(); | 458 | return impl->kernel.CurrentScheduler().GetCurrentThread()->ArmInterface(); |
| 467 | } | 459 | } |
| 468 | 460 | ||
| 469 | const ARM_Interface& System::CurrentArmInterface() const { | 461 | const ARM_Interface& System::CurrentArmInterface() const { |
| 470 | return impl->CurrentPhysicalCore().ArmInterface(); | 462 | return impl->kernel.CurrentScheduler().GetCurrentThread()->ArmInterface(); |
| 471 | } | 463 | } |
| 472 | 464 | ||
| 473 | std::size_t System::CurrentCoreIndex() const { | 465 | std::size_t System::CurrentCoreIndex() const { |
| @@ -477,27 +469,27 @@ std::size_t System::CurrentCoreIndex() const { | |||
| 477 | } | 469 | } |
| 478 | 470 | ||
| 479 | Kernel::Scheduler& System::CurrentScheduler() { | 471 | Kernel::Scheduler& System::CurrentScheduler() { |
| 480 | return impl->CurrentPhysicalCore().Scheduler(); | 472 | return impl->kernel.CurrentScheduler(); |
| 481 | } | 473 | } |
| 482 | 474 | ||
| 483 | const Kernel::Scheduler& System::CurrentScheduler() const { | 475 | const Kernel::Scheduler& System::CurrentScheduler() const { |
| 484 | return impl->CurrentPhysicalCore().Scheduler(); | 476 | return impl->kernel.CurrentScheduler(); |
| 485 | } | 477 | } |
| 486 | 478 | ||
| 487 | Kernel::PhysicalCore& System::CurrentPhysicalCore() { | 479 | Kernel::PhysicalCore& System::CurrentPhysicalCore() { |
| 488 | return impl->CurrentPhysicalCore(); | 480 | return impl->kernel.CurrentPhysicalCore(); |
| 489 | } | 481 | } |
| 490 | 482 | ||
| 491 | const Kernel::PhysicalCore& System::CurrentPhysicalCore() const { | 483 | const Kernel::PhysicalCore& System::CurrentPhysicalCore() const { |
| 492 | return impl->CurrentPhysicalCore(); | 484 | return impl->kernel.CurrentPhysicalCore(); |
| 493 | } | 485 | } |
| 494 | 486 | ||
| 495 | Kernel::Scheduler& System::Scheduler(std::size_t core_index) { | 487 | Kernel::Scheduler& System::Scheduler(std::size_t core_index) { |
| 496 | return impl->GetPhysicalCore(core_index).Scheduler(); | 488 | return impl->kernel.Scheduler(core_index); |
| 497 | } | 489 | } |
| 498 | 490 | ||
| 499 | const Kernel::Scheduler& System::Scheduler(std::size_t core_index) const { | 491 | const Kernel::Scheduler& System::Scheduler(std::size_t core_index) const { |
| 500 | return impl->GetPhysicalCore(core_index).Scheduler(); | 492 | return impl->kernel.Scheduler(core_index); |
| 501 | } | 493 | } |
| 502 | 494 | ||
| 503 | /// Gets the global scheduler | 495 | /// Gets the global scheduler |
| @@ -527,11 +519,15 @@ const Kernel::Process* System::CurrentProcess() const { | |||
| 527 | } | 519 | } |
| 528 | 520 | ||
| 529 | ARM_Interface& System::ArmInterface(std::size_t core_index) { | 521 | ARM_Interface& System::ArmInterface(std::size_t core_index) { |
| 530 | return impl->GetPhysicalCore(core_index).ArmInterface(); | 522 | auto* thread = impl->kernel.Scheduler(core_index).GetCurrentThread(); |
| 523 | ASSERT(thread && !thread->IsHLEThread()); | ||
| 524 | return thread->ArmInterface(); | ||
| 531 | } | 525 | } |
| 532 | 526 | ||
| 533 | const ARM_Interface& System::ArmInterface(std::size_t core_index) const { | 527 | const ARM_Interface& System::ArmInterface(std::size_t core_index) const { |
| 534 | return impl->GetPhysicalCore(core_index).ArmInterface(); | 528 | auto* thread = impl->kernel.Scheduler(core_index).GetCurrentThread(); |
| 529 | ASSERT(thread && !thread->IsHLEThread()); | ||
| 530 | return thread->ArmInterface(); | ||
| 535 | } | 531 | } |
| 536 | 532 | ||
| 537 | ExclusiveMonitor& System::Monitor() { | 533 | ExclusiveMonitor& System::Monitor() { |