diff options
Diffstat (limited to 'src/mem/ruby/system')
-rw-r--r-- | src/mem/ruby/system/DMASequencer.hh | 2 | ||||
-rw-r--r-- | src/mem/ruby/system/MemoryVector.hh | 40 | ||||
-rw-r--r-- | src/mem/ruby/system/RubyPort.cc | 4 | ||||
-rw-r--r-- | src/mem/ruby/system/System.cc | 8 | ||||
-rw-r--r-- | src/mem/ruby/system/System.hh | 4 |
5 files changed, 29 insertions, 29 deletions
diff --git a/src/mem/ruby/system/DMASequencer.hh b/src/mem/ruby/system/DMASequencer.hh index ce85c20c7..d8a6ef059 100644 --- a/src/mem/ruby/system/DMASequencer.hh +++ b/src/mem/ruby/system/DMASequencer.hh @@ -43,7 +43,7 @@ struct DMARequest bool write; int bytes_completed; int bytes_issued; - uint8* data; + uint8_t *data; PacketPtr pkt; }; diff --git a/src/mem/ruby/system/MemoryVector.hh b/src/mem/ruby/system/MemoryVector.hh index f8e407942..60707037d 100644 --- a/src/mem/ruby/system/MemoryVector.hh +++ b/src/mem/ruby/system/MemoryVector.hh @@ -48,16 +48,16 @@ class MemoryVector void resize(uint64 size); // destructive - void write(const Address & paddr, uint8* data, int len); - uint8* read(const Address & paddr, uint8* data, int len); - uint32 collatePages(uint8* &raw_data); - void populatePages(uint8* raw_data); + void write(const Address & paddr, uint8_t *data, int len); + uint8_t *read(const Address & paddr, uint8_t *data, int len); + uint32 collatePages(uint8_t *&raw_data); + void populatePages(uint8_t *raw_data); private: - uint8* getBlockPtr(const PhysAddress & addr); + uint8_t *getBlockPtr(const PhysAddress & addr); uint64 m_size; - uint8** m_pages; + uint8_t **m_pages; uint32 m_num_pages; const uint32 m_page_offset_mask; static const uint32 PAGE_SIZE = 4096; @@ -104,12 +104,12 @@ MemoryVector::resize(uint64 size) m_size = size; assert(size%PAGE_SIZE == 0); m_num_pages = size >> 12; - m_pages = new uint8*[m_num_pages]; - memset(m_pages, 0, m_num_pages * sizeof(uint8*)); + m_pages = new uint8_t*[m_num_pages]; + memset(m_pages, 0, m_num_pages * sizeof(uint8_t*)); } inline void -MemoryVector::write(const Address & paddr, uint8* data, int len) +MemoryVector::write(const Address & paddr, uint8_t *data, int len) { assert(paddr.getAddress() + len <= m_size); uint32 page_num = paddr.getAddress() >> 12; @@ -123,7 +123,7 @@ MemoryVector::write(const Address & paddr, uint8* data, int len) } if (all_zeros) return; - m_pages[page_num] = new uint8[PAGE_SIZE]; + m_pages[page_num] = new uint8_t[PAGE_SIZE]; memset(m_pages[page_num], 0, PAGE_SIZE); uint32 offset = paddr.getAddress() & m_page_offset_mask; memcpy(&m_pages[page_num][offset], data, len); @@ -133,8 +133,8 @@ MemoryVector::write(const Address & paddr, uint8* data, int len) } } -inline uint8* -MemoryVector::read(const Address & paddr, uint8* data, int len) +inline uint8_t* +MemoryVector::read(const Address & paddr, uint8_t *data, int len) { assert(paddr.getAddress() + len <= m_size); uint32 page_num = paddr.getAddress() >> 12; @@ -147,12 +147,12 @@ MemoryVector::read(const Address & paddr, uint8* data, int len) return data; } -inline uint8* +inline uint8_t* MemoryVector::getBlockPtr(const PhysAddress & paddr) { uint32 page_num = paddr.getAddress() >> 12; if (m_pages[page_num] == 0) { - m_pages[page_num] = new uint8[PAGE_SIZE]; + m_pages[page_num] = new uint8_t[PAGE_SIZE]; memset(m_pages[page_num], 0, PAGE_SIZE); } return &m_pages[page_num][paddr.getAddress()&m_page_offset_mask]; @@ -167,7 +167,7 @@ MemoryVector::getBlockPtr(const PhysAddress & paddr) */ inline uint32 -MemoryVector::collatePages(uint8* &raw_data) +MemoryVector::collatePages(uint8_t *&raw_data) { uint32 num_zero_pages = 0; uint32 data_size = 0; @@ -177,9 +177,9 @@ MemoryVector::collatePages(uint8* &raw_data) if (m_pages[i] == 0) num_zero_pages++; } - raw_data = new uint8[ sizeof(uint32) /* number of pages*/ - + m_num_pages /* whether the page is all zeros */ - + PAGE_SIZE * (m_num_pages - num_zero_pages)]; + raw_data = new uint8_t[sizeof(uint32) /* number of pages*/ + + m_num_pages /* whether the page is all zeros */ + + PAGE_SIZE * (m_num_pages - num_zero_pages)]; /* Write the number of pages to be stored. */ memcpy(raw_data, &m_num_pages, sizeof(uint32)); @@ -210,7 +210,7 @@ MemoryVector::collatePages(uint8* &raw_data) * in the checkpoint. */ inline void -MemoryVector::populatePages(uint8* raw_data) +MemoryVector::populatePages(uint8_t *raw_data) { uint32 data_size = 0; uint32 num_pages = 0; @@ -226,7 +226,7 @@ MemoryVector::populatePages(uint8* raw_data) { assert(m_pages[i] == 0); if (raw_data[data_size] != 0) { - m_pages[i] = new uint8[PAGE_SIZE]; + m_pages[i] = new uint8_t[PAGE_SIZE]; memcpy(m_pages[i], raw_data + data_size + 1, PAGE_SIZE); data_size += PAGE_SIZE; } diff --git a/src/mem/ruby/system/RubyPort.cc b/src/mem/ruby/system/RubyPort.cc index d14b3dba7..d2d82010d 100644 --- a/src/mem/ruby/system/RubyPort.cc +++ b/src/mem/ruby/system/RubyPort.cc @@ -275,7 +275,7 @@ RubyPort::M5Port::doFunctionalRead(PacketPtr pkt) } assert(num_rw <= 1); - uint8* data = pkt->getPtr<uint8_t>(true); + uint8_t *data = pkt->getPtr<uint8_t>(true); unsigned int size_in_bytes = pkt->getSize(); unsigned startByte = address.getAddress() - line_address.getAddress(); @@ -387,7 +387,7 @@ RubyPort::M5Port::doFunctionalWrite(PacketPtr pkt) num_busy, num_ro, num_rw); assert(num_rw <= 1); - uint8* data = pkt->getPtr<uint8_t>(true); + uint8_t *data = pkt->getPtr<uint8_t>(true); unsigned int size_in_bytes = pkt->getSize(); unsigned startByte = addr.getAddress() - line_addr.getAddress(); diff --git a/src/mem/ruby/system/System.cc b/src/mem/ruby/system/System.cc index c22272e03..8d8db7bbd 100644 --- a/src/mem/ruby/system/System.cc +++ b/src/mem/ruby/system/System.cc @@ -150,7 +150,7 @@ RubySystem::printStats(ostream& out) } void -RubySystem::writeCompressedTrace(uint8* raw_data, string filename, +RubySystem::writeCompressedTrace(uint8_t *raw_data, string filename, uint64 uncompressed_trace_size) { // Create the checkpoint file for the memory @@ -231,7 +231,7 @@ RubySystem::serialize(std::ostream &os) // Restore curTick curTick(curtick_original); - uint8* raw_data = NULL; + uint8_t *raw_data = NULL; if (m_mem_vec_ptr != NULL) { uint64 memory_trace_size = m_mem_vec_ptr->collatePages(raw_data); @@ -264,7 +264,7 @@ RubySystem::serialize(std::ostream &os) } void -RubySystem::readCompressedTrace(string filename, uint8*& raw_data, +RubySystem::readCompressedTrace(string filename, uint8_t *&raw_data, uint64& uncompressed_trace_size) { // Read the trace file @@ -303,7 +303,7 @@ RubySystem::unserialize(Checkpoint *cp, const string §ion) // value of curTick() // clearStats(); - uint8* uncompressed_trace = NULL; + uint8_t *uncompressed_trace = NULL; if (m_mem_vec_ptr != NULL) { string memory_trace_file; diff --git a/src/mem/ruby/system/System.hh b/src/mem/ruby/system/System.hh index 7426894d8..c7d005085 100644 --- a/src/mem/ruby/system/System.hh +++ b/src/mem/ruby/system/System.hh @@ -135,9 +135,9 @@ class RubySystem : public ClockedObject static void printSystemConfig(std::ostream& out); void readCompressedTrace(std::string filename, - uint8*& raw_data, + uint8_t *&raw_data, uint64& uncompressed_trace_size); - void writeCompressedTrace(uint8* raw_data, std::string file, + void writeCompressedTrace(uint8_t *raw_data, std::string file, uint64 uncompressed_trace_size); private: |