Stop LV2 Watchdog when CELL_SYSUTIL_REQUEST_EXITGAME is issued

This commit is contained in:
brian218 2022-12-15 11:12:03 +08:00 committed by Ivan
parent d78e2dad29
commit 812224f7f7
3 changed files with 16 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#include "Emu/Cell/PPUModule.h"
#include "Emu/Cell/Modules/cellGame.h"
#include "Emu/Cell/lv2/sys_game.h"
#include "Emu/Cell/lv2/sys_process.h"
#include "cellSysutil.h"
@ -126,6 +127,10 @@ extern s32 sysutil_send_system_cmd(u64 status, u64 param)
return -1;
}
}
else if (status == CELL_SYSUTIL_REQUEST_EXITGAME)
{
abort_lv2_watchdog();
}
for (sysutil_cb_manager::registered_cb cb : cbm->callbacks)
{

View File

@ -82,6 +82,15 @@ struct watchdog_t
static constexpr auto thread_name = "LV2 Watchdog Thread"sv;
};
void abort_lv2_watchdog()
{
if (auto thr = g_fxo->try_get<named_thread<watchdog_t>>())
{
sys_game.notice("Aborting %s...", thr->thread_name);
*thr = thread_state::aborting;
}
}
error_code _sys_game_watchdog_start(u32 timeout)
{
sys_game.trace("sys_game_watchdog_start(timeout=%d)", timeout);

View File

@ -1,5 +1,7 @@
#pragma once
void abort_lv2_watchdog();
error_code _sys_game_watchdog_start(u32 timeout);
error_code _sys_game_watchdog_stop();
error_code _sys_game_watchdog_clear();