diff options
| author | 2018-05-01 22:21:38 -0400 | |
|---|---|---|
| committer | 2018-05-10 19:34:46 -0400 | |
| commit | 559024593086d04e24a99a9f77490a3f97cf952d (patch) | |
| tree | 0b9163a33ae973bd69cb3883bea1e91a3581f527 /src/core/core_cpu.h | |
| parent | Stubs for QLaunch (#428) (diff) | |
| download | yuzu-559024593086d04e24a99a9f77490a3f97cf952d.tar.gz yuzu-559024593086d04e24a99a9f77490a3f97cf952d.tar.xz yuzu-559024593086d04e24a99a9f77490a3f97cf952d.zip | |
core: Move common CPU core things to its own class.
Diffstat (limited to 'src/core/core_cpu.h')
| -rw-r--r-- | src/core/core_cpu.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/core/core_cpu.h b/src/core/core_cpu.h new file mode 100644 index 000000000..312db1655 --- /dev/null +++ b/src/core/core_cpu.h | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | // Copyright 2018 yuzu emulator team | ||
| 2 | // Licensed under GPLv2 or any later version | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include <memory> | ||
| 8 | #include <string> | ||
| 9 | #include "common/common_types.h" | ||
| 10 | |||
| 11 | class ARM_Interface; | ||
| 12 | |||
| 13 | namespace Kernel { | ||
| 14 | class Scheduler; | ||
| 15 | } | ||
| 16 | |||
| 17 | namespace Core { | ||
| 18 | |||
| 19 | class Cpu { | ||
| 20 | public: | ||
| 21 | Cpu(); | ||
| 22 | |||
| 23 | void RunLoop(bool tight_loop = true); | ||
| 24 | |||
| 25 | void SingleStep(); | ||
| 26 | |||
| 27 | void PrepareReschedule(); | ||
| 28 | |||
| 29 | ARM_Interface& CPU() { | ||
| 30 | return *arm_interface; | ||
| 31 | } | ||
| 32 | |||
| 33 | Kernel::Scheduler& Scheduler() { | ||
| 34 | return *scheduler; | ||
| 35 | } | ||
| 36 | |||
| 37 | private: | ||
| 38 | void Reschedule(); | ||
| 39 | |||
| 40 | std::shared_ptr<ARM_Interface> arm_interface; | ||
| 41 | std::unique_ptr<Kernel::Scheduler> scheduler; | ||
| 42 | |||
| 43 | bool reschedule_pending{}; | ||
| 44 | }; | ||
| 45 | |||
| 46 | } // namespace Core | ||