From 559024593086d04e24a99a9f77490a3f97cf952d Mon Sep 17 00:00:00 2001 From: bunnei Date: Tue, 1 May 2018 22:21:38 -0400 Subject: core: Move common CPU core things to its own class. --- src/core/core_cpu.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/core/core_cpu.h (limited to 'src/core/core_cpu.h') 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 @@ +// Copyright 2018 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include +#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; + std::unique_ptr scheduler; + + bool reschedule_pending{}; +}; + +} // namespace Core -- cgit v1.2.3