Implement reserved memory in virtual memory block

This commit is contained in:
elisha464 2014-01-21 19:55:48 +02:00
parent 4e4dd43646
commit 66a481d4bc
2 changed files with 38 additions and 4 deletions

View file

@ -226,6 +226,7 @@ private:
class VirtualMemoryBlock : public MemoryBlock
{
Array<VirtualMemInfo> m_mapped_memory;
u32 m_reserve_size;
public:
VirtualMemoryBlock();
@ -245,6 +246,15 @@ public:
// Unmap address (please specify only starting point, no midway memory will be unmapped)
virtual bool 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);
// Unreserve a certain amount of bytes, returns true on succcess, false if size is bigger than the reserved amount
virtual bool Unreserve(u32 size);
// Return the total amount of reserved memory
virtual u32 GetResevedAmount();
virtual bool Read8(const u64 addr, u8* value);
virtual bool Read16(const u64 addr, u16* value);
virtual bool Read32(const u64 addr, u32* value);