General: Recover Prometheus project from harddrive failure

This commit: Implements CPU Interrupts, Replaces Cycle Timing for Host 
Timing, Reworks the Kernel's Scheduler, Introduce Idle State and 
Suspended State, Recreates the bootmanager, Initializes Multicore 
system.
This commit is contained in:
Fernando Sahmkow
2020-02-24 22:04:12 -04:00
parent 0ea4a8bcc4
commit e31425df38
57 changed files with 1349 additions and 824 deletions

View File

@@ -52,6 +52,8 @@ void EmuThread::run() {
emit LoadProgress(VideoCore::LoadCallbackStage::Prepare, 0, 0);
Core::System::GetInstance().RegisterHostThread();
Core::System::GetInstance().Renderer().Rasterizer().LoadDiskResources(
stop_run, [this](VideoCore::LoadCallbackStage stage, std::size_t value, std::size_t total) {
emit LoadProgress(stage, value, total);
@@ -65,28 +67,30 @@ void EmuThread::run() {
bool was_active = false;
while (!stop_run) {
if (running) {
if (!was_active)
if (was_active) {
emit DebugModeLeft();
}
Core::System::ResultStatus result = Core::System::GetInstance().RunLoop();
running_guard = true;
Core::System::ResultStatus result = Core::System::GetInstance().Run();
if (result != Core::System::ResultStatus::Success) {
running_guard = false;
this->SetRunning(false);
emit ErrorThrown(result, Core::System::GetInstance().GetStatusDetails());
}
running_wait.Wait();
result = Core::System::GetInstance().Pause();
if (result != Core::System::ResultStatus::Success) {
running_guard = false;
this->SetRunning(false);
emit ErrorThrown(result, Core::System::GetInstance().GetStatusDetails());
}
running_guard = false;
was_active = running || exec_step;
if (!was_active && !stop_run)
emit DebugModeEntered();
} else if (exec_step) {
if (!was_active)
emit DebugModeLeft();
exec_step = false;
Core::System::GetInstance().SingleStep();
was_active = true;
emit DebugModeEntered();
yieldCurrentThread();
was_active = false;
} else if (exec_step) {
UNIMPLEMENTED();
} else {
std::unique_lock lock{running_mutex};
running_cv.wait(lock, [this] { return IsRunning() || exec_step || stop_run; });

View File

@@ -59,6 +59,11 @@ public:
this->running = running;
lock.unlock();
running_cv.notify_all();
if (!running) {
running_wait.Set();
/// Wait until effectively paused
while (running_guard);
}
}
/**
@@ -84,6 +89,8 @@ private:
std::atomic_bool stop_run{false};
std::mutex running_mutex;
std::condition_variable running_cv;
Common::Event running_wait{};
std::atomic_bool running_guard{false};
signals:
/**

View File

@@ -59,8 +59,10 @@ std::vector<std::unique_ptr<WaitTreeThread>> WaitTreeItem::MakeThreadItemList()
std::size_t row = 0;
auto add_threads = [&](const std::vector<std::shared_ptr<Kernel::Thread>>& threads) {
for (std::size_t i = 0; i < threads.size(); ++i) {
item_list.push_back(std::make_unique<WaitTreeThread>(*threads[i]));
item_list.back()->row = row;
if (!threads[i]->IsHLEThread()) {
item_list.push_back(std::make_unique<WaitTreeThread>(*threads[i]));
item_list.back()->row = row;
}
++row;
}
};