diff options
Diffstat (limited to 'src/core/core.h')
-rw-r--r-- | src/core/core.h | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/src/core/core.h b/src/core/core.h index acc53d6a1..83ded63a5 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -27,6 +27,7 @@ class VfsFilesystem; namespace Kernel { class GlobalScheduler; class KernelCore; +class PhysicalCore; class Process; class Scheduler; } // namespace Kernel @@ -90,7 +91,7 @@ class InterruptManager; namespace Core { class ARM_Interface; -class CoreManager; +class CpuManager; class DeviceMemory; class ExclusiveMonitor; class FrameLimiter; @@ -136,16 +137,16 @@ public: }; /** - * Run the core CPU loop - * This function runs the core for the specified number of CPU instructions before trying to - * update hardware. This is much faster than SingleStep (and should be equivalent), as the CPU - * is not required to do a full dispatch with each instruction. NOTE: the number of instructions - * requested is not guaranteed to run, as this will be interrupted preemptively if a hardware - * update is requested (e.g. on a thread switch). - * @param tight_loop If false, the CPU single-steps. - * @return Result status, indicating whether or not the operation succeeded. + * Run the OS and Application + * This function will start emulation and run the relevant devices + */ + ResultStatus Run(); + + /** + * Pause the OS and Application + * This function will pause emulation and stop the relevant devices */ - ResultStatus RunLoop(bool tight_loop = true); + ResultStatus Pause(); /** * Step the CPU one instruction @@ -209,17 +210,21 @@ public: /// Gets the scheduler for the CPU core that is currently running const Kernel::Scheduler& CurrentScheduler() const; + /// Gets the physical core for the CPU core that is currently running + Kernel::PhysicalCore& CurrentPhysicalCore(); + + /// Gets the physical core for the CPU core that is currently running + const Kernel::PhysicalCore& CurrentPhysicalCore() const; + /// Gets a reference to an ARM interface for the CPU core with the specified index ARM_Interface& ArmInterface(std::size_t core_index); /// Gets a const reference to an ARM interface from the CPU core with the specified index const ARM_Interface& ArmInterface(std::size_t core_index) const; - /// Gets a CPU interface to the CPU core with the specified index - CoreManager& GetCoreManager(std::size_t core_index); + CpuManager& GetCpuManager(); - /// Gets a CPU interface to the CPU core with the specified index - const CoreManager& GetCoreManager(std::size_t core_index) const; + const CpuManager& GetCpuManager() const; /// Gets a reference to the exclusive monitor ExclusiveMonitor& Monitor(); @@ -311,9 +316,9 @@ public: Service::SM::ServiceManager& ServiceManager(); const Service::SM::ServiceManager& ServiceManager() const; - void SetFilesystem(std::shared_ptr<FileSys::VfsFilesystem> vfs); + void SetFilesystem(FileSys::VirtualFilesystem vfs); - std::shared_ptr<FileSys::VfsFilesystem> GetFilesystem() const; + FileSys::VirtualFilesystem GetFilesystem() const; void RegisterCheatList(const std::vector<Memory::CheatEntry>& list, const std::array<u8, 0x20>& build_id, VAddr main_region_begin, @@ -370,14 +375,17 @@ public: /// Register a host thread as an auxiliary thread. void RegisterHostThread(); -private: - System(); + /// Enter Dynarmic Microprofile + void EnterDynarmicProfile(); + + /// Exit Dynarmic Microprofile + void ExitDynarmicProfile(); - /// Returns the currently running CPU core - CoreManager& CurrentCoreManager(); + /// Tells if system is running on multicore. + bool IsMulticore() const; - /// Returns the currently running CPU core - const CoreManager& CurrentCoreManager() const; +private: + System(); /** * Initialize the emulated system. |