mirror of
https://github.com/libretro/Play-.git
synced 2025-02-08 10:06:43 +00:00
When unloading module, clear block cache range.
This commit is contained in:
parent
815aeaac7d
commit
932a72cb80
@ -79,7 +79,7 @@ CPS2VM::CPS2VM()
|
||||
}
|
||||
|
||||
m_iop = std::make_unique<Iop::CSubSystem>(true);
|
||||
m_iopOs = std::make_shared<CIopBios>(m_iop->m_cpu, m_iop->m_ram, PS2::IOP_RAM_SIZE, m_iop->m_scratchPad);
|
||||
m_iopOs = std::make_shared<CIopBios>(m_iop->m_cpu, m_iop->m_executor, m_iop->m_ram, PS2::IOP_RAM_SIZE, m_iop->m_scratchPad);
|
||||
|
||||
m_ee = std::make_unique<Ee::CSubSystem>(m_iop->m_ram, *m_iopOs);
|
||||
m_ee->m_os->OnRequestLoadExecutable.connect(boost::bind(&CPS2VM::ReloadExecutable, this, _1, _2));
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include "../Log.h"
|
||||
#include "../ElfFile.h"
|
||||
#include "../Ps2Const.h"
|
||||
#include "../MipsExecutor.h"
|
||||
#include "PtrStream.h"
|
||||
#include "Iop_Intc.h"
|
||||
#include "lexical_cast_ex.h"
|
||||
@ -76,8 +77,9 @@
|
||||
//This is the space needed to preserve at most four arguments in the stack frame (as per MIPS calling convention)
|
||||
#define STACK_FRAME_RESERVE_SIZE 0x10
|
||||
|
||||
CIopBios::CIopBios(CMIPS& cpu, uint8* ram, uint32 ramSize, uint8* spr)
|
||||
CIopBios::CIopBios(CMIPS& cpu, CMipsExecutor& cpuExecutor, uint8* ram, uint32 ramSize, uint8* spr)
|
||||
: m_cpu(cpu)
|
||||
, m_cpuExecutor(cpuExecutor)
|
||||
, m_ram(ram)
|
||||
, m_ramSize(ramSize)
|
||||
, m_spr(spr)
|
||||
@ -605,6 +607,7 @@ int32 CIopBios::LoadModule(CELF& elf, const char* path)
|
||||
//Fill in module info
|
||||
strncpy(loadedModule->name, moduleName.c_str(), LOADEDMODULE::MAX_NAME_SIZE);
|
||||
loadedModule->start = moduleRange.first;
|
||||
loadedModule->end = moduleRange.second;
|
||||
loadedModule->entryPoint = entryPoint;
|
||||
loadedModule->gp = iopMod ? (iopMod->gp + moduleRange.first) : 0;
|
||||
loadedModule->state = MODULE_STATE::STOPPED;
|
||||
@ -643,6 +646,10 @@ int32 CIopBios::UnloadModule(uint32 loadedModuleId)
|
||||
return -1;
|
||||
}
|
||||
|
||||
//TODO: Remove module from IOP module list?
|
||||
//TODO: Invalidate MIPS analysis range?
|
||||
m_cpuExecutor.ClearActiveBlocksInRange(loadedModule->start, loadedModule->end);
|
||||
|
||||
//TODO: Check return value here.
|
||||
m_sysmem->FreeMemory(loadedModule->start);
|
||||
m_loadedModules.Free(loadedModuleId);
|
||||
|
@ -25,6 +25,8 @@
|
||||
#include "Iop_Cdvdfsv.h"
|
||||
#endif
|
||||
|
||||
class CMipsExecutor;
|
||||
|
||||
class CIopBios : public Iop::CBiosBase
|
||||
{
|
||||
public:
|
||||
@ -121,7 +123,7 @@ public:
|
||||
uint32 reserved[4];
|
||||
};
|
||||
|
||||
CIopBios(CMIPS&, uint8*, uint32, uint8*);
|
||||
CIopBios(CMIPS&, CMipsExecutor&, uint8*, uint32, uint8*);
|
||||
virtual ~CIopBios();
|
||||
|
||||
int32 LoadModule(const char*);
|
||||
@ -419,6 +421,7 @@ private:
|
||||
uint32 isValid;
|
||||
char name[MAX_NAME_SIZE];
|
||||
uint32 start;
|
||||
uint32 end;
|
||||
uint32 entryPoint;
|
||||
uint32 gp;
|
||||
MODULE_STATE state;
|
||||
@ -508,6 +511,7 @@ private:
|
||||
#endif
|
||||
|
||||
CMIPS& m_cpu;
|
||||
CMipsExecutor& m_cpuExecutor;
|
||||
uint8* m_ram = nullptr;
|
||||
uint32 m_ramSize;
|
||||
uint8* m_spr = nullptr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user