diff options
| author | 2020-06-28 12:37:50 -0400 | |
|---|---|---|
| committer | 2020-06-28 12:37:50 -0400 | |
| commit | b05795d704e0c194215f815a5703db09e524b59a (patch) | |
| tree | ecf4023b4ee0c91555c1d8263762fcb9dcb04a17 /src/core/core.h | |
| parent | Merge pull request #4196 from ogniK5377/nrr-nro-fixes (diff) | |
| parent | Core/Common: Address Feedback. (diff) | |
| download | yuzu-b05795d704e0c194215f815a5703db09e524b59a.tar.gz yuzu-b05795d704e0c194215f815a5703db09e524b59a.tar.xz yuzu-b05795d704e0c194215f815a5703db09e524b59a.zip | |
Merge pull request #3955 from FernandoS27/prometheus-2b
Remake Kernel Scheduling, CPU Management & Boot Management (Prometheus)
Diffstat (limited to 'src/core/core.h')
| -rw-r--r-- | src/core/core.h | 48 |
1 files changed, 28 insertions, 20 deletions
diff --git a/src/core/core.h b/src/core/core.h index acc53d6a1..5c6cfbffe 100644 --- a/src/core/core.h +++ b/src/core/core.h | |||
| @@ -27,6 +27,7 @@ class VfsFilesystem; | |||
| 27 | namespace Kernel { | 27 | namespace Kernel { |
| 28 | class GlobalScheduler; | 28 | class GlobalScheduler; |
| 29 | class KernelCore; | 29 | class KernelCore; |
| 30 | class PhysicalCore; | ||
| 30 | class Process; | 31 | class Process; |
| 31 | class Scheduler; | 32 | class Scheduler; |
| 32 | } // namespace Kernel | 33 | } // namespace Kernel |
| @@ -90,7 +91,7 @@ class InterruptManager; | |||
| 90 | namespace Core { | 91 | namespace Core { |
| 91 | 92 | ||
| 92 | class ARM_Interface; | 93 | class ARM_Interface; |
| 93 | class CoreManager; | 94 | class CpuManager; |
| 94 | class DeviceMemory; | 95 | class DeviceMemory; |
| 95 | class ExclusiveMonitor; | 96 | class ExclusiveMonitor; |
| 96 | class FrameLimiter; | 97 | class FrameLimiter; |
| @@ -136,16 +137,16 @@ public: | |||
| 136 | }; | 137 | }; |
| 137 | 138 | ||
| 138 | /** | 139 | /** |
| 139 | * Run the core CPU loop | 140 | * Run the OS and Application |
| 140 | * This function runs the core for the specified number of CPU instructions before trying to | 141 | * This function will start emulation and run the relevant devices |
| 141 | * update hardware. This is much faster than SingleStep (and should be equivalent), as the CPU | 142 | */ |
| 142 | * is not required to do a full dispatch with each instruction. NOTE: the number of instructions | 143 | ResultStatus Run(); |
| 143 | * requested is not guaranteed to run, as this will be interrupted preemptively if a hardware | 144 | |
| 144 | * update is requested (e.g. on a thread switch). | 145 | /** |
| 145 | * @param tight_loop If false, the CPU single-steps. | 146 | * Pause the OS and Application |
| 146 | * @return Result status, indicating whether or not the operation succeeded. | 147 | * This function will pause emulation and stop the relevant devices |
| 147 | */ | 148 | */ |
| 148 | ResultStatus RunLoop(bool tight_loop = true); | 149 | ResultStatus Pause(); |
| 149 | 150 | ||
| 150 | /** | 151 | /** |
| 151 | * Step the CPU one instruction | 152 | * Step the CPU one instruction |
| @@ -209,17 +210,21 @@ public: | |||
| 209 | /// Gets the scheduler for the CPU core that is currently running | 210 | /// Gets the scheduler for the CPU core that is currently running |
| 210 | const Kernel::Scheduler& CurrentScheduler() const; | 211 | const Kernel::Scheduler& CurrentScheduler() const; |
| 211 | 212 | ||
| 213 | /// Gets the physical core for the CPU core that is currently running | ||
| 214 | Kernel::PhysicalCore& CurrentPhysicalCore(); | ||
| 215 | |||
| 216 | /// Gets the physical core for the CPU core that is currently running | ||
| 217 | const Kernel::PhysicalCore& CurrentPhysicalCore() const; | ||
| 218 | |||
| 212 | /// Gets a reference to an ARM interface for the CPU core with the specified index | 219 | /// Gets a reference to an ARM interface for the CPU core with the specified index |
| 213 | ARM_Interface& ArmInterface(std::size_t core_index); | 220 | ARM_Interface& ArmInterface(std::size_t core_index); |
| 214 | 221 | ||
| 215 | /// Gets a const reference to an ARM interface from the CPU core with the specified index | 222 | /// Gets a const reference to an ARM interface from the CPU core with the specified index |
| 216 | const ARM_Interface& ArmInterface(std::size_t core_index) const; | 223 | const ARM_Interface& ArmInterface(std::size_t core_index) const; |
| 217 | 224 | ||
| 218 | /// Gets a CPU interface to the CPU core with the specified index | 225 | CpuManager& GetCpuManager(); |
| 219 | CoreManager& GetCoreManager(std::size_t core_index); | ||
| 220 | 226 | ||
| 221 | /// Gets a CPU interface to the CPU core with the specified index | 227 | const CpuManager& GetCpuManager() const; |
| 222 | const CoreManager& GetCoreManager(std::size_t core_index) const; | ||
| 223 | 228 | ||
| 224 | /// Gets a reference to the exclusive monitor | 229 | /// Gets a reference to the exclusive monitor |
| 225 | ExclusiveMonitor& Monitor(); | 230 | ExclusiveMonitor& Monitor(); |
| @@ -370,14 +375,17 @@ public: | |||
| 370 | /// Register a host thread as an auxiliary thread. | 375 | /// Register a host thread as an auxiliary thread. |
| 371 | void RegisterHostThread(); | 376 | void RegisterHostThread(); |
| 372 | 377 | ||
| 373 | private: | 378 | /// Enter Dynarmic Microprofile |
| 374 | System(); | 379 | void EnterDynarmicProfile(); |
| 380 | |||
| 381 | /// Exit Dynarmic Microprofile | ||
| 382 | void ExitDynarmicProfile(); | ||
| 375 | 383 | ||
| 376 | /// Returns the currently running CPU core | 384 | /// Tells if system is running on multicore. |
| 377 | CoreManager& CurrentCoreManager(); | 385 | bool IsMulticore() const; |
| 378 | 386 | ||
| 379 | /// Returns the currently running CPU core | 387 | private: |
| 380 | const CoreManager& CurrentCoreManager() const; | 388 | System(); |
| 381 | 389 | ||
| 382 | /** | 390 | /** |
| 383 | * Initialize the emulated system. | 391 | * Initialize the emulated system. |