mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-22 10:42:36 +01:00
small change to unmapping functions
This commit is contained in:
parent
6504ddede4
commit
8514a14cf4
@ -576,32 +576,34 @@ u64 VirtualMemoryBlock::Map(u64 realaddr, u32 size, u64 addr)
|
||||
}
|
||||
}
|
||||
|
||||
bool VirtualMemoryBlock::UnmapRealAddress(u64 realaddr)
|
||||
u32 VirtualMemoryBlock::UnmapRealAddress(u64 realaddr)
|
||||
{
|
||||
for(u32 i=0; i<m_mapped_memory.GetCount(); ++i)
|
||||
{
|
||||
if(m_mapped_memory[i].realAddress == realaddr && IsInMyRange(m_mapped_memory[i].addr, m_mapped_memory[i].size))
|
||||
{
|
||||
u32 size = m_mapped_memory[i].size;
|
||||
m_mapped_memory.RemoveAt(i);
|
||||
return true;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool VirtualMemoryBlock::UnmapAddress(u64 addr)
|
||||
u32 VirtualMemoryBlock::UnmapAddress(u64 addr)
|
||||
{
|
||||
for(u32 i=0; i<m_mapped_memory.GetCount(); ++i)
|
||||
{
|
||||
if(m_mapped_memory[i].addr == addr && IsInMyRange(m_mapped_memory[i].addr, m_mapped_memory[i].size))
|
||||
{
|
||||
u32 size = m_mapped_memory[i].size;
|
||||
m_mapped_memory.RemoveAt(i);
|
||||
return true;
|
||||
return size;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool VirtualMemoryBlock::Read8(const u64 addr, u8* value)
|
||||
|
@ -240,11 +240,11 @@ public:
|
||||
// first mappable space is used)
|
||||
virtual u64 Map(u64 realaddr, u32 size, u64 addr = 0);
|
||||
|
||||
// Unmap real address (please specify only starting point, no midway memory will be unmapped)
|
||||
virtual bool UnmapRealAddress(u64 realaddr);
|
||||
// Unmap real address (please specify only starting point, no midway memory will be unmapped), returns the size of the unmapped area
|
||||
virtual u32 UnmapRealAddress(u64 realaddr);
|
||||
|
||||
// Unmap address (please specify only starting point, no midway memory will be unmapped)
|
||||
virtual bool UnmapAddress(u64 addr);
|
||||
// Unmap address (please specify only starting point, no midway memory will be unmapped), returns the size of the unmapped area
|
||||
virtual u32 UnmapAddress(u64 addr);
|
||||
|
||||
// Reserve a certain amount so no one can use it, returns true on succces, false on failure
|
||||
virtual bool Reserve(u32 size);
|
||||
|
Loading…
Reference in New Issue
Block a user