diff options
author | Nilay Vaish <nilay@cs.wisc.edu> | 2012-08-27 01:00:54 -0500 |
---|---|---|
committer | Nilay Vaish <nilay@cs.wisc.edu> | 2012-08-27 01:00:54 -0500 |
commit | 7122b83d8f92d77bccae432b4e90ba12f1babad5 (patch) | |
tree | 60cb8d9ddaea5e6032a78ea1a1486fd0f0b1d5a2 /src | |
parent | 1032bc72eda3026ac1c3ff4d3243efbb4f503ce6 (diff) | |
download | gem5-7122b83d8f92d77bccae432b4e90ba12f1babad5.tar.xz |
Ruby Memory Vector: Allow more than 4GB of memory
The memory size variable was a 32-bit int. This meant that the size of the
memory was limited to 4GB. This patch changes the type of the variable to
64-bit to support larger memory sizes. Thanks to Raghuraman Balasubramanian
for bringing this to notice.
Diffstat (limited to 'src')
-rw-r--r-- | src/mem/ruby/system/MemoryVector.hh | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mem/ruby/system/MemoryVector.hh b/src/mem/ruby/system/MemoryVector.hh index 315e00942..f8e407942 100644 --- a/src/mem/ruby/system/MemoryVector.hh +++ b/src/mem/ruby/system/MemoryVector.hh @@ -42,11 +42,11 @@ class MemoryVector { public: MemoryVector(); - MemoryVector(uint32 size); + MemoryVector(uint64 size); ~MemoryVector(); friend class DirectoryMemory; - void resize(uint32 size); // destructive + void resize(uint64 size); // destructive void write(const Address & paddr, uint8* data, int len); uint8* read(const Address & paddr, uint8* data, int len); @@ -56,7 +56,7 @@ class MemoryVector private: uint8* getBlockPtr(const PhysAddress & addr); - uint32 m_size; + uint64 m_size; uint8** m_pages; uint32 m_num_pages; const uint32 m_page_offset_mask; @@ -73,7 +73,7 @@ MemoryVector::MemoryVector() } inline -MemoryVector::MemoryVector(uint32 size) +MemoryVector::MemoryVector(uint64 size) : m_page_offset_mask(4095) { resize(size); @@ -91,7 +91,7 @@ MemoryVector::~MemoryVector() } inline void -MemoryVector::resize(uint32 size) +MemoryVector::resize(uint64 size) { if (m_pages != NULL){ for (int i = 0; i < m_num_pages; i++) { |