mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-10 23:45:16 +01:00
USB: Stop sending USB replies after prx_unload
This commit is contained in:
parent
01fe12483f
commit
2a72502984
|
|
@ -51,6 +51,7 @@ std::unordered_map<std::string, ppu_static_module*>& ppu_module_manager::get()
|
|||
std::vector<std::string> g_ppu_function_names;
|
||||
|
||||
atomic_t<u32> liblv2_begin = 0, liblv2_end = 0;
|
||||
atomic_t<bool> libusbd_active = false;
|
||||
|
||||
extern u32 ppu_generate_id(std::string_view name)
|
||||
{
|
||||
|
|
@ -1919,6 +1920,10 @@ shared_ptr<lv2_prx> ppu_load_prx(const ppu_prx_object& elf, bool virtual_load, c
|
|||
liblv2_begin = prx->segs[0].addr;
|
||||
liblv2_end = prx->segs[0].addr + prx->segs[0].size;
|
||||
}
|
||||
if (prx->path.ends_with("sys/external/libusbd.sprx"sv))
|
||||
{
|
||||
libusbd_active = true;
|
||||
}
|
||||
|
||||
std::vector<u32> applied;
|
||||
|
||||
|
|
@ -2053,6 +2058,10 @@ void ppu_unload_prx(const lv2_prx& prx)
|
|||
liblv2_begin = 0;
|
||||
liblv2_end = 0;
|
||||
}
|
||||
if (prx.path.ends_with("sys/external/libusbd.sprx"sv))
|
||||
{
|
||||
libusbd_active = false;
|
||||
}
|
||||
|
||||
// Format patch name
|
||||
std::string hash = fmt::format("PRX-%s", fmt::base57(prx.sha1));
|
||||
|
|
|
|||
|
|
@ -55,6 +55,8 @@ cfg_guncon3 g_cfg_guncon3;
|
|||
cfg_topshotelite g_cfg_topshotelite;
|
||||
cfg_topshotfearmaster g_cfg_topshotfearmaster;
|
||||
|
||||
extern atomic_t<bool> libusbd_active;
|
||||
|
||||
template <>
|
||||
void fmt_class_string<libusb_transfer>::format(std::string& out, u64 arg)
|
||||
{
|
||||
|
|
@ -636,7 +638,7 @@ void usb_handler_thread::operator()()
|
|||
u64 delay = 1'000;
|
||||
|
||||
// Process fake transfers
|
||||
if (!fake_transfers.empty())
|
||||
if (libusbd_active && !fake_transfers.empty())
|
||||
{
|
||||
std::lock_guard lock_tf(mutex_transfers);
|
||||
u64 timestamp = get_system_time() - Emu.GetPauseTime();
|
||||
|
|
@ -1099,7 +1101,7 @@ error_code sys_usbd_finalize(ppu_thread& ppu, u32 handle)
|
|||
// Forcefully awake all waiters
|
||||
while (auto cpu = lv2_obj::schedule<ppu_thread>(usbh.sq, SYS_SYNC_FIFO))
|
||||
{
|
||||
// Special ternimation signal value
|
||||
// Special termination signal value
|
||||
cpu->gpr[4] = 4;
|
||||
cpu->gpr[5] = 0;
|
||||
cpu->gpr[6] = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue