aboutsummaryrefslogtreecommitdiff
path: root/src/core/core_cpu.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-05-01 22:21:38 -0400
committerbunnei <bunneidev@gmail.com>2018-05-10 19:34:46 -0400
commit0867e78c8a75d9c637b0b36753ca78f3e8ffcc2b (patch)
tree0b9163a33ae973bd69cb3883bea1e91a3581f527 /src/core/core_cpu.h
parente37fc58ae6a494592a45fc50cba41a04a199ffbe (diff)
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.h46
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 0000000000..312db16557
--- /dev/null
+++ b/src/core/core_cpu.h
@@ -0,0 +1,46 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include "common/common_types.h"
+
+class ARM_Interface;
+
+namespace Kernel {
+class Scheduler;
+}
+
+namespace Core {
+
+class Cpu {
+public:
+ Cpu();
+
+ void RunLoop(bool tight_loop = true);
+
+ void SingleStep();
+
+ void PrepareReschedule();
+
+ ARM_Interface& CPU() {
+ return *arm_interface;
+ }
+
+ Kernel::Scheduler& Scheduler() {
+ return *scheduler;
+ }
+
+private:
+ void Reschedule();
+
+ std::shared_ptr<ARM_Interface> arm_interface;
+ std::unique_ptr<Kernel::Scheduler> scheduler;
+
+ bool reschedule_pending{};
+};
+
+} // namespace Core